agilicus 1.256.7__py3-none-any.whl → 1.256.9__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- agilicus/.openapi-generator/FILES +9 -0
- agilicus/agilicus_api/__init__.py +3 -0
- agilicus/agilicus_api/api/billing_api.py +146 -0
- agilicus/agilicus_api/api/billing_api_mock.py +7 -0
- agilicus/agilicus_api/api/organisations_api.py +130 -0
- agilicus/agilicus_api/api/organisations_api_mock.py +7 -0
- agilicus/agilicus_api/api_client.py +1 -1
- agilicus/agilicus_api/configuration.py +1 -1
- agilicus/agilicus_api/docs/BillingApi.md +92 -0
- agilicus/agilicus_api/docs/BillingCheckoutSession.md +14 -0
- agilicus/agilicus_api/docs/CreateBillingCheckoutSession.md +16 -0
- agilicus/agilicus_api/docs/ListBillingCheckoutSessions.md +14 -0
- agilicus/agilicus_api/docs/OrganisationsApi.md +94 -0
- agilicus/agilicus_api/model/billing_checkout_session.py +284 -0
- agilicus/agilicus_api/model/create_billing_checkout_session.py +305 -0
- agilicus/agilicus_api/model/list_billing_checkout_sessions.py +287 -0
- agilicus/agilicus_api/models/__init__.py +3 -0
- agilicus/agilicus_api/test/test_billing_api.py +7 -0
- agilicus/agilicus_api/test/test_billing_checkout_session.py +36 -0
- agilicus/agilicus_api/test/test_create_billing_checkout_session.py +36 -0
- agilicus/agilicus_api/test/test_list_billing_checkout_sessions.py +38 -0
- agilicus/agilicus_api/test/test_organisations_api.py +7 -0
- agilicus/agilicus_api_README.md +6 -1
- agilicus/billing.py +28 -0
- agilicus/main.py +41 -1
- agilicus/orgs.py +21 -0
- {agilicus-1.256.7.dist-info → agilicus-1.256.9.dist-info}/METADATA +1 -1
- {agilicus-1.256.7.dist-info → agilicus-1.256.9.dist-info}/RECORD +31 -22
- {agilicus-1.256.7.dist-info → agilicus-1.256.9.dist-info}/LICENSE.txt +0 -0
- {agilicus-1.256.7.dist-info → agilicus-1.256.9.dist-info}/WHEEL +0 -0
- {agilicus-1.256.7.dist-info → agilicus-1.256.9.dist-info}/entry_points.txt +0 -0
@@ -6,6 +6,7 @@ Method | HTTP request | Description
|
|
6
6
|
------------- | ------------- | -------------
|
7
7
|
[**create_billing_portal_link**](OrganisationsApi.md#create_billing_portal_link) | **POST** /v1/orgs/{org_id}/billing_portal_links | Create a link to the billing portal
|
8
8
|
[**create_blocking_upgrade_orgs_task**](OrganisationsApi.md#create_blocking_upgrade_orgs_task) | **POST** /v1/orgs/upgrade | utility to upgrade organisations
|
9
|
+
[**create_checkout_session**](OrganisationsApi.md#create_checkout_session) | **POST** /v1/orgs/{org_id}/billing_checkout | Create a session checkout
|
9
10
|
[**create_org**](OrganisationsApi.md#create_org) | **POST** /v1/orgs | Create an organisation
|
10
11
|
[**create_reconcile_org_default_policy**](OrganisationsApi.md#create_reconcile_org_default_policy) | **POST** /v1/orgs/reconcile_org_default_policy | Reconciles one or more org's default policies
|
11
12
|
[**create_sub_org**](OrganisationsApi.md#create_sub_org) | **POST** /v1/orgs/{org_id}/orgs | Create a sub organisation
|
@@ -177,6 +178,99 @@ void (empty response body)
|
|
177
178
|
|
178
179
|
[[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)
|
179
180
|
|
181
|
+
# **create_checkout_session**
|
182
|
+
> BillingCheckoutSession create_checkout_session(org_id)
|
183
|
+
|
184
|
+
Create a session checkout
|
185
|
+
|
186
|
+
Create a session checkout
|
187
|
+
|
188
|
+
### Example
|
189
|
+
|
190
|
+
* Bearer (JWT) Authentication (token-valid):
|
191
|
+
```python
|
192
|
+
import time
|
193
|
+
import agilicus_api
|
194
|
+
from agilicus_api.api import organisations_api
|
195
|
+
from agilicus_api.model.create_billing_checkout_session import CreateBillingCheckoutSession
|
196
|
+
from agilicus_api.model.billing_checkout_session import BillingCheckoutSession
|
197
|
+
from pprint import pprint
|
198
|
+
# Defining the host is optional and defaults to https://api.agilicus.com
|
199
|
+
# See configuration.py for a list of all supported configuration parameters.
|
200
|
+
configuration = agilicus_api.Configuration(
|
201
|
+
host = "https://api.agilicus.com"
|
202
|
+
)
|
203
|
+
|
204
|
+
# The client must configure the authentication and authorization parameters
|
205
|
+
# in accordance with the API server security policy.
|
206
|
+
# Examples for each auth method are provided below, use the example that
|
207
|
+
# satisfies your auth use case.
|
208
|
+
|
209
|
+
# Configure Bearer authorization (JWT): token-valid
|
210
|
+
configuration = agilicus_api.Configuration(
|
211
|
+
access_token = 'YOUR_BEARER_TOKEN'
|
212
|
+
)
|
213
|
+
|
214
|
+
# Enter a context with an instance of the API client
|
215
|
+
with agilicus_api.ApiClient(configuration) as api_client:
|
216
|
+
# Create an instance of the API class
|
217
|
+
api_instance = organisations_api.OrganisationsApi(api_client)
|
218
|
+
org_id = "1234" # str | Organisation Unique identifier
|
219
|
+
create_billing_checkout_session = CreateBillingCheckoutSession(
|
220
|
+
ui_mode="ui_mode_example",
|
221
|
+
return_url="return_url_example",
|
222
|
+
success_url="success_url_example",
|
223
|
+
custom_text="custom_text_example",
|
224
|
+
) # CreateBillingCheckoutSession | (optional)
|
225
|
+
|
226
|
+
# example passing only required values which don't have defaults set
|
227
|
+
try:
|
228
|
+
# Create a session checkout
|
229
|
+
api_response = api_instance.create_checkout_session(org_id)
|
230
|
+
pprint(api_response)
|
231
|
+
except agilicus_api.ApiException as e:
|
232
|
+
print("Exception when calling OrganisationsApi->create_checkout_session: %s\n" % e)
|
233
|
+
|
234
|
+
# example passing only required values which don't have defaults set
|
235
|
+
# and optional values
|
236
|
+
try:
|
237
|
+
# Create a session checkout
|
238
|
+
api_response = api_instance.create_checkout_session(org_id, create_billing_checkout_session=create_billing_checkout_session)
|
239
|
+
pprint(api_response)
|
240
|
+
except agilicus_api.ApiException as e:
|
241
|
+
print("Exception when calling OrganisationsApi->create_checkout_session: %s\n" % e)
|
242
|
+
```
|
243
|
+
|
244
|
+
|
245
|
+
### Parameters
|
246
|
+
|
247
|
+
Name | Type | Description | Notes
|
248
|
+
------------- | ------------- | ------------- | -------------
|
249
|
+
**org_id** | **str**| Organisation Unique identifier |
|
250
|
+
**create_billing_checkout_session** | [**CreateBillingCheckoutSession**](CreateBillingCheckoutSession.md)| | [optional]
|
251
|
+
|
252
|
+
### Return type
|
253
|
+
|
254
|
+
[**BillingCheckoutSession**](BillingCheckoutSession.md)
|
255
|
+
|
256
|
+
### Authorization
|
257
|
+
|
258
|
+
[token-valid](../README.md#token-valid)
|
259
|
+
|
260
|
+
### HTTP request headers
|
261
|
+
|
262
|
+
- **Content-Type**: application/json
|
263
|
+
- **Accept**: application/json
|
264
|
+
|
265
|
+
|
266
|
+
### HTTP response details
|
267
|
+
| Status code | Description | Response headers |
|
268
|
+
|-------------|-------------|------------------|
|
269
|
+
**200** | Created session checkout | - |
|
270
|
+
**404** | billing_account_id not found | - |
|
271
|
+
|
272
|
+
[[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)
|
273
|
+
|
180
274
|
# **create_org**
|
181
275
|
> Organisation create_org(organisation_admin)
|
182
276
|
|
@@ -0,0 +1,284 @@
|
|
1
|
+
"""
|
2
|
+
Agilicus API
|
3
|
+
|
4
|
+
Agilicus is API-first. Modern software is controlled by other software, is open, is available for you to use the way you want, securely, simply. The OpenAPI Specification in YAML format is available on [www](https://www.agilicus.com/www/api/agilicus-openapi.yaml) for importing to other tools. A rendered, online viewable and usable version of this specification is available at [api](https://www.agilicus.com/api). You may try the API inline directly in the web page. To do so, first obtain an Authentication Token (the simplest way is to install the Python SDK, and then run `agilicus-cli --issuer https://MYISSUER get-token`). You will need an org-id for most calls (and can obtain from `agilicus-cli --issuer https://MYISSUER list-orgs`). The `MYISSUER` will typically be `auth.MYDOMAIN`, and you will see it as you sign-in to the administrative UI. This API releases on Bearer-Token authentication. To obtain a valid bearer token you will need to Authenticate to an Issuer with OpenID Connect (a superset of OAUTH2). Your \"issuer\" will look like https://auth.MYDOMAIN. For example, when you signed-up, if you said \"use my own domain name\" and assigned a CNAME of cloud.example.com, then your issuer would be https://auth.cloud.example.com. If you selected \"use an Agilicus supplied domain name\", your issuer would look like https://auth.myorg.agilicus.cloud. For test purposes you can use our [Python SDK](https://pypi.org/project/agilicus/) and run `agilicus-cli --issuer https://auth.MYDOMAIN get-token`. This API may be used in any language runtime that supports OpenAPI 3.0, or, you may use our [Python SDK](https://pypi.org/project/agilicus/), our [Typescript SDK](https://www.npmjs.com/package/@agilicus/angular), or our [Golang SDK](https://git.agilicus.com/pub/sdk-go). 100% of the activities in our system our API-driven, from our web-admin, through our progressive web applications, to all internals: there is nothing that is not accessible. For more information, see [developer resources](https://www.agilicus.com/developer). # noqa: E501
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2024.05.09
|
7
|
+
Contact: dev@agilicus.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
"""
|
10
|
+
|
11
|
+
|
12
|
+
import re # noqa: F401
|
13
|
+
import sys # noqa: F401
|
14
|
+
|
15
|
+
from agilicus_api.model_utils import ( # noqa: F401
|
16
|
+
ApiTypeError,
|
17
|
+
ModelComposed,
|
18
|
+
ModelNormal,
|
19
|
+
ModelSimple,
|
20
|
+
cached_property,
|
21
|
+
change_keys_js_to_python,
|
22
|
+
convert_js_args_to_python_args,
|
23
|
+
date,
|
24
|
+
datetime,
|
25
|
+
file_type,
|
26
|
+
none_type,
|
27
|
+
validate_get_composed_info,
|
28
|
+
)
|
29
|
+
from ..model_utils import OpenApiModel
|
30
|
+
from agilicus_api.exceptions import ApiAttributeError
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
class BillingCheckoutSession(ModelNormal):
|
35
|
+
"""NOTE: This class is auto generated by OpenAPI Generator.
|
36
|
+
Ref: https://openapi-generator.tech
|
37
|
+
|
38
|
+
Do not edit the class manually.
|
39
|
+
|
40
|
+
Attributes:
|
41
|
+
allowed_values (dict): The key is the tuple path to the attribute
|
42
|
+
and the for var_name this is (var_name,). The value is a dict
|
43
|
+
with a capitalized key describing the allowed value and an allowed
|
44
|
+
value. These dicts store the allowed enum values.
|
45
|
+
attribute_map (dict): The key is attribute name
|
46
|
+
and the value is json key in definition.
|
47
|
+
discriminator_value_class_map (dict): A dict to go from the discriminator
|
48
|
+
variable value to the discriminator class name.
|
49
|
+
validations (dict): The key is the tuple path to the attribute
|
50
|
+
and the for var_name this is (var_name,). The value is a dict
|
51
|
+
that stores validations for max_length, min_length, max_items,
|
52
|
+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
|
53
|
+
inclusive_minimum, and regex.
|
54
|
+
additional_properties_type (tuple): A tuple of classes accepted
|
55
|
+
as additional properties values.
|
56
|
+
"""
|
57
|
+
|
58
|
+
allowed_values = {
|
59
|
+
}
|
60
|
+
|
61
|
+
validations = {
|
62
|
+
('id',): {
|
63
|
+
'max_length': 5000,
|
64
|
+
},
|
65
|
+
}
|
66
|
+
|
67
|
+
@property
|
68
|
+
def id(self):
|
69
|
+
return self.get("id")
|
70
|
+
|
71
|
+
@id.setter
|
72
|
+
def id(self, new_value):
|
73
|
+
self.id = new_value
|
74
|
+
|
75
|
+
@property
|
76
|
+
def url(self):
|
77
|
+
return self.get("url")
|
78
|
+
|
79
|
+
@url.setter
|
80
|
+
def url(self, new_value):
|
81
|
+
self.url = new_value
|
82
|
+
|
83
|
+
@cached_property
|
84
|
+
def additional_properties_type():
|
85
|
+
"""
|
86
|
+
This must be a method because a model may have properties that are
|
87
|
+
of type self, this must run after the class is loaded
|
88
|
+
"""
|
89
|
+
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
|
90
|
+
|
91
|
+
_nullable = False
|
92
|
+
|
93
|
+
@cached_property
|
94
|
+
def openapi_types():
|
95
|
+
"""
|
96
|
+
This must be a method because a model may have properties that are
|
97
|
+
of type self, this must run after the class is loaded
|
98
|
+
|
99
|
+
Returns
|
100
|
+
openapi_types (dict): The key is attribute name
|
101
|
+
and the value is attribute type.
|
102
|
+
"""
|
103
|
+
return {
|
104
|
+
'id': (str,), # noqa: E501
|
105
|
+
'url': (str,), # noqa: E501
|
106
|
+
}
|
107
|
+
|
108
|
+
@cached_property
|
109
|
+
def discriminator():
|
110
|
+
return None
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
attribute_map = {
|
115
|
+
'id': 'id', # noqa: E501
|
116
|
+
'url': 'url', # noqa: E501
|
117
|
+
}
|
118
|
+
|
119
|
+
read_only_vars = {
|
120
|
+
}
|
121
|
+
|
122
|
+
_composed_schemas = {}
|
123
|
+
|
124
|
+
@classmethod
|
125
|
+
@convert_js_args_to_python_args
|
126
|
+
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
|
127
|
+
"""BillingCheckoutSession - a model defined in OpenAPI
|
128
|
+
|
129
|
+
Keyword Args:
|
130
|
+
_check_type (bool): if True, values for parameters in openapi_types
|
131
|
+
will be type checked and a TypeError will be
|
132
|
+
raised if the wrong type is input.
|
133
|
+
Defaults to True
|
134
|
+
_path_to_item (tuple/list): This is a list of keys or values to
|
135
|
+
drill down to the model in received_data
|
136
|
+
when deserializing a response
|
137
|
+
_spec_property_naming (bool): True if the variable names in the input data
|
138
|
+
are serialized names, as specified in the OpenAPI document.
|
139
|
+
False if the variable names in the input data
|
140
|
+
are pythonic names, e.g. snake case (default)
|
141
|
+
_configuration (Configuration): the instance to use when
|
142
|
+
deserializing a file_type parameter.
|
143
|
+
If passed, type conversion is attempted
|
144
|
+
If omitted no type conversion is done.
|
145
|
+
_visited_composed_classes (tuple): This stores a tuple of
|
146
|
+
classes that we have traveled through so that
|
147
|
+
if we see that class again we will not use its
|
148
|
+
discriminator again.
|
149
|
+
When traveling through a discriminator, the
|
150
|
+
composed schema that is
|
151
|
+
is traveled through is added to this set.
|
152
|
+
For example if Animal has a discriminator
|
153
|
+
petType and we pass in "Dog", and the class Dog
|
154
|
+
allOf includes Animal, we move through Animal
|
155
|
+
once using the discriminator, and pick Dog.
|
156
|
+
Then in Dog, we will make an instance of the
|
157
|
+
Animal class but this time we won't travel
|
158
|
+
through its discriminator because we passed in
|
159
|
+
_visited_composed_classes = (Animal,)
|
160
|
+
id (str): Unique identifier for the object.. [optional] # noqa: E501
|
161
|
+
url (str): The URL to the Checkout Session. [optional] # noqa: E501
|
162
|
+
"""
|
163
|
+
|
164
|
+
_check_type = kwargs.pop('_check_type', True)
|
165
|
+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
166
|
+
_path_to_item = kwargs.pop('_path_to_item', ())
|
167
|
+
_configuration = kwargs.pop('_configuration', None)
|
168
|
+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
169
|
+
|
170
|
+
self = super(OpenApiModel, cls).__new__(cls)
|
171
|
+
|
172
|
+
if args:
|
173
|
+
raise ApiTypeError(
|
174
|
+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
175
|
+
args,
|
176
|
+
self.__class__.__name__,
|
177
|
+
),
|
178
|
+
path_to_item=_path_to_item,
|
179
|
+
valid_classes=(self.__class__,),
|
180
|
+
)
|
181
|
+
|
182
|
+
self._data_store = {}
|
183
|
+
self._check_type = _check_type
|
184
|
+
self._spec_property_naming = _spec_property_naming
|
185
|
+
self._path_to_item = _path_to_item
|
186
|
+
self._configuration = _configuration
|
187
|
+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
188
|
+
|
189
|
+
for var_name, var_value in kwargs.items():
|
190
|
+
if var_name not in self.attribute_map and \
|
191
|
+
self._configuration is not None and \
|
192
|
+
self._configuration.discard_unknown_keys and \
|
193
|
+
self.additional_properties_type is None:
|
194
|
+
# discard variable.
|
195
|
+
continue
|
196
|
+
setattr(self, var_name, var_value)
|
197
|
+
return self
|
198
|
+
|
199
|
+
def __python_set(val):
|
200
|
+
return set(val)
|
201
|
+
|
202
|
+
required_properties = __python_set([
|
203
|
+
'_data_store',
|
204
|
+
'_check_type',
|
205
|
+
'_spec_property_naming',
|
206
|
+
'_path_to_item',
|
207
|
+
'_configuration',
|
208
|
+
'_visited_composed_classes',
|
209
|
+
])
|
210
|
+
|
211
|
+
@convert_js_args_to_python_args
|
212
|
+
def __init__(self, *args, **kwargs): # noqa: E501
|
213
|
+
"""BillingCheckoutSession - a model defined in OpenAPI
|
214
|
+
|
215
|
+
Keyword Args:
|
216
|
+
_check_type (bool): if True, values for parameters in openapi_types
|
217
|
+
will be type checked and a TypeError will be
|
218
|
+
raised if the wrong type is input.
|
219
|
+
Defaults to True
|
220
|
+
_path_to_item (tuple/list): This is a list of keys or values to
|
221
|
+
drill down to the model in received_data
|
222
|
+
when deserializing a response
|
223
|
+
_spec_property_naming (bool): True if the variable names in the input data
|
224
|
+
are serialized names, as specified in the OpenAPI document.
|
225
|
+
False if the variable names in the input data
|
226
|
+
are pythonic names, e.g. snake case (default)
|
227
|
+
_configuration (Configuration): the instance to use when
|
228
|
+
deserializing a file_type parameter.
|
229
|
+
If passed, type conversion is attempted
|
230
|
+
If omitted no type conversion is done.
|
231
|
+
_visited_composed_classes (tuple): This stores a tuple of
|
232
|
+
classes that we have traveled through so that
|
233
|
+
if we see that class again we will not use its
|
234
|
+
discriminator again.
|
235
|
+
When traveling through a discriminator, the
|
236
|
+
composed schema that is
|
237
|
+
is traveled through is added to this set.
|
238
|
+
For example if Animal has a discriminator
|
239
|
+
petType and we pass in "Dog", and the class Dog
|
240
|
+
allOf includes Animal, we move through Animal
|
241
|
+
once using the discriminator, and pick Dog.
|
242
|
+
Then in Dog, we will make an instance of the
|
243
|
+
Animal class but this time we won't travel
|
244
|
+
through its discriminator because we passed in
|
245
|
+
_visited_composed_classes = (Animal,)
|
246
|
+
id (str): Unique identifier for the object.. [optional] # noqa: E501
|
247
|
+
url (str): The URL to the Checkout Session. [optional] # noqa: E501
|
248
|
+
"""
|
249
|
+
|
250
|
+
_check_type = kwargs.pop('_check_type', True)
|
251
|
+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
|
252
|
+
_path_to_item = kwargs.pop('_path_to_item', ())
|
253
|
+
_configuration = kwargs.pop('_configuration', None)
|
254
|
+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
|
255
|
+
|
256
|
+
if args:
|
257
|
+
raise ApiTypeError(
|
258
|
+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
|
259
|
+
args,
|
260
|
+
self.__class__.__name__,
|
261
|
+
),
|
262
|
+
path_to_item=_path_to_item,
|
263
|
+
valid_classes=(self.__class__,),
|
264
|
+
)
|
265
|
+
|
266
|
+
self._data_store = {}
|
267
|
+
self._check_type = _check_type
|
268
|
+
self._spec_property_naming = _spec_property_naming
|
269
|
+
self._path_to_item = _path_to_item
|
270
|
+
self._configuration = _configuration
|
271
|
+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
|
272
|
+
|
273
|
+
for var_name, var_value in kwargs.items():
|
274
|
+
if var_name not in self.attribute_map and \
|
275
|
+
self._configuration is not None and \
|
276
|
+
self._configuration.discard_unknown_keys and \
|
277
|
+
self.additional_properties_type is None:
|
278
|
+
# discard variable.
|
279
|
+
continue
|
280
|
+
setattr(self, var_name, var_value)
|
281
|
+
if var_name in self.read_only_vars:
|
282
|
+
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
|
283
|
+
f"class with read only attributes.")
|
284
|
+
|