Skip to content

Latest commit

 

History

History
630 lines (498 loc) · 35.9 KB

README.md

File metadata and controls

630 lines (498 loc) · 35.9 KB

Connector

(Connector)

Available Operations

Create

Create a configured connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.Create(ctx, operations.C1APIAppV1ConnectorServiceCreateRequest{
        ConnectorServiceCreateRequest: &shared.ConnectorServiceCreateRequest{
            ConnectorExpandMask: &shared.ConnectorExpandMask{
                Paths: []string{
                    "string",
                },
            },
            Config: &shared.ConnectorServiceCreateRequestConfig{
                AdditionalProperties: map[string]interface{}{
                    "key": "string",
                },
            },
            UserIds: []string{
                "string",
            },
        },
        AppID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceCreateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

CreateDelegated

Create a connector that is pending a connector config.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.CreateDelegated(ctx, operations.C1APIAppV1ConnectorServiceCreateDelegatedRequest{
        ConnectorServiceCreateDelegatedRequest: &shared.ConnectorServiceCreateDelegatedRequest{
            ConnectorExpandMask: &shared.ConnectorExpandMask{
                Paths: []string{
                    "string",
                },
            },
            UserIds: []string{
                "string",
            },
        },
        AppID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceCreateDelegatedResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

Delete

Delete a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.Delete(ctx, operations.C1APIAppV1ConnectorServiceDeleteRequest{
        ConnectorServiceDeleteRequest: &shared.ConnectorServiceDeleteRequest{},
        AppID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceDeleteResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

Get

Get a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

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

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceGetResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

GetCredentials

Get credentials for a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.GetCredentials(ctx, operations.C1APIAppV1ConnectorServiceGetCredentialsRequest{
        AppID: "string",
        ConnectorID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceGetCredentialsResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

List

List connectors for an app.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.List(ctx, operations.C1APIAppV1ConnectorServiceListRequest{
        AppID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceListResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

RevokeCredential

Revoke credentials for a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.RevokeCredential(ctx, operations.C1APIAppV1ConnectorServiceRevokeCredentialRequest{
        ConnectorServiceRevokeCredentialRequest: &shared.ConnectorServiceRevokeCredentialRequest{},
        AppID: "string",
        ConnectorID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceRevokeCredentialResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

RotateCredential

Rotate credentials for a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.RotateCredential(ctx, operations.C1APIAppV1ConnectorServiceRotateCredentialRequest{
        ConnectorServiceRotateCredentialRequest: &shared.ConnectorServiceRotateCredentialRequest{},
        AppID: "string",
        ConnectorID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceRotateCredentialResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

Update

Update a connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.Update(ctx, operations.C1APIAppV1ConnectorServiceUpdateRequest{
        ConnectorServiceUpdateRequest: &shared.ConnectorServiceUpdateRequest{
            Connector: &shared.ConnectorInput{
                ConnectorStatus: &shared.ConnectorStatus{},
                OAuth2AuthorizedAs: &shared.OAuth2AuthorizedAsInput{},
                Config: &shared.Config{
                    AdditionalProperties: map[string]interface{}{
                        "key": "string",
                    },
                },
                UserIds: []string{
                    "string",
                },
            },
            ConnectorExpandMask: &shared.ConnectorExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        AppID: "string",
        ID: "<ID>",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceUpdateResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /

UpdateDelegated

Update a delegated connector.

Example Usage

package main

import(
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
	"context"
	"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/operations"
	"log"
)

func main() {
    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "",
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Connector.UpdateDelegated(ctx, operations.C1APIAppV1ConnectorServiceUpdateDelegatedRequest{
        ConnectorServiceUpdateDelegatedRequest: &shared.ConnectorServiceUpdateDelegatedRequest{
            Connector: &shared.ConnectorInput{
                ConnectorStatus: &shared.ConnectorStatus{},
                OAuth2AuthorizedAs: &shared.OAuth2AuthorizedAsInput{},
                Config: &shared.Config{
                    AdditionalProperties: map[string]interface{}{
                        "key": "string",
                    },
                },
                UserIds: []string{
                    "string",
                },
            },
            ConnectorExpandMask: &shared.ConnectorExpandMask{
                Paths: []string{
                    "string",
                },
            },
        },
        ConnectorAppID: "string",
        ConnectorID: "string",
    })
    if err != nil {
        log.Fatal(err)
    }

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

Parameters

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

Response

*operations.C1APIAppV1ConnectorServiceUpdateDelegatedResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 400-600 /