go get github.com/ConductorOne/conductorone-sdk-go
package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
} )
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
log.Fatal(err)
}
if res.CreateAppResponse != nil {
// handle response
}
}
- Create - Create
- CreateDelegated - Create Delegated
- Delete - Delete
- ForceSync - Force Sync
- Get - Get
- GetCredentials - Get Credentials
- List - List
- RevokeCredential - Revoke Credential
- RotateCredential - Rotate Credential
- Update - Update
- UpdateDelegated - Update Delegated
- Get - Get
- List - List
- ListForAppResource - List For App Resource
- ListForAppUser - List For App User
- ListUsers - List Users
- Update - Update
- ListAppUsersForIdentityWithGrant - List App Users For Identity With Grant
- List - List
- GenerateReport - Generate Report
- List - List
- Update - Update
- CreateAttributeValue - Create Attribute Value
- DeleteAttributeValue - Delete Attribute Value
- GetAttributeValue - Get Attribute Value
- ListAttributeTypes - List Attribute Types
- ListAttributeValues - List Attribute Values
- Introspect - Introspect
- AddAccessEntitlements - Add Access Entitlements
- AddAppEntitlements - Add App Entitlements
- Create - Create
- Delete - Delete
- Get - Get
- List - List
- ListEntitlementsForAccess - List Entitlements For Access
- ListEntitlementsPerCatalog - List Entitlements Per Catalog
- RemoveAccessEntitlements - Remove Access Entitlements
- RemoveAppEntitlements - Remove App Entitlements
- Update - Update
- Create - Create
- ValidateCEL - Validate Cel
- SearchAppResourceTypes - Search App Resource Types
- Search - Search
- SearchAttributeValues - Search Attribute Values
- Search - Search
- Search - Search
- SearchEntitlements - Search Entitlements
- Search - Search
- Search - Search
- Get - Get
- CreateGrantTask - Create Grant Task
- CreateRevokeTask - Create Revoke Task
- Get - Get
- Approve - Approve
- Comment - Comment
- Deny - Deny
- EscalateToEmergencyAccess - Escalate To Emergency Access
- Restart - Restart
- Test - Test
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 400-600 | / |
package main
import (
"context"
"errors"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/sdkerrors"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
})
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
}
}
package main
import (
"context"
conductoronesdkgo "github.com/conductorone/conductorone-sdk-go/v2"
"github.com/conductorone/conductorone-sdk-go/v2/pkg/models/shared"
"log"
)
func main() {
ctx := context.Background()
/* Optional Override
* Server URL will be extracted from client, optionally, you can
* provide a server URL or a tenant domain (will create URL https://{tenant_domain}.conductor.one)
*/
opts := []sdk.CustomSDKOption{}
opt, _ := sdk.WithTenantCustom("Server URL or Tenant Domain")
opts = append(opts, opt)
s := NewWithCredentials(ctx, &ClientCredentials{
ClientID: "",
ClientSecret: "",
} opts...)
res, err := s.Apps.Create(ctx, &shared.CreateAppRequest{
Owners: []string{
"string",
},
})
if err != nil {
log.Fatal(err)
}
if res.CreateAppResponse != nil {
// handle response
}
}
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !