Skip to content

Latest commit

 

History

History
316 lines (249 loc) · 18.8 KB

File metadata and controls

316 lines (249 loc) · 18.8 KB

TaskActions

(TaskActions)

Available Operations

Approve

Invokes the c1.api.task.v1.TaskActionsService.Approve method.

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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.TaskActions.Approve(ctx, operations.C1APITaskV1TaskActionsServiceApproveRequest{
        TaskActionsServiceApproveRequest: &shared.TaskActionsServiceApproveRequest{
            TaskExpandMask: &shared.TaskExpandMask{
                Paths: []string{
                    "string",
                },
            },
            PolicyStepID: "string",
        },
        TaskID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.TaskActionsServiceApproveResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.C1APITaskV1TaskActionsServiceApproveRequest ✔️ The request object to use for the request.

Response

*operations.C1APITaskV1TaskActionsServiceApproveResponse, error

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

Comment

Invokes the c1.api.task.v1.TaskActionsService.Comment method.

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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.TaskActions.Comment(ctx, operations.C1APITaskV1TaskActionsServiceCommentRequest{
        TaskActionsServiceCommentRequest: &shared.TaskActionsServiceCommentRequest{
            TaskExpandMask: &shared.TaskExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        TaskID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.TaskActionsServiceCommentResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.C1APITaskV1TaskActionsServiceCommentRequest ✔️ The request object to use for the request.

Response

*operations.C1APITaskV1TaskActionsServiceCommentResponse, error

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

Deny

Invokes the c1.api.task.v1.TaskActionsService.Deny method.

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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.TaskActions.Deny(ctx, operations.C1APITaskV1TaskActionsServiceDenyRequest{
        TaskActionsServiceDenyRequest: &shared.TaskActionsServiceDenyRequest{
            TaskExpandMask: &shared.TaskExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        TaskID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.TaskActionsServiceDenyResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.C1APITaskV1TaskActionsServiceDenyRequest ✔️ The request object to use for the request.

Response

*operations.C1APITaskV1TaskActionsServiceDenyResponse, error

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

EscalateToEmergencyAccess

Invokes the c1.api.task.v1.TaskActionsService.EscalateToEmergencyAccess method.

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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.TaskActions.EscalateToEmergencyAccess(ctx, operations.C1APITaskV1TaskActionsServiceEscalateToEmergencyAccessRequest{
        TaskActionsServiceEscalateToEmergencyAccessRequest: &shared.TaskActionsServiceEscalateToEmergencyAccessRequest{
            TaskExpandMask: &shared.TaskExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        TaskID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.TaskServiceActionResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.C1APITaskV1TaskActionsServiceEscalateToEmergencyAccessRequest ✔️ The request object to use for the request.

Response

*operations.C1APITaskV1TaskActionsServiceEscalateToEmergencyAccessResponse, error

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

Restart

Invokes the c1.api.task.v1.TaskActionsService.Restart method.

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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.TaskActions.Restart(ctx, operations.C1APITaskV1TaskActionsServiceRestartRequest{
        TaskActionsServiceRestartRequest: &shared.TaskActionsServiceRestartRequest{
            TaskExpandMask: &shared.TaskExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        TaskID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.TaskActionsServiceRestartResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.C1APITaskV1TaskActionsServiceRestartRequest ✔️ The request object to use for the request.

Response

*operations.C1APITaskV1TaskActionsServiceRestartResponse, error

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