Skip to content

Latest commit

 

History

History
216 lines (167 loc) · 12.9 KB

README.md

File metadata and controls

216 lines (167 loc) · 12.9 KB

Task

(Task)

Available Operations

CreateGrantTask

Create a grant task

Example Usage

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
    }
}

Parameters

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.

Response

*operations.C1APITaskV1TaskServiceCreateGrantTaskResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

CreateOffboardingTask

Invokes the c1.api.task.v1.TaskService.CreateOffboardingTask method.

Example Usage

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
    }
}

Parameters

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.

Response

*operations.C1APITaskV1TaskServiceCreateOffboardingTaskResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

CreateRevokeTask

Create a revoke task

Example Usage

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
    }
}

Parameters

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.

Response

*operations.C1APITaskV1TaskServiceCreateRevokeTaskResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

Get

Get a task by ID

Example Usage

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
    }
}

Parameters

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.

Response

*operations.C1APITaskV1TaskServiceGetResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /