ultracart-rest-sdk 4.1.15__py3-none-any.whl → 4.1.17__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.
@@ -0,0 +1,298 @@
1
+ """
2
+ UltraCart Rest API V2
3
+
4
+ UltraCart REST API Version 2 # noqa: E501
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ """
10
+
11
+
12
+ import re # noqa: F401
13
+ import sys # noqa: F401
14
+
15
+ from ultracart.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
+ OpenApiModel
29
+ )
30
+ from ultracart.exceptions import ApiAttributeError
31
+
32
+
33
+ def lazy_import():
34
+ from ultracart.model.custom_report_execution_parameter import CustomReportExecutionParameter
35
+ from ultracart.model.custom_reports_execution_report_data import CustomReportsExecutionReportData
36
+ from ultracart.model.error import Error
37
+ from ultracart.model.response_metadata import ResponseMetadata
38
+ from ultracart.model.warning import Warning
39
+ globals()['CustomReportExecutionParameter'] = CustomReportExecutionParameter
40
+ globals()['CustomReportsExecutionReportData'] = CustomReportsExecutionReportData
41
+ globals()['Error'] = Error
42
+ globals()['ResponseMetadata'] = ResponseMetadata
43
+ globals()['Warning'] = Warning
44
+
45
+
46
+ class CustomReportsExecutionResponse(ModelNormal):
47
+ """NOTE: This class is auto generated by OpenAPI Generator.
48
+ Ref: https://openapi-generator.tech
49
+
50
+ Do not edit the class manually.
51
+
52
+ Attributes:
53
+ allowed_values (dict): The key is the tuple path to the attribute
54
+ and the for var_name this is (var_name,). The value is a dict
55
+ with a capitalized key describing the allowed value and an allowed
56
+ value. These dicts store the allowed enum values.
57
+ attribute_map (dict): The key is attribute name
58
+ and the value is json key in definition.
59
+ discriminator_value_class_map (dict): A dict to go from the discriminator
60
+ variable value to the discriminator class name.
61
+ validations (dict): The key is the tuple path to the attribute
62
+ and the for var_name this is (var_name,). The value is a dict
63
+ that stores validations for max_length, min_length, max_items,
64
+ min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
65
+ inclusive_minimum, and regex.
66
+ additional_properties_type (tuple): A tuple of classes accepted
67
+ as additional properties values.
68
+ """
69
+
70
+ allowed_values = {
71
+ }
72
+
73
+ validations = {
74
+ }
75
+
76
+ @cached_property
77
+ def additional_properties_type():
78
+ """
79
+ This must be a method because a model may have properties that are
80
+ of type self, this must run after the class is loaded
81
+ """
82
+ lazy_import()
83
+ return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
84
+
85
+ _nullable = False
86
+
87
+ @cached_property
88
+ def openapi_types():
89
+ """
90
+ This must be a method because a model may have properties that are
91
+ of type self, this must run after the class is loaded
92
+
93
+ Returns
94
+ openapi_types (dict): The key is attribute name
95
+ and the value is attribute type.
96
+ """
97
+ lazy_import()
98
+ return {
99
+ 'error': (Error,), # noqa: E501
100
+ 'metadata': (ResponseMetadata,), # noqa: E501
101
+ 'parameters': ([CustomReportExecutionParameter],), # noqa: E501
102
+ 'reports': ([CustomReportsExecutionReportData],), # noqa: E501
103
+ 'success': (bool,), # noqa: E501
104
+ 'warning': (Warning,), # noqa: E501
105
+ }
106
+
107
+ @cached_property
108
+ def discriminator():
109
+ return None
110
+
111
+
112
+ attribute_map = {
113
+ 'error': 'error', # noqa: E501
114
+ 'metadata': 'metadata', # noqa: E501
115
+ 'parameters': 'parameters', # noqa: E501
116
+ 'reports': 'reports', # noqa: E501
117
+ 'success': 'success', # noqa: E501
118
+ 'warning': 'warning', # noqa: E501
119
+ }
120
+
121
+ read_only_vars = {
122
+ }
123
+
124
+ _composed_schemas = {}
125
+
126
+ @classmethod
127
+ @convert_js_args_to_python_args
128
+ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
129
+ """CustomReportsExecutionResponse - a model defined in OpenAPI
130
+
131
+ Keyword Args:
132
+ _check_type (bool): if True, values for parameters in openapi_types
133
+ will be type checked and a TypeError will be
134
+ raised if the wrong type is input.
135
+ Defaults to True
136
+ _path_to_item (tuple/list): This is a list of keys or values to
137
+ drill down to the model in received_data
138
+ when deserializing a response
139
+ _spec_property_naming (bool): True if the variable names in the input data
140
+ are serialized names, as specified in the OpenAPI document.
141
+ False if the variable names in the input data
142
+ are pythonic names, e.g. snake case (default)
143
+ _configuration (Configuration): the instance to use when
144
+ deserializing a file_type parameter.
145
+ If passed, type conversion is attempted
146
+ If omitted no type conversion is done.
147
+ _visited_composed_classes (tuple): This stores a tuple of
148
+ classes that we have traveled through so that
149
+ if we see that class again we will not use its
150
+ discriminator again.
151
+ When traveling through a discriminator, the
152
+ composed schema that is
153
+ is traveled through is added to this set.
154
+ For example if Animal has a discriminator
155
+ petType and we pass in "Dog", and the class Dog
156
+ allOf includes Animal, we move through Animal
157
+ once using the discriminator, and pick Dog.
158
+ Then in Dog, we will make an instance of the
159
+ Animal class but this time we won't travel
160
+ through its discriminator because we passed in
161
+ _visited_composed_classes = (Animal,)
162
+ error (Error): [optional] # noqa: E501
163
+ metadata (ResponseMetadata): [optional] # noqa: E501
164
+ parameters ([CustomReportExecutionParameter]): [optional] # noqa: E501
165
+ reports ([CustomReportsExecutionReportData]): [optional] # noqa: E501
166
+ success (bool): Indicates if API call was successful. [optional] # noqa: E501
167
+ warning (Warning): [optional] # noqa: E501
168
+ """
169
+
170
+ _check_type = kwargs.pop('_check_type', True)
171
+ _spec_property_naming = kwargs.pop('_spec_property_naming', True)
172
+ _path_to_item = kwargs.pop('_path_to_item', ())
173
+ _configuration = kwargs.pop('_configuration', None)
174
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
175
+
176
+ self = super(OpenApiModel, cls).__new__(cls)
177
+
178
+ if args:
179
+ for arg in args:
180
+ if isinstance(arg, dict):
181
+ kwargs.update(arg)
182
+ else:
183
+ raise ApiTypeError(
184
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
185
+ args,
186
+ self.__class__.__name__,
187
+ ),
188
+ path_to_item=_path_to_item,
189
+ valid_classes=(self.__class__,),
190
+ )
191
+
192
+ self._data_store = {}
193
+ self._check_type = _check_type
194
+ self._spec_property_naming = _spec_property_naming
195
+ self._path_to_item = _path_to_item
196
+ self._configuration = _configuration
197
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
198
+
199
+ for var_name, var_value in kwargs.items():
200
+ if var_name not in self.attribute_map and \
201
+ self._configuration is not None and \
202
+ self._configuration.discard_unknown_keys and \
203
+ self.additional_properties_type is None:
204
+ # discard variable.
205
+ continue
206
+ setattr(self, var_name, var_value)
207
+ return self
208
+
209
+ required_properties = set([
210
+ '_data_store',
211
+ '_check_type',
212
+ '_spec_property_naming',
213
+ '_path_to_item',
214
+ '_configuration',
215
+ '_visited_composed_classes',
216
+ ])
217
+
218
+ @convert_js_args_to_python_args
219
+ def __init__(self, *args, **kwargs): # noqa: E501
220
+ """CustomReportsExecutionResponse - a model defined in OpenAPI
221
+
222
+ Keyword Args:
223
+ _check_type (bool): if True, values for parameters in openapi_types
224
+ will be type checked and a TypeError will be
225
+ raised if the wrong type is input.
226
+ Defaults to True
227
+ _path_to_item (tuple/list): This is a list of keys or values to
228
+ drill down to the model in received_data
229
+ when deserializing a response
230
+ _spec_property_naming (bool): True if the variable names in the input data
231
+ are serialized names, as specified in the OpenAPI document.
232
+ False if the variable names in the input data
233
+ are pythonic names, e.g. snake case (default)
234
+ _configuration (Configuration): the instance to use when
235
+ deserializing a file_type parameter.
236
+ If passed, type conversion is attempted
237
+ If omitted no type conversion is done.
238
+ _visited_composed_classes (tuple): This stores a tuple of
239
+ classes that we have traveled through so that
240
+ if we see that class again we will not use its
241
+ discriminator again.
242
+ When traveling through a discriminator, the
243
+ composed schema that is
244
+ is traveled through is added to this set.
245
+ For example if Animal has a discriminator
246
+ petType and we pass in "Dog", and the class Dog
247
+ allOf includes Animal, we move through Animal
248
+ once using the discriminator, and pick Dog.
249
+ Then in Dog, we will make an instance of the
250
+ Animal class but this time we won't travel
251
+ through its discriminator because we passed in
252
+ _visited_composed_classes = (Animal,)
253
+ error (Error): [optional] # noqa: E501
254
+ metadata (ResponseMetadata): [optional] # noqa: E501
255
+ parameters ([CustomReportExecutionParameter]): [optional] # noqa: E501
256
+ reports ([CustomReportsExecutionReportData]): [optional] # noqa: E501
257
+ success (bool): Indicates if API call was successful. [optional] # noqa: E501
258
+ warning (Warning): [optional] # noqa: E501
259
+ """
260
+
261
+ _check_type = kwargs.pop('_check_type', True)
262
+ _spec_property_naming = kwargs.pop('_spec_property_naming', False)
263
+ _path_to_item = kwargs.pop('_path_to_item', ())
264
+ _configuration = kwargs.pop('_configuration', None)
265
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
266
+
267
+ if args:
268
+ for arg in args:
269
+ if isinstance(arg, dict):
270
+ kwargs.update(arg)
271
+ else:
272
+ raise ApiTypeError(
273
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
274
+ args,
275
+ self.__class__.__name__,
276
+ ),
277
+ path_to_item=_path_to_item,
278
+ valid_classes=(self.__class__,),
279
+ )
280
+
281
+ self._data_store = {}
282
+ self._check_type = _check_type
283
+ self._spec_property_naming = _spec_property_naming
284
+ self._path_to_item = _path_to_item
285
+ self._configuration = _configuration
286
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
287
+
288
+ for var_name, var_value in kwargs.items():
289
+ if var_name not in self.attribute_map and \
290
+ self._configuration is not None and \
291
+ self._configuration.discard_unknown_keys and \
292
+ self.additional_properties_type is None:
293
+ # discard variable.
294
+ continue
295
+ setattr(self, var_name, var_value)
296
+ if var_name in self.read_only_vars:
297
+ raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
298
+ f"class with read only attributes.")
@@ -0,0 +1,292 @@
1
+ """
2
+ UltraCart Rest API V2
3
+
4
+ UltraCart REST API Version 2 # noqa: E501
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ """
10
+
11
+
12
+ import re # noqa: F401
13
+ import sys # noqa: F401
14
+
15
+ from ultracart.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
+ OpenApiModel
29
+ )
30
+ from ultracart.exceptions import ApiAttributeError
31
+
32
+
33
+ def lazy_import():
34
+ from ultracart.model.custom_report import CustomReport
35
+ from ultracart.model.error import Error
36
+ from ultracart.model.response_metadata import ResponseMetadata
37
+ from ultracart.model.warning import Warning
38
+ globals()['CustomReport'] = CustomReport
39
+ globals()['Error'] = Error
40
+ globals()['ResponseMetadata'] = ResponseMetadata
41
+ globals()['Warning'] = Warning
42
+
43
+
44
+ class CustomReportsResponse(ModelNormal):
45
+ """NOTE: This class is auto generated by OpenAPI Generator.
46
+ Ref: https://openapi-generator.tech
47
+
48
+ Do not edit the class manually.
49
+
50
+ Attributes:
51
+ allowed_values (dict): The key is the tuple path to the attribute
52
+ and the for var_name this is (var_name,). The value is a dict
53
+ with a capitalized key describing the allowed value and an allowed
54
+ value. These dicts store the allowed enum values.
55
+ attribute_map (dict): The key is attribute name
56
+ and the value is json key in definition.
57
+ discriminator_value_class_map (dict): A dict to go from the discriminator
58
+ variable value to the discriminator class name.
59
+ validations (dict): The key is the tuple path to the attribute
60
+ and the for var_name this is (var_name,). The value is a dict
61
+ that stores validations for max_length, min_length, max_items,
62
+ min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
63
+ inclusive_minimum, and regex.
64
+ additional_properties_type (tuple): A tuple of classes accepted
65
+ as additional properties values.
66
+ """
67
+
68
+ allowed_values = {
69
+ }
70
+
71
+ validations = {
72
+ }
73
+
74
+ @cached_property
75
+ def additional_properties_type():
76
+ """
77
+ This must be a method because a model may have properties that are
78
+ of type self, this must run after the class is loaded
79
+ """
80
+ lazy_import()
81
+ return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
82
+
83
+ _nullable = False
84
+
85
+ @cached_property
86
+ def openapi_types():
87
+ """
88
+ This must be a method because a model may have properties that are
89
+ of type self, this must run after the class is loaded
90
+
91
+ Returns
92
+ openapi_types (dict): The key is attribute name
93
+ and the value is attribute type.
94
+ """
95
+ lazy_import()
96
+ return {
97
+ 'error': (Error,), # noqa: E501
98
+ 'metadata': (ResponseMetadata,), # noqa: E501
99
+ 'reports': ([CustomReport],), # noqa: E501
100
+ 'success': (bool,), # noqa: E501
101
+ 'warning': (Warning,), # noqa: E501
102
+ }
103
+
104
+ @cached_property
105
+ def discriminator():
106
+ return None
107
+
108
+
109
+ attribute_map = {
110
+ 'error': 'error', # noqa: E501
111
+ 'metadata': 'metadata', # noqa: E501
112
+ 'reports': 'reports', # noqa: E501
113
+ 'success': 'success', # noqa: E501
114
+ 'warning': 'warning', # noqa: E501
115
+ }
116
+
117
+ read_only_vars = {
118
+ }
119
+
120
+ _composed_schemas = {}
121
+
122
+ @classmethod
123
+ @convert_js_args_to_python_args
124
+ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
125
+ """CustomReportsResponse - a model defined in OpenAPI
126
+
127
+ Keyword Args:
128
+ _check_type (bool): if True, values for parameters in openapi_types
129
+ will be type checked and a TypeError will be
130
+ raised if the wrong type is input.
131
+ Defaults to True
132
+ _path_to_item (tuple/list): This is a list of keys or values to
133
+ drill down to the model in received_data
134
+ when deserializing a response
135
+ _spec_property_naming (bool): True if the variable names in the input data
136
+ are serialized names, as specified in the OpenAPI document.
137
+ False if the variable names in the input data
138
+ are pythonic names, e.g. snake case (default)
139
+ _configuration (Configuration): the instance to use when
140
+ deserializing a file_type parameter.
141
+ If passed, type conversion is attempted
142
+ If omitted no type conversion is done.
143
+ _visited_composed_classes (tuple): This stores a tuple of
144
+ classes that we have traveled through so that
145
+ if we see that class again we will not use its
146
+ discriminator again.
147
+ When traveling through a discriminator, the
148
+ composed schema that is
149
+ is traveled through is added to this set.
150
+ For example if Animal has a discriminator
151
+ petType and we pass in "Dog", and the class Dog
152
+ allOf includes Animal, we move through Animal
153
+ once using the discriminator, and pick Dog.
154
+ Then in Dog, we will make an instance of the
155
+ Animal class but this time we won't travel
156
+ through its discriminator because we passed in
157
+ _visited_composed_classes = (Animal,)
158
+ error (Error): [optional] # noqa: E501
159
+ metadata (ResponseMetadata): [optional] # noqa: E501
160
+ reports ([CustomReport]): reports. [optional] # noqa: E501
161
+ success (bool): Indicates if API call was successful. [optional] # noqa: E501
162
+ warning (Warning): [optional] # noqa: E501
163
+ """
164
+
165
+ _check_type = kwargs.pop('_check_type', True)
166
+ _spec_property_naming = kwargs.pop('_spec_property_naming', True)
167
+ _path_to_item = kwargs.pop('_path_to_item', ())
168
+ _configuration = kwargs.pop('_configuration', None)
169
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
170
+
171
+ self = super(OpenApiModel, cls).__new__(cls)
172
+
173
+ if args:
174
+ for arg in args:
175
+ if isinstance(arg, dict):
176
+ kwargs.update(arg)
177
+ else:
178
+ raise ApiTypeError(
179
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
180
+ args,
181
+ self.__class__.__name__,
182
+ ),
183
+ path_to_item=_path_to_item,
184
+ valid_classes=(self.__class__,),
185
+ )
186
+
187
+ self._data_store = {}
188
+ self._check_type = _check_type
189
+ self._spec_property_naming = _spec_property_naming
190
+ self._path_to_item = _path_to_item
191
+ self._configuration = _configuration
192
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
193
+
194
+ for var_name, var_value in kwargs.items():
195
+ if var_name not in self.attribute_map and \
196
+ self._configuration is not None and \
197
+ self._configuration.discard_unknown_keys and \
198
+ self.additional_properties_type is None:
199
+ # discard variable.
200
+ continue
201
+ setattr(self, var_name, var_value)
202
+ return self
203
+
204
+ required_properties = set([
205
+ '_data_store',
206
+ '_check_type',
207
+ '_spec_property_naming',
208
+ '_path_to_item',
209
+ '_configuration',
210
+ '_visited_composed_classes',
211
+ ])
212
+
213
+ @convert_js_args_to_python_args
214
+ def __init__(self, *args, **kwargs): # noqa: E501
215
+ """CustomReportsResponse - a model defined in OpenAPI
216
+
217
+ Keyword Args:
218
+ _check_type (bool): if True, values for parameters in openapi_types
219
+ will be type checked and a TypeError will be
220
+ raised if the wrong type is input.
221
+ Defaults to True
222
+ _path_to_item (tuple/list): This is a list of keys or values to
223
+ drill down to the model in received_data
224
+ when deserializing a response
225
+ _spec_property_naming (bool): True if the variable names in the input data
226
+ are serialized names, as specified in the OpenAPI document.
227
+ False if the variable names in the input data
228
+ are pythonic names, e.g. snake case (default)
229
+ _configuration (Configuration): the instance to use when
230
+ deserializing a file_type parameter.
231
+ If passed, type conversion is attempted
232
+ If omitted no type conversion is done.
233
+ _visited_composed_classes (tuple): This stores a tuple of
234
+ classes that we have traveled through so that
235
+ if we see that class again we will not use its
236
+ discriminator again.
237
+ When traveling through a discriminator, the
238
+ composed schema that is
239
+ is traveled through is added to this set.
240
+ For example if Animal has a discriminator
241
+ petType and we pass in "Dog", and the class Dog
242
+ allOf includes Animal, we move through Animal
243
+ once using the discriminator, and pick Dog.
244
+ Then in Dog, we will make an instance of the
245
+ Animal class but this time we won't travel
246
+ through its discriminator because we passed in
247
+ _visited_composed_classes = (Animal,)
248
+ error (Error): [optional] # noqa: E501
249
+ metadata (ResponseMetadata): [optional] # noqa: E501
250
+ reports ([CustomReport]): reports. [optional] # noqa: E501
251
+ success (bool): Indicates if API call was successful. [optional] # noqa: E501
252
+ warning (Warning): [optional] # noqa: E501
253
+ """
254
+
255
+ _check_type = kwargs.pop('_check_type', True)
256
+ _spec_property_naming = kwargs.pop('_spec_property_naming', False)
257
+ _path_to_item = kwargs.pop('_path_to_item', ())
258
+ _configuration = kwargs.pop('_configuration', None)
259
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
260
+
261
+ if args:
262
+ for arg in args:
263
+ if isinstance(arg, dict):
264
+ kwargs.update(arg)
265
+ else:
266
+ raise ApiTypeError(
267
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
268
+ args,
269
+ self.__class__.__name__,
270
+ ),
271
+ path_to_item=_path_to_item,
272
+ valid_classes=(self.__class__,),
273
+ )
274
+
275
+ self._data_store = {}
276
+ self._check_type = _check_type
277
+ self._spec_property_naming = _spec_property_naming
278
+ self._path_to_item = _path_to_item
279
+ self._configuration = _configuration
280
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
281
+
282
+ for var_name, var_value in kwargs.items():
283
+ if var_name not in self.attribute_map and \
284
+ self._configuration is not None and \
285
+ self._configuration.discard_unknown_keys and \
286
+ self.additional_properties_type is None:
287
+ # discard variable.
288
+ continue
289
+ setattr(self, var_name, var_value)
290
+ if var_name in self.read_only_vars:
291
+ raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
292
+ f"class with read only attributes.")