agilicus 1.246.1__py3-none-any.whl → 1.247.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. agilicus/.openapi-generator/FILES +19 -0
  2. agilicus/agilicus_api/__init__.py +6 -0
  3. agilicus/agilicus_api/api/policy_templates_api.py +684 -0
  4. agilicus/agilicus_api/api/policy_templates_api_mock.py +41 -0
  5. agilicus/agilicus_api/api_client.py +1 -1
  6. agilicus/agilicus_api/apis/__init__.py +1 -0
  7. agilicus/agilicus_api/configuration.py +1 -1
  8. agilicus/agilicus_api/docs/ListPolicyTemplateInstancesResponse.md +14 -0
  9. agilicus/agilicus_api/docs/MFAPolicyTemplate.md +15 -0
  10. agilicus/agilicus_api/docs/PolicyTemplate.md +14 -0
  11. agilicus/agilicus_api/docs/PolicyTemplateInstance.md +14 -0
  12. agilicus/agilicus_api/docs/PolicyTemplateInstanceSpec.md +16 -0
  13. agilicus/agilicus_api/docs/PolicyTemplatesApi.md +463 -0
  14. agilicus/agilicus_api/docs/ResourceURL.md +1 -1
  15. agilicus/agilicus_api/model/list_policy_template_instances_response.py +295 -0
  16. agilicus/agilicus_api/model/mfa_policy_template.py +309 -0
  17. agilicus/agilicus_api/model/policy_template.py +358 -0
  18. agilicus/agilicus_api/model/policy_template_instance.py +295 -0
  19. agilicus/agilicus_api/model/policy_template_instance_spec.py +334 -0
  20. agilicus/agilicus_api/model/resource_url.py +2 -2
  21. agilicus/agilicus_api/models/__init__.py +5 -0
  22. agilicus/agilicus_api/test/test_list_policy_template_instances_response.py +38 -0
  23. agilicus/agilicus_api/test/test_mfa_policy_template.py +38 -0
  24. agilicus/agilicus_api/test/test_policy_template.py +40 -0
  25. agilicus/agilicus_api/test/test_policy_template_instance.py +40 -0
  26. agilicus/agilicus_api/test/test_policy_template_instance_spec.py +38 -0
  27. agilicus/agilicus_api/test/test_policy_templates_api.py +64 -0
  28. agilicus/agilicus_api_README.md +11 -1
  29. agilicus/context.py +3 -0
  30. agilicus/policy/policies.py +32 -47
  31. {agilicus-1.246.1.dist-info → agilicus-1.247.0.dist-info}/METADATA +1 -1
  32. {agilicus-1.246.1.dist-info → agilicus-1.247.0.dist-info}/RECORD +35 -16
  33. {agilicus-1.246.1.dist-info → agilicus-1.247.0.dist-info}/LICENSE.txt +0 -0
  34. {agilicus-1.246.1.dist-info → agilicus-1.247.0.dist-info}/WHEEL +0 -0
  35. {agilicus-1.246.1.dist-info → agilicus-1.247.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,41 @@
1
+ from unittest.mock import MagicMock
2
+
3
+ class PolicyTemplatesApiMock:
4
+
5
+ def __init__(self):
6
+ self.mock_create_policy_template_instance = MagicMock()
7
+ self.mock_delete_policy_template_instance = MagicMock()
8
+ self.mock_get_policy_template_instance = MagicMock()
9
+ self.mock_list_policy_template_instances = MagicMock()
10
+ self.mock_replace_policy_template_instance = MagicMock()
11
+
12
+ def create_policy_template_instance(self, *args, **kwargs):
13
+ """
14
+ This method mocks the original api PolicyTemplatesApi.create_policy_template_instance with MagicMock.
15
+ """
16
+ return self.mock_create_policy_template_instance(self, *args, **kwargs)
17
+
18
+ def delete_policy_template_instance(self, *args, **kwargs):
19
+ """
20
+ This method mocks the original api PolicyTemplatesApi.delete_policy_template_instance with MagicMock.
21
+ """
22
+ return self.mock_delete_policy_template_instance(self, *args, **kwargs)
23
+
24
+ def get_policy_template_instance(self, *args, **kwargs):
25
+ """
26
+ This method mocks the original api PolicyTemplatesApi.get_policy_template_instance with MagicMock.
27
+ """
28
+ return self.mock_get_policy_template_instance(self, *args, **kwargs)
29
+
30
+ def list_policy_template_instances(self, *args, **kwargs):
31
+ """
32
+ This method mocks the original api PolicyTemplatesApi.list_policy_template_instances with MagicMock.
33
+ """
34
+ return self.mock_list_policy_template_instances(self, *args, **kwargs)
35
+
36
+ def replace_policy_template_instance(self, *args, **kwargs):
37
+ """
38
+ This method mocks the original api PolicyTemplatesApi.replace_policy_template_instance with MagicMock.
39
+ """
40
+ return self.mock_replace_policy_template_instance(self, *args, **kwargs)
41
+
@@ -77,7 +77,7 @@ class ApiClient(object):
77
77
  self.default_headers[header_name] = header_value
78
78
  self.cookie = cookie
79
79
  # Set default User-Agent.
80
- self.user_agent = 'OpenAPI-Generator/1.246.1/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.247.0/python'
81
81
 
82
82
  def __enter__(self):
83
83
  return self
@@ -37,6 +37,7 @@ from agilicus_api.api.metrics_api import MetricsApi
37
37
  from agilicus_api.api.organisations_api import OrganisationsApi
38
38
  from agilicus_api.api.permissions_api import PermissionsApi
39
39
  from agilicus_api.api.policy_api import PolicyApi
40
+ from agilicus_api.api.policy_templates_api import PolicyTemplatesApi
40
41
  from agilicus_api.api.regions_api import RegionsApi
41
42
  from agilicus_api.api.resources_api import ResourcesApi
42
43
  from agilicus_api.api.rules_api import RulesApi
@@ -387,7 +387,7 @@ class Configuration(object):
387
387
  "OS: {env}\n"\
388
388
  "Python Version: {pyversion}\n"\
389
389
  "Version of the API: 2024.03.26\n"\
390
- "SDK Package Version: 1.246.1".\
390
+ "SDK Package Version: 1.247.0".\
391
391
  format(env=sys.platform, pyversion=sys.version)
392
392
 
393
393
  def get_host_settings(self):
@@ -0,0 +1,14 @@
1
+ # ListPolicyTemplateInstancesResponse
2
+
3
+ Response object for listing PolicyTemplateInstance objects.
4
+
5
+ ## Properties
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **policy_template_instances** | [**[PolicyTemplateInstance]**](PolicyTemplateInstance.md) | List of PolicyTemplateInstance objects |
9
+ **limit** | **int** | The maximum number of records returned in the response. |
10
+ **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
11
+
12
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13
+
14
+
@@ -0,0 +1,15 @@
1
+ # MFAPolicyTemplate
2
+
3
+ Requires that users present a second factor within the given time period when trying to access resources matching the provided labels
4
+
5
+ ## Properties
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **seconds_since_last_challenge** | **int** | Challenge the user if they have not presented a second factor for the current session in the last N seconds. |
9
+ **labels** | [**[LabelName]**](LabelName.md) | Restrict the challenge to accesses for resources with one of these labels. |
10
+ **template_type** | **str** | The descriminator for the PolicyTemplate. Set this to `mfa` |
11
+ **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
12
+
13
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14
+
15
+
@@ -0,0 +1,14 @@
1
+ # PolicyTemplate
2
+
3
+
4
+ ## Properties
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **template_type** | **str** | The descriminator for the PolicyTemplate. Set this to `mfa` |
8
+ **seconds_since_last_challenge** | **int** | Challenge the user if they have not presented a second factor for the current session in the last N seconds. | [optional]
9
+ **labels** | [**[LabelName]**](LabelName.md) | Restrict the challenge to accesses for resources with one of these labels. | [optional]
10
+ **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
11
+
12
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13
+
14
+
@@ -0,0 +1,14 @@
1
+ # PolicyTemplateInstance
2
+
3
+ A policy template. Each PolicyTemplateInstance instantiates a specific precanned set of policy constructs which compose the overall policy for an organistion. For example you can create a PolicyTemplateInsance which defines the parameters of a template which defines when a user must present a second factor when accesing a resource. Mulitple insances of a given template can coexist. They can be updated and deleted independently as requirements change. A template is uniquely identified by a 'name' passed at instantiation time.` By default, template instances are hooked into the global policy of the organisation.
4
+
5
+ ## Properties
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **spec** | [**PolicyTemplateInstanceSpec**](PolicyTemplateInstanceSpec.md) | |
9
+ **metadata** | [**MetadataWithId**](MetadataWithId.md) | | [optional]
10
+ **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
11
+
12
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13
+
14
+
@@ -0,0 +1,16 @@
1
+ # PolicyTemplateInstanceSpec
2
+
3
+ The definition of a PolicyTemplateInstance. `template` defines the concrete parameters of the template as well as its type. The org id defines the organisation to which the template applies.
4
+
5
+ ## Properties
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **org_id** | **str** | Unique identifier |
9
+ **template** | [**PolicyTemplate**](PolicyTemplate.md) | |
10
+ **name** | **str** | A short name used to unqiuely identify this instance. May be descriptive, but primarily used for idempotency. Cannot be changed after creation. |
11
+ **description** | **str** | A brief description of the template | [optional]
12
+ **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
13
+
14
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15
+
16
+
@@ -0,0 +1,463 @@
1
+ # agilicus_api.PolicyTemplatesApi
2
+
3
+ All URIs are relative to *https://api.agilicus.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_policy_template_instance**](PolicyTemplatesApi.md#create_policy_template_instance) | **POST** /v1/policy_template_instances | Add a PolicyTemplateInstance
8
+ [**delete_policy_template_instance**](PolicyTemplatesApi.md#delete_policy_template_instance) | **DELETE** /v1/policy_template_instances/{template_name} | Delete a PolicyTemplateInstance
9
+ [**get_policy_template_instance**](PolicyTemplatesApi.md#get_policy_template_instance) | **GET** /v1/policy_template_instances/{template_name} | Get a PolicyTemplateInstance
10
+ [**list_policy_template_instances**](PolicyTemplatesApi.md#list_policy_template_instances) | **GET** /v1/policy_template_instances | List all standalone policy_templates
11
+ [**replace_policy_template_instance**](PolicyTemplatesApi.md#replace_policy_template_instance) | **PUT** /v1/policy_template_instances/{template_name} | update a PolicyTemplateInstance
12
+
13
+
14
+ # **create_policy_template_instance**
15
+ > PolicyTemplateInstance create_policy_template_instance(policy_template_instance)
16
+
17
+ Add a PolicyTemplateInstance
18
+
19
+ Adds a new PolicyTemplateInstance. PolicyTemplates must have unique names within an org for a particular type of template. If the name is not unique, a 409 will be returned.
20
+
21
+ ### Example
22
+
23
+ * Bearer (JWT) Authentication (token-valid):
24
+ ```python
25
+ import time
26
+ import agilicus_api
27
+ from agilicus_api.api import policy_templates_api
28
+ from agilicus_api.model.error_message import ErrorMessage
29
+ from agilicus_api.model.policy_template_instance import PolicyTemplateInstance
30
+ from pprint import pprint
31
+ # Defining the host is optional and defaults to https://api.agilicus.com
32
+ # See configuration.py for a list of all supported configuration parameters.
33
+ configuration = agilicus_api.Configuration(
34
+ host = "https://api.agilicus.com"
35
+ )
36
+
37
+ # The client must configure the authentication and authorization parameters
38
+ # in accordance with the API server security policy.
39
+ # Examples for each auth method are provided below, use the example that
40
+ # satisfies your auth use case.
41
+
42
+ # Configure Bearer authorization (JWT): token-valid
43
+ configuration = agilicus_api.Configuration(
44
+ access_token = 'YOUR_BEARER_TOKEN'
45
+ )
46
+
47
+ # Enter a context with an instance of the API client
48
+ with agilicus_api.ApiClient(configuration) as api_client:
49
+ # Create an instance of the API class
50
+ api_instance = policy_templates_api.PolicyTemplatesApi(api_client)
51
+ policy_template_instance = PolicyTemplateInstance(
52
+ metadata=MetadataWithId(),
53
+ spec=PolicyTemplateInstanceSpec(
54
+ org_id="123",
55
+ template=PolicyTemplate(
56
+ seconds_since_last_challenge=1,
57
+ labels=[
58
+ LabelName("site-A"),
59
+ ],
60
+ template_type="MFAPolicyTemplate",
61
+ ),
62
+ description="Restrict access to sensitive resources",
63
+ name="2",
64
+ ),
65
+ ) # PolicyTemplateInstance |
66
+
67
+ # example passing only required values which don't have defaults set
68
+ try:
69
+ # Add a PolicyTemplateInstance
70
+ api_response = api_instance.create_policy_template_instance(policy_template_instance)
71
+ pprint(api_response)
72
+ except agilicus_api.ApiException as e:
73
+ print("Exception when calling PolicyTemplatesApi->create_policy_template_instance: %s\n" % e)
74
+ ```
75
+
76
+
77
+ ### Parameters
78
+
79
+ Name | Type | Description | Notes
80
+ ------------- | ------------- | ------------- | -------------
81
+ **policy_template_instance** | [**PolicyTemplateInstance**](PolicyTemplateInstance.md)| |
82
+
83
+ ### Return type
84
+
85
+ [**PolicyTemplateInstance**](PolicyTemplateInstance.md)
86
+
87
+ ### Authorization
88
+
89
+ [token-valid](../README.md#token-valid)
90
+
91
+ ### HTTP request headers
92
+
93
+ - **Content-Type**: application/json
94
+ - **Accept**: application/json
95
+
96
+
97
+ ### HTTP response details
98
+ | Status code | Description | Response headers |
99
+ |-------------|-------------|------------------|
100
+ **201** | New PolicyTemplateInstance created. | - |
101
+ **400** | The request is invalid | - |
102
+ **409** | PolicyTemplateInstance already exists. The existing template is returned. | - |
103
+
104
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
105
+
106
+ # **delete_policy_template_instance**
107
+ > delete_policy_template_instance(template_name)
108
+
109
+ Delete a PolicyTemplateInstance
110
+
111
+ Delete a PolicyTemplateInstance
112
+
113
+ ### Example
114
+
115
+ * Bearer (JWT) Authentication (token-valid):
116
+ ```python
117
+ import time
118
+ import agilicus_api
119
+ from agilicus_api.api import policy_templates_api
120
+ from agilicus_api.model.error_message import ErrorMessage
121
+ from pprint import pprint
122
+ # Defining the host is optional and defaults to https://api.agilicus.com
123
+ # See configuration.py for a list of all supported configuration parameters.
124
+ configuration = agilicus_api.Configuration(
125
+ host = "https://api.agilicus.com"
126
+ )
127
+
128
+ # The client must configure the authentication and authorization parameters
129
+ # in accordance with the API server security policy.
130
+ # Examples for each auth method are provided below, use the example that
131
+ # satisfies your auth use case.
132
+
133
+ # Configure Bearer authorization (JWT): token-valid
134
+ configuration = agilicus_api.Configuration(
135
+ access_token = 'YOUR_BEARER_TOKEN'
136
+ )
137
+
138
+ # Enter a context with an instance of the API client
139
+ with agilicus_api.ApiClient(configuration) as api_client:
140
+ # Create an instance of the API class
141
+ api_instance = policy_templates_api.PolicyTemplatesApi(api_client)
142
+ template_name = "sensitive" # str | filters based on the template name
143
+ org_id = "1234" # str | Organisation Unique identifier (optional)
144
+
145
+ # example passing only required values which don't have defaults set
146
+ try:
147
+ # Delete a PolicyTemplateInstance
148
+ api_instance.delete_policy_template_instance(template_name)
149
+ except agilicus_api.ApiException as e:
150
+ print("Exception when calling PolicyTemplatesApi->delete_policy_template_instance: %s\n" % e)
151
+
152
+ # example passing only required values which don't have defaults set
153
+ # and optional values
154
+ try:
155
+ # Delete a PolicyTemplateInstance
156
+ api_instance.delete_policy_template_instance(template_name, org_id=org_id)
157
+ except agilicus_api.ApiException as e:
158
+ print("Exception when calling PolicyTemplatesApi->delete_policy_template_instance: %s\n" % e)
159
+ ```
160
+
161
+
162
+ ### Parameters
163
+
164
+ Name | Type | Description | Notes
165
+ ------------- | ------------- | ------------- | -------------
166
+ **template_name** | **str**| filters based on the template name |
167
+ **org_id** | **str**| Organisation Unique identifier | [optional]
168
+
169
+ ### Return type
170
+
171
+ void (empty response body)
172
+
173
+ ### Authorization
174
+
175
+ [token-valid](../README.md#token-valid)
176
+
177
+ ### HTTP request headers
178
+
179
+ - **Content-Type**: Not defined
180
+ - **Accept**: application/json
181
+
182
+
183
+ ### HTTP response details
184
+ | Status code | Description | Response headers |
185
+ |-------------|-------------|------------------|
186
+ **204** | PolicyTemplateInstance was deleted | - |
187
+ **404** | PolicyTemplateInstance does not exist | - |
188
+
189
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
190
+
191
+ # **get_policy_template_instance**
192
+ > PolicyTemplateInstance get_policy_template_instance(template_name)
193
+
194
+ Get a PolicyTemplateInstance
195
+
196
+ Get a PolicyTemplateInstance
197
+
198
+ ### Example
199
+
200
+ * Bearer (JWT) Authentication (token-valid):
201
+ ```python
202
+ import time
203
+ import agilicus_api
204
+ from agilicus_api.api import policy_templates_api
205
+ from agilicus_api.model.error_message import ErrorMessage
206
+ from agilicus_api.model.policy_template_instance import PolicyTemplateInstance
207
+ from pprint import pprint
208
+ # Defining the host is optional and defaults to https://api.agilicus.com
209
+ # See configuration.py for a list of all supported configuration parameters.
210
+ configuration = agilicus_api.Configuration(
211
+ host = "https://api.agilicus.com"
212
+ )
213
+
214
+ # The client must configure the authentication and authorization parameters
215
+ # in accordance with the API server security policy.
216
+ # Examples for each auth method are provided below, use the example that
217
+ # satisfies your auth use case.
218
+
219
+ # Configure Bearer authorization (JWT): token-valid
220
+ configuration = agilicus_api.Configuration(
221
+ access_token = 'YOUR_BEARER_TOKEN'
222
+ )
223
+
224
+ # Enter a context with an instance of the API client
225
+ with agilicus_api.ApiClient(configuration) as api_client:
226
+ # Create an instance of the API class
227
+ api_instance = policy_templates_api.PolicyTemplatesApi(api_client)
228
+ template_name = "sensitive" # str | filters based on the template name
229
+ org_id = "1234" # str | Organisation Unique identifier (optional)
230
+
231
+ # example passing only required values which don't have defaults set
232
+ try:
233
+ # Get a PolicyTemplateInstance
234
+ api_response = api_instance.get_policy_template_instance(template_name)
235
+ pprint(api_response)
236
+ except agilicus_api.ApiException as e:
237
+ print("Exception when calling PolicyTemplatesApi->get_policy_template_instance: %s\n" % e)
238
+
239
+ # example passing only required values which don't have defaults set
240
+ # and optional values
241
+ try:
242
+ # Get a PolicyTemplateInstance
243
+ api_response = api_instance.get_policy_template_instance(template_name, org_id=org_id)
244
+ pprint(api_response)
245
+ except agilicus_api.ApiException as e:
246
+ print("Exception when calling PolicyTemplatesApi->get_policy_template_instance: %s\n" % e)
247
+ ```
248
+
249
+
250
+ ### Parameters
251
+
252
+ Name | Type | Description | Notes
253
+ ------------- | ------------- | ------------- | -------------
254
+ **template_name** | **str**| filters based on the template name |
255
+ **org_id** | **str**| Organisation Unique identifier | [optional]
256
+
257
+ ### Return type
258
+
259
+ [**PolicyTemplateInstance**](PolicyTemplateInstance.md)
260
+
261
+ ### Authorization
262
+
263
+ [token-valid](../README.md#token-valid)
264
+
265
+ ### HTTP request headers
266
+
267
+ - **Content-Type**: Not defined
268
+ - **Accept**: application/json
269
+
270
+
271
+ ### HTTP response details
272
+ | Status code | Description | Response headers |
273
+ |-------------|-------------|------------------|
274
+ **200** | Return a PolicyTemplateInstance | - |
275
+ **404** | PolicyTemplateInstance does not exist | - |
276
+
277
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
278
+
279
+ # **list_policy_template_instances**
280
+ > ListPolicyTemplateInstancesResponse list_policy_template_instances()
281
+
282
+ List all standalone policy_templates
283
+
284
+ List all PolicyTemplateInstances matching the provided query parameters.
285
+
286
+ ### Example
287
+
288
+ * Bearer (JWT) Authentication (token-valid):
289
+ ```python
290
+ import time
291
+ import agilicus_api
292
+ from agilicus_api.api import policy_templates_api
293
+ from agilicus_api.model.list_policy_template_instances_response import ListPolicyTemplateInstancesResponse
294
+ from pprint import pprint
295
+ # Defining the host is optional and defaults to https://api.agilicus.com
296
+ # See configuration.py for a list of all supported configuration parameters.
297
+ configuration = agilicus_api.Configuration(
298
+ host = "https://api.agilicus.com"
299
+ )
300
+
301
+ # The client must configure the authentication and authorization parameters
302
+ # in accordance with the API server security policy.
303
+ # Examples for each auth method are provided below, use the example that
304
+ # satisfies your auth use case.
305
+
306
+ # Configure Bearer authorization (JWT): token-valid
307
+ configuration = agilicus_api.Configuration(
308
+ access_token = 'YOUR_BEARER_TOKEN'
309
+ )
310
+
311
+ # Enter a context with an instance of the API client
312
+ with agilicus_api.ApiClient(configuration) as api_client:
313
+ # Create an instance of the API class
314
+ api_instance = policy_templates_api.PolicyTemplatesApi(api_client)
315
+ limit = 1 # int | limit the number of rows in the response (optional) if omitted the server will use the default value of 500
316
+ name = "name-1" # str | Filters based on whether or not the items in the collection have the given name. (optional)
317
+ template_type = "mfa" # str | filters based on the template type (optional)
318
+ org_id = "1234" # str | Organisation Unique identifier (optional)
319
+
320
+ # example passing only required values which don't have defaults set
321
+ # and optional values
322
+ try:
323
+ # List all standalone policy_templates
324
+ api_response = api_instance.list_policy_template_instances(limit=limit, name=name, template_type=template_type, org_id=org_id)
325
+ pprint(api_response)
326
+ except agilicus_api.ApiException as e:
327
+ print("Exception when calling PolicyTemplatesApi->list_policy_template_instances: %s\n" % e)
328
+ ```
329
+
330
+
331
+ ### Parameters
332
+
333
+ Name | Type | Description | Notes
334
+ ------------- | ------------- | ------------- | -------------
335
+ **limit** | **int**| limit the number of rows in the response | [optional] if omitted the server will use the default value of 500
336
+ **name** | **str**| Filters based on whether or not the items in the collection have the given name. | [optional]
337
+ **template_type** | **str**| filters based on the template type | [optional]
338
+ **org_id** | **str**| Organisation Unique identifier | [optional]
339
+
340
+ ### Return type
341
+
342
+ [**ListPolicyTemplateInstancesResponse**](ListPolicyTemplateInstancesResponse.md)
343
+
344
+ ### Authorization
345
+
346
+ [token-valid](../README.md#token-valid)
347
+
348
+ ### HTTP request headers
349
+
350
+ - **Content-Type**: Not defined
351
+ - **Accept**: application/json
352
+
353
+
354
+ ### HTTP response details
355
+ | Status code | Description | Response headers |
356
+ |-------------|-------------|------------------|
357
+ **200** | Query succeeded | - |
358
+
359
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
360
+
361
+ # **replace_policy_template_instance**
362
+ > PolicyTemplateInstance replace_policy_template_instance(template_name)
363
+
364
+ update a PolicyTemplateInstance
365
+
366
+ update a PolicyTemplateInstance
367
+
368
+ ### Example
369
+
370
+ * Bearer (JWT) Authentication (token-valid):
371
+ ```python
372
+ import time
373
+ import agilicus_api
374
+ from agilicus_api.api import policy_templates_api
375
+ from agilicus_api.model.error_message import ErrorMessage
376
+ from agilicus_api.model.policy_template_instance import PolicyTemplateInstance
377
+ from pprint import pprint
378
+ # Defining the host is optional and defaults to https://api.agilicus.com
379
+ # See configuration.py for a list of all supported configuration parameters.
380
+ configuration = agilicus_api.Configuration(
381
+ host = "https://api.agilicus.com"
382
+ )
383
+
384
+ # The client must configure the authentication and authorization parameters
385
+ # in accordance with the API server security policy.
386
+ # Examples for each auth method are provided below, use the example that
387
+ # satisfies your auth use case.
388
+
389
+ # Configure Bearer authorization (JWT): token-valid
390
+ configuration = agilicus_api.Configuration(
391
+ access_token = 'YOUR_BEARER_TOKEN'
392
+ )
393
+
394
+ # Enter a context with an instance of the API client
395
+ with agilicus_api.ApiClient(configuration) as api_client:
396
+ # Create an instance of the API class
397
+ api_instance = policy_templates_api.PolicyTemplatesApi(api_client)
398
+ template_name = "sensitive" # str | filters based on the template name
399
+ policy_template_instance = PolicyTemplateInstance(
400
+ metadata=MetadataWithId(),
401
+ spec=PolicyTemplateInstanceSpec(
402
+ org_id="123",
403
+ template=PolicyTemplate(
404
+ seconds_since_last_challenge=1,
405
+ labels=[
406
+ LabelName("site-A"),
407
+ ],
408
+ template_type="MFAPolicyTemplate",
409
+ ),
410
+ description="Restrict access to sensitive resources",
411
+ name="2",
412
+ ),
413
+ ) # PolicyTemplateInstance | (optional)
414
+
415
+ # example passing only required values which don't have defaults set
416
+ try:
417
+ # update a PolicyTemplateInstance
418
+ api_response = api_instance.replace_policy_template_instance(template_name)
419
+ pprint(api_response)
420
+ except agilicus_api.ApiException as e:
421
+ print("Exception when calling PolicyTemplatesApi->replace_policy_template_instance: %s\n" % e)
422
+
423
+ # example passing only required values which don't have defaults set
424
+ # and optional values
425
+ try:
426
+ # update a PolicyTemplateInstance
427
+ api_response = api_instance.replace_policy_template_instance(template_name, policy_template_instance=policy_template_instance)
428
+ pprint(api_response)
429
+ except agilicus_api.ApiException as e:
430
+ print("Exception when calling PolicyTemplatesApi->replace_policy_template_instance: %s\n" % e)
431
+ ```
432
+
433
+
434
+ ### Parameters
435
+
436
+ Name | Type | Description | Notes
437
+ ------------- | ------------- | ------------- | -------------
438
+ **template_name** | **str**| filters based on the template name |
439
+ **policy_template_instance** | [**PolicyTemplateInstance**](PolicyTemplateInstance.md)| | [optional]
440
+
441
+ ### Return type
442
+
443
+ [**PolicyTemplateInstance**](PolicyTemplateInstance.md)
444
+
445
+ ### Authorization
446
+
447
+ [token-valid](../README.md#token-valid)
448
+
449
+ ### HTTP request headers
450
+
451
+ - **Content-Type**: application/json
452
+ - **Accept**: application/json
453
+
454
+
455
+ ### HTTP response details
456
+ | Status code | Description | Response headers |
457
+ |-------------|-------------|------------------|
458
+ **200** | Return updated PolicyTemplateInstance | - |
459
+ **400** | The request is invalid | - |
460
+ **404** | PolicyTemplateInstance does not exist | - |
461
+
462
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
463
+
@@ -5,7 +5,7 @@ Resource URL by which a resource can be accessed from.
5
5
  ## Properties
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
- **url** | **str** | resource URL | [optional]
8
+ **url** | **str** | resource URL | [optional]
9
9
  **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10
10
 
11
11
  [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)