Skip to content

Latest commit

 

History

History
363 lines (283 loc) · 20.9 KB

File metadata and controls

363 lines (283 loc) · 20.9 KB

AppEntitlements

(AppEntitlements)

Available Operations

Get

Get an app entitlement 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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.AppEntitlements.Get(ctx, operations.C1APIAppV1AppEntitlementsGetRequest{
        AppID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsGetResponse, error

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

List

List app entitlements associated with an app.

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.AppEntitlements.List(ctx, operations.C1APIAppV1AppEntitlementsListRequest{
        AppID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsListResponse, error

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

ListForAppResource

List app entitlements associated with an app resource.

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.AppEntitlements.ListForAppResource(ctx, operations.C1APIAppV1AppEntitlementsListForAppResourceRequest{
        AppID: "string",
        AppResourceID: "string",
        AppResourceTypeID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsListForAppResourceResponse, error

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

ListForAppUser

List app entitlements associated with an app user.

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.AppEntitlements.ListForAppUser(ctx, operations.C1APIAppV1AppEntitlementsListForAppUserRequest{
        AppID: "string",
        AppUserID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsListForAppUserResponse, error

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

ListUsers

List the users, as AppEntitlementUsers objects, of an app entitlement.

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.AppEntitlements.ListUsers(ctx, operations.C1APIAppV1AppEntitlementsListUsersRequest{
        AppEntitlementID: "string",
        AppID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsListUsersResponse, error

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

Update

Update an app entitlement 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: "Bearer <YOUR_ACCESS_TOKEN_HERE>",
        }),
    )

    ctx := context.Background()
    res, err := s.AppEntitlements.Update(ctx, operations.C1APIAppV1AppEntitlementsUpdateRequest{
        UpdateAppEntitlementRequest: &shared.UpdateAppEntitlementRequest{
            AppEntitlement: &shared.AppEntitlementInput{
                ProvisionPolicy: &shared.ProvisionPolicy{
                    ConnectorProvision: &shared.ConnectorProvision{},
                    DelegatedProvision: &shared.DelegatedProvision{},
                    ManualProvision: &shared.ManualProvision{
                        UserIds: []string{
                            "string",
                        },
                    },
                },
                ComplianceFrameworkValueIds: []string{
                    "string",
                },
                DurationUnset: &shared.DurationUnset{},
            },
            AppEntitlementExpandMask: &shared.AppEntitlementExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        AppID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1AppEntitlementsUpdateResponse, error

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