(Task)
- CreateGrantTask - Create Grant Task
- CreateOffboardingTask - Create Offboarding Task
- CreateRevokeTask - Create Revoke Task
- Get - Get
Create a grant task
package main
import(
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"context"
"log"
)
func main() {
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
ctx := context.Background()
res, err := s.Task.CreateGrantTask(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.TaskServiceCreateGrantResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.TaskServiceCreateGrantRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.C1APITaskV1TaskServiceCreateGrantTaskResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Invokes the c1.api.task.v1.TaskService.CreateOffboardingTask method.
package main
import(
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"context"
"log"
)
func main() {
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
ctx := context.Background()
res, err := s.Task.CreateOffboardingTask(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.TaskServiceCreateOffboardingResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.TaskServiceCreateOffboardingRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.C1APITaskV1TaskServiceCreateOffboardingTaskResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Create a revoke task
package main
import(
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"context"
"log"
)
func main() {
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
ctx := context.Background()
res, err := s.Task.CreateRevokeTask(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.TaskServiceCreateRevokeResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
shared.TaskServiceCreateRevokeRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.C1APITaskV1TaskServiceCreateRevokeTaskResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Get a task by ID
package main
import(
"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
"github.com/conductorone/conductorone-sdk-go/pkg/models/operations"
"context"
"log"
)
func main() {
s := conductoronesdkgo.New(
conductoronesdkgo.WithSecurity(shared.Security{
BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
Oauth: "<YOUR_OAUTH_HERE>",
}),
)
request := operations.C1APITaskV1TaskServiceGetRequest{
ID: "<id>",
}
ctx := context.Background()
res, err := s.Task.Get(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.TaskServiceGetResponse != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.C1APITaskV1TaskServiceGetRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.C1APITaskV1TaskServiceGetResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |