Skip to content

Latest commit

 

History

History
226 lines (171 loc) · 12.9 KB

README.md

File metadata and controls

226 lines (171 loc) · 12.9 KB

Task

(Task)

Overview

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

Errors

Error Type 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

Errors

Error Type 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

Errors

Error Type 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"
	"context"
	"github.com/conductorone/conductorone-sdk-go/pkg/models/operations"
	"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.Get(ctx, operations.C1APITaskV1TaskServiceGetRequest{
        ID: "<id>",
    })
    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

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*