mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-08 12:27:47 +00:00
update layout for method examples
This commit is contained in:
@@ -65,11 +65,15 @@ Code | Description | Data Type | Response headers |
|
||||
|
||||
```python
|
||||
import sailpoint.beta
|
||||
from sailpoint.beta.api.personal_access_tokens_api import PersonalAccessTokensApi
|
||||
from sailpoint.beta.api_client import ApiClient
|
||||
from sailpoint.beta.models.create_personal_access_token_request import CreatePersonalAccessTokenRequest
|
||||
from sailpoint.beta.models.create_personal_access_token_response import CreatePersonalAccessTokenResponse
|
||||
from sailpoint.beta.rest import ApiException
|
||||
from pprint import pprint
|
||||
from sailpoint.configuration import Configuration
|
||||
configuration = Configuration()
|
||||
|
||||
with ApiClient(configuration) as api_client:
|
||||
create_personal_access_token_request = {
|
||||
"scope" : [ "demo:personal-access-token-scope:first", "demo:personal-access-token-scope:second" ],
|
||||
"accessTokenValiditySeconds" : 36900,
|
||||
@@ -78,14 +82,14 @@ from pprint import pprint
|
||||
|
||||
try:
|
||||
# Create Personal Access Token
|
||||
Result = create_personal_access_token_request.from_json(create_personal_access_token_request)
|
||||
api_response = api_instance.create_personal_access_token(Result)
|
||||
|
||||
new_create_personal_access_token_request = CreatePersonalAccessTokenRequest()
|
||||
new_create_personal_access_token_request.from_json(create_personal_access_token_request)
|
||||
results =PersonalAccessTokensApi(api_client).create_personal_access_token(new_create_personal_access_token_request)
|
||||
# Below is a request that includes all optional parameters
|
||||
# api_response = api_instance.create_personal_access_token(Result)
|
||||
# results = PersonalAccessTokensApi(api_client).create_personal_access_token(new_create_personal_access_token_request)
|
||||
print("The response of PersonalAccessTokensApi->create_personal_access_token:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
pprint(results)
|
||||
except Exception as e:
|
||||
print("Exception when calling PersonalAccessTokensApi->create_personal_access_token: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -127,19 +131,22 @@ Code | Description | Data Type | Response headers |
|
||||
|
||||
```python
|
||||
import sailpoint.beta
|
||||
from sailpoint.beta.rest import ApiException
|
||||
from sailpoint.beta.api.personal_access_tokens_api import PersonalAccessTokensApi
|
||||
from sailpoint.beta.api_client import ApiClient
|
||||
from pprint import pprint
|
||||
from sailpoint.configuration import Configuration
|
||||
configuration = Configuration()
|
||||
|
||||
with ApiClient(configuration) as api_client:
|
||||
id = 'ef38f94347e94562b5bb8424a56397d8' # str | The personal access token id # str | The personal access token id
|
||||
|
||||
try:
|
||||
# Delete Personal Access Token
|
||||
|
||||
api_instance.delete_personal_access_token(id)
|
||||
|
||||
PersonalAccessTokensApi(api_client).delete_personal_access_token(id)
|
||||
# Below is a request that includes all optional parameters
|
||||
# api_instance.delete_personal_access_token(id)
|
||||
except Exception as e:
|
||||
# PersonalAccessTokensApi(api_client).delete_personal_access_token(id)
|
||||
except Exception as e:
|
||||
print("Exception when calling PersonalAccessTokensApi->delete_personal_access_token: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -181,23 +188,26 @@ Code | Description | Data Type | Response headers |
|
||||
|
||||
```python
|
||||
import sailpoint.beta
|
||||
from sailpoint.beta.api.personal_access_tokens_api import PersonalAccessTokensApi
|
||||
from sailpoint.beta.api_client import ApiClient
|
||||
from sailpoint.beta.models.get_personal_access_token_response import GetPersonalAccessTokenResponse
|
||||
from sailpoint.beta.rest import ApiException
|
||||
from pprint import pprint
|
||||
from sailpoint.configuration import Configuration
|
||||
configuration = Configuration()
|
||||
|
||||
with ApiClient(configuration) as api_client:
|
||||
owner_id = '2c9180867b50d088017b554662fb281e' # str | The identity ID of the owner whose personal access tokens should be listed. If \"me\", the caller should have the following right: 'idn:my-personal-access-tokens:read' If an actual owner ID or if the `owner-id` parameter is omitted in the request, the caller should have the following right: 'idn:all-personal-access-tokens:read'. If the caller has the following right, then managed personal access tokens associated with `owner-id` will be retrieved: 'idn:managed-personal-access-tokens:read' (optional) # str | The identity ID of the owner whose personal access tokens should be listed. If \"me\", the caller should have the following right: 'idn:my-personal-access-tokens:read' If an actual owner ID or if the `owner-id` parameter is omitted in the request, the caller should have the following right: 'idn:all-personal-access-tokens:read'. If the caller has the following right, then managed personal access tokens associated with `owner-id` will be retrieved: 'idn:managed-personal-access-tokens:read' (optional)
|
||||
filters = 'lastUsed le 2023-02-05T10:59:27.214Z' # str | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **lastUsed**: *le, isnull* (optional) # str | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **lastUsed**: *le, isnull* (optional)
|
||||
|
||||
try:
|
||||
# List Personal Access Tokens
|
||||
|
||||
api_response = api_instance.list_personal_access_tokens()
|
||||
|
||||
results =PersonalAccessTokensApi(api_client).list_personal_access_tokens()
|
||||
# Below is a request that includes all optional parameters
|
||||
# api_response = api_instance.list_personal_access_tokens(owner_id, filters)
|
||||
# results = PersonalAccessTokensApi(api_client).list_personal_access_tokens(owner_id, filters)
|
||||
print("The response of PersonalAccessTokensApi->list_personal_access_tokens:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
pprint(results)
|
||||
except Exception as e:
|
||||
print("Exception when calling PersonalAccessTokensApi->list_personal_access_tokens: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -240,11 +250,15 @@ Code | Description | Data Type | Response headers |
|
||||
|
||||
```python
|
||||
import sailpoint.beta
|
||||
from sailpoint.beta.api.personal_access_tokens_api import PersonalAccessTokensApi
|
||||
from sailpoint.beta.api_client import ApiClient
|
||||
from sailpoint.beta.models.get_personal_access_token_response import GetPersonalAccessTokenResponse
|
||||
from sailpoint.beta.models.json_patch_operation import JsonPatchOperation
|
||||
from sailpoint.beta.rest import ApiException
|
||||
from pprint import pprint
|
||||
from sailpoint.configuration import Configuration
|
||||
configuration = Configuration()
|
||||
|
||||
with ApiClient(configuration) as api_client:
|
||||
id = 'ef38f94347e94562b5bb8424a56397d8' # str | The Personal Access Token id # str | The Personal Access Token id
|
||||
[{op=replace, path=/name, value=New name}, {op=replace, path=/scope, value=[sp:scopes:all]}] # List[JsonPatchOperation] | A list of OAuth client update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * scope
|
||||
json_patch_operation = {
|
||||
@@ -256,14 +270,14 @@ from pprint import pprint
|
||||
|
||||
try:
|
||||
# Patch Personal Access Token
|
||||
Result = json_patch_operation.from_json(json_patch_operation)
|
||||
api_response = api_instance.patch_personal_access_token(id, Result)
|
||||
|
||||
new_json_patch_operation = JsonPatchOperation()
|
||||
new_json_patch_operation.from_json(json_patch_operation)
|
||||
results =PersonalAccessTokensApi(api_client).patch_personal_access_token(id, new_json_patch_operation)
|
||||
# Below is a request that includes all optional parameters
|
||||
# api_response = api_instance.patch_personal_access_token(id, Result)
|
||||
# results = PersonalAccessTokensApi(api_client).patch_personal_access_token(id, new_json_patch_operation)
|
||||
print("The response of PersonalAccessTokensApi->patch_personal_access_token:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
pprint(results)
|
||||
except Exception as e:
|
||||
print("Exception when calling PersonalAccessTokensApi->patch_personal_access_token: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user