pip install git+https://github.com/ConductorOne/conductorone-sdk-python.git
import sdk
from sdk.models import shared
s = sdk.sdk_with_credentials("CLIENT_ID", "CLIENT_SECRET")
req = shared.AppEntitlementSearchServiceSearchRequest(
page_size=100,
)
res = s.app_entitlement_search.search(req)
if res.app_entitlement_search_service_search_response is not None:
# For more decoding options, see `https://pypi.org/project/dataclasses-json/`
res = res.app_entitlement_search_service_search_response.to_dict()
- create - Create
- create_delegated - Create Delegated
- delete - Delete
- force_sync - Force Sync
- get - Get
- get_credentials - Get Credentials
- list - List
- revoke_credential - Revoke Credential
- rotate_credential - Rotate Credential
- update - Update
- update_delegated - Update Delegated
- get - Get
- list - List
- list_for_app_resource - List For App Resource
- list_for_app_user - List For App User
- list_users - List Users
- update - Update
- list_app_users_for_identity_with_grant - List App Users For Identity With Grant
- list - List
- generate_report - Generate Report
- list - List
- update - Update
- create_attribute_value - Create Attribute Value
- delete_attribute_value - Delete Attribute Value
- get_attribute_value - Get Attribute Value
- list_attribute_types - List Attribute Types
- list_attribute_values - List Attribute Values
- introspect - Introspect
- add_access_entitlements - Add Access Entitlements
- add_app_entitlements - Add App Entitlements
- create - Create
- delete - Delete
- get - Get
- list - List
- list_entitlements_for_access - List Entitlements For Access
- list_entitlements_per_catalog - List Entitlements Per Catalog
- remove_access_entitlements - Remove Access Entitlements
- remove_app_entitlements - Remove App Entitlements
- update - Update
- create - Create
- validate_cel - Validate Cel
- search_app_resource_types - Search App Resource Types
- search - Search
- search_attribute_values - Search Attribute Values
- search - Search
- search - Search
- search_entitlements - Search Entitlements
- search - Search
- search - Search
- get - Get
- create_grant_task - Create Grant Task
- create_revoke_task - Create Revoke Task
- get - Get
- approve - Approve
- comment - Comment
- deny - Deny
- escalate_to_emergency_access - 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 raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4x-5xx | / |
import sdk
from sdk.models import errors, shared
s = sdk.SDK(
security=shared.Security(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
oauth="Bearer <YOUR_ACCESS_TOKEN_HERE>",
),
)
req = shared.CreateAppRequest()
res = None
try:
res = s.apps.create(req)
except errors.SDKError as e:
# handle exception
raise(e)
if res.create_app_response is not None:
# handle response
pass
You can override the default server globally by passing a server index to the server_idx: int
optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
# | Server | Variables |
---|---|---|
0 | https://{tenantDomain}.conductor.one |
tenantDomain (default is example ) |
import sdk
from sdk.models import shared
s = sdk.SDK(
server_idx=0,
security=shared.Security(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
oauth="Bearer <YOUR_ACCESS_TOKEN_HERE>",
),
)
req = shared.CreateAppRequest()
res = s.apps.create(req)
if res.create_app_response is not None:
# handle response
pass
Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:
tenant_domain: str
The default server can also be overridden globally by passing a URL to the server_url: str
optional parameter when initializing the SDK client instance. For example:
import sdk
from sdk.models import shared
s = sdk.SDK(
server_url="https://{tenantDomain}.conductor.one",
security=shared.Security(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
oauth="Bearer <YOUR_ACCESS_TOKEN_HERE>",
),
)
req = shared.CreateAppRequest()
res = s.apps.create(req)
if res.create_app_response is not None:
# handle response
pass
The Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session
object.
For example, you could specify a header for every request that this sdk makes as follows:
import sdk
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = sdk.SDK(client: http_client)
This SDK supports the following security schemes globally:
Name | Type | Scheme |
---|---|---|
bearer_auth |
http | HTTP Bearer |
oauth |
oauth2 | OAuth2 token |
You can set the security parameters through the security
optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
import sdk
from sdk.models import shared
s = sdk.SDK(
security=shared.Security(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
oauth="Bearer <YOUR_ACCESS_TOKEN_HERE>",
),
)
req = shared.CreateAppRequest()
res = s.apps.create(req)
if res.create_app_response is not None:
# handle response
pass
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!