criteo-api-retailmedia-sdk 2023.1.0.240118__py3-none-any.whl → 2023.1.0.240207__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.

Potentially problematic release.


This version of criteo-api-retailmedia-sdk might be problematic. Click here for more details.

Files changed (47) hide show
  1. {criteo_api_retailmedia_sdk-2023.1.0.240118.dist-info → criteo_api_retailmedia_sdk-2023.1.0.240207.dist-info}/METADATA +3 -3
  2. {criteo_api_retailmedia_sdk-2023.1.0.240118.dist-info → criteo_api_retailmedia_sdk-2023.1.0.240207.dist-info}/RECORD +34 -46
  3. criteo_api_retailmedia_v2023_01/__init__.py +1 -1
  4. criteo_api_retailmedia_v2023_01/api/audience_api.py +113 -100
  5. criteo_api_retailmedia_v2023_01/api/campaign_api.py +0 -442
  6. criteo_api_retailmedia_v2023_01/api_client.py +1 -1
  7. criteo_api_retailmedia_v2023_01/configuration.py +1 -1
  8. criteo_api_retailmedia_v2023_01/model/campaign_attributes_v202301.py +4 -0
  9. criteo_api_retailmedia_v2023_01/model/campaign_v202301.py +4 -0
  10. criteo_api_retailmedia_v2023_01/model/editable_campaign_attributes_v202301.py +4 -0
  11. criteo_api_retailmedia_v2023_01/model/external_account.py +4 -0
  12. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_attributes.py → rm_legacy_audience_create_entity_v1.py} +10 -5
  13. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_body.py → rm_legacy_audience_create_entity_v1_resource.py} +18 -22
  14. criteo_api_retailmedia_v2023_01/model/{retail_media_audience_v2_response.py → rm_legacy_audience_create_entity_v1_response.py} +15 -15
  15. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_v2_attributes.py → rm_legacy_audience_create_entity_v2.py} +10 -10
  16. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_v2_data.py → rm_legacy_audience_create_entity_v2_resource.py} +18 -22
  17. criteo_api_retailmedia_v2023_01/model/{common_status_code_response.py → rm_legacy_audience_create_entity_v2_response.py} +16 -10
  18. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_v2_request.py → rm_legacy_audience_create_input_entity_v1.py} +10 -16
  19. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_request.py → rm_legacy_audience_create_input_entity_v2.py} +10 -16
  20. criteo_api_retailmedia_v2023_01/model/{retail_media_audience_v2_attributes.py → rm_legacy_audience_get_entity_v1.py} +23 -23
  21. criteo_api_retailmedia_v2023_01/model/{creative202207_response.py → rm_legacy_audience_get_entity_v1_list_response.py} +16 -16
  22. criteo_api_retailmedia_v2023_01/model/{retail_media_audience_v2.py → rm_legacy_audience_get_entity_v1_resource.py} +24 -29
  23. criteo_api_retailmedia_v2023_01/model/{retail_media_audience_attributes.py → rm_legacy_audience_get_entity_v2.py} +15 -15
  24. criteo_api_retailmedia_v2023_01/model/{create_retail_media_audience_response.py → rm_legacy_audience_get_entity_v2_list_response.py} +18 -20
  25. criteo_api_retailmedia_v2023_01/model/{resource_of_creative202207.py → rm_legacy_audience_get_entity_v2_resource.py} +10 -10
  26. criteo_api_retailmedia_v2023_01/model/rm_legacy_audience_user_behavior_create_v2.py +279 -0
  27. criteo_api_retailmedia_v2023_01/model/{user_behavior_details_v2.py → rm_legacy_audience_user_behavior_details_v2.py} +11 -11
  28. criteo_api_retailmedia_v2023_01/model/{customer_list_details.py → rm_legacy_segment_customer_list.py} +11 -5
  29. criteo_api_retailmedia_v2023_01/model/{color_variable_value.py → rm_legacy_segment_user_behavior_create_v2.py} +44 -15
  30. criteo_api_retailmedia_v2023_01/model/{user_behavior_details.py → rm_legacy_segment_user_behavior_v1.py} +28 -28
  31. criteo_api_retailmedia_v2023_01/model/{create_user_behavior_segment_v2.py → rm_legacy_segment_user_behavior_v2.py} +7 -5
  32. criteo_api_retailmedia_v2023_01/models/__init__.py +20 -32
  33. criteo_api_retailmedia_v2023_01/model/choice_variable_value.py +0 -269
  34. criteo_api_retailmedia_v2023_01/model/create_retail_media_audience.py +0 -287
  35. criteo_api_retailmedia_v2023_01/model/create_retail_media_audience_v2.py +0 -287
  36. criteo_api_retailmedia_v2023_01/model/creative202207.py +0 -340
  37. criteo_api_retailmedia_v2023_01/model/creative_create_model202207.py +0 -297
  38. criteo_api_retailmedia_v2023_01/model/creative_update_model202207.py +0 -297
  39. criteo_api_retailmedia_v2023_01/model/files_variable_value.py +0 -271
  40. criteo_api_retailmedia_v2023_01/model/get_page_of_audiences_by_account_id_response.py +0 -295
  41. criteo_api_retailmedia_v2023_01/model/hyperlink_variable_value.py +0 -269
  42. criteo_api_retailmedia_v2023_01/model/retail_media_audience.py +0 -297
  43. criteo_api_retailmedia_v2023_01/model/retail_media_audience_v2_list_response.py +0 -293
  44. criteo_api_retailmedia_v2023_01/model/template_variable_value.py +0 -303
  45. criteo_api_retailmedia_v2023_01/model/text_variable_value.py +0 -269
  46. {criteo_api_retailmedia_sdk-2023.1.0.240118.dist-info → criteo_api_retailmedia_sdk-2023.1.0.240207.dist-info}/WHEEL +0 -0
  47. {criteo_api_retailmedia_sdk-2023.1.0.240118.dist-info → criteo_api_retailmedia_sdk-2023.1.0.240207.dist-info}/top_level.txt +0 -0
@@ -1,303 +0,0 @@
1
- """
2
- Criteo API
3
-
4
- Criteo API - RetailMedia # noqa: E501
5
-
6
- The version of the OpenAPI document: 2023-01
7
- Generated by: https://openapi-generator.tech
8
- """
9
-
10
-
11
- import re # noqa: F401
12
- import sys # noqa: F401
13
-
14
- from criteo_api_retailmedia_v2023_01.model_utils import ( # noqa: F401
15
- ApiTypeError,
16
- ModelComposed,
17
- ModelNormal,
18
- ModelSimple,
19
- cached_property,
20
- change_keys_js_to_python,
21
- convert_js_args_to_python_args,
22
- date,
23
- datetime,
24
- file_type,
25
- none_type,
26
- validate_get_composed_info,
27
- OpenApiModel
28
- )
29
- from criteo_api_retailmedia_v2023_01.exceptions import ApiAttributeError
30
-
31
-
32
- def lazy_import():
33
- from criteo_api_retailmedia_v2023_01.model.choice_variable_value import ChoiceVariableValue
34
- from criteo_api_retailmedia_v2023_01.model.color_variable_value import ColorVariableValue
35
- from criteo_api_retailmedia_v2023_01.model.files_variable_value import FilesVariableValue
36
- from criteo_api_retailmedia_v2023_01.model.hyperlink_variable_value import HyperlinkVariableValue
37
- from criteo_api_retailmedia_v2023_01.model.text_variable_value import TextVariableValue
38
- globals()['ChoiceVariableValue'] = ChoiceVariableValue
39
- globals()['ColorVariableValue'] = ColorVariableValue
40
- globals()['FilesVariableValue'] = FilesVariableValue
41
- globals()['HyperlinkVariableValue'] = HyperlinkVariableValue
42
- globals()['TextVariableValue'] = TextVariableValue
43
-
44
-
45
- class TemplateVariableValue(ModelNormal):
46
- """NOTE: This class is auto generated by OpenAPI Generator.
47
- Ref: https://openapi-generator.tech
48
-
49
- Do not edit the class manually.
50
-
51
- Attributes:
52
- allowed_values (dict): The key is the tuple path to the attribute
53
- and the for var_name this is (var_name,). The value is a dict
54
- with a capitalized key describing the allowed value and an allowed
55
- value. These dicts store the allowed enum values.
56
- attribute_map (dict): The key is attribute name
57
- and the value is json key in definition.
58
- discriminator_value_class_map (dict): A dict to go from the discriminator
59
- variable value to the discriminator class name.
60
- validations (dict): The key is the tuple path to the attribute
61
- and the for var_name this is (var_name,). The value is a dict
62
- that stores validations for max_length, min_length, max_items,
63
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
64
- inclusive_minimum, and regex.
65
- additional_properties_type (tuple): A tuple of classes accepted
66
- as additional properties values.
67
- """
68
-
69
- allowed_values = {
70
- }
71
-
72
- validations = {
73
- }
74
-
75
- @cached_property
76
- def additional_properties_type():
77
- """
78
- This must be a method because a model may have properties that are
79
- of type self, this must run after the class is loaded
80
- """
81
- lazy_import()
82
- return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
83
-
84
- _nullable = False
85
-
86
- @cached_property
87
- def openapi_types():
88
- """
89
- This must be a method because a model may have properties that are
90
- of type self, this must run after the class is loaded
91
-
92
- Returns
93
- openapi_types (dict): The key is attribute name
94
- and the value is attribute type.
95
- """
96
- lazy_import()
97
- return {
98
- 'id': (str,), # noqa: E501
99
- 'text_variable_value': (TextVariableValue,), # noqa: E501
100
- 'choice_variable_value': (ChoiceVariableValue,), # noqa: E501
101
- 'color_variable_value': (ColorVariableValue,), # noqa: E501
102
- 'files_variable_value': (FilesVariableValue,), # noqa: E501
103
- 'hyperlink_variable_value': (HyperlinkVariableValue,), # noqa: E501
104
- }
105
-
106
- @cached_property
107
- def discriminator():
108
- return None
109
-
110
-
111
- attribute_map = {
112
- 'id': 'id', # noqa: E501
113
- 'text_variable_value': 'textVariableValue', # noqa: E501
114
- 'choice_variable_value': 'choiceVariableValue', # noqa: E501
115
- 'color_variable_value': 'colorVariableValue', # noqa: E501
116
- 'files_variable_value': 'filesVariableValue', # noqa: E501
117
- 'hyperlink_variable_value': 'hyperlinkVariableValue', # noqa: E501
118
- }
119
-
120
- read_only_vars = {
121
- }
122
-
123
- _composed_schemas = {}
124
-
125
- @classmethod
126
- @convert_js_args_to_python_args
127
- def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501
128
- """TemplateVariableValue - a model defined in OpenAPI
129
-
130
- Args:
131
- id (str): The id of the template variable the value is applied to
132
-
133
- Keyword Args:
134
- _check_type (bool): if True, values for parameters in openapi_types
135
- will be type checked and a TypeError will be
136
- raised if the wrong type is input.
137
- Defaults to True
138
- _path_to_item (tuple/list): This is a list of keys or values to
139
- drill down to the model in received_data
140
- when deserializing a response
141
- _spec_property_naming (bool): True if the variable names in the input data
142
- are serialized names, as specified in the OpenAPI document.
143
- False if the variable names in the input data
144
- are pythonic names, e.g. snake case (default)
145
- _configuration (Configuration): the instance to use when
146
- deserializing a file_type parameter.
147
- If passed, type conversion is attempted
148
- If omitted no type conversion is done.
149
- _visited_composed_classes (tuple): This stores a tuple of
150
- classes that we have traveled through so that
151
- if we see that class again we will not use its
152
- discriminator again.
153
- When traveling through a discriminator, the
154
- composed schema that is
155
- is traveled through is added to this set.
156
- For example if Animal has a discriminator
157
- petType and we pass in "Dog", and the class Dog
158
- allOf includes Animal, we move through Animal
159
- once using the discriminator, and pick Dog.
160
- Then in Dog, we will make an instance of the
161
- Animal class but this time we won't travel
162
- through its discriminator because we passed in
163
- _visited_composed_classes = (Animal,)
164
- text_variable_value (TextVariableValue): [optional] # noqa: E501
165
- choice_variable_value (ChoiceVariableValue): [optional] # noqa: E501
166
- color_variable_value (ColorVariableValue): [optional] # noqa: E501
167
- files_variable_value (FilesVariableValue): [optional] # noqa: E501
168
- hyperlink_variable_value (HyperlinkVariableValue): [optional] # noqa: E501
169
- """
170
-
171
- _check_type = kwargs.pop('_check_type', True)
172
- _spec_property_naming = kwargs.pop('_spec_property_naming', True)
173
- _path_to_item = kwargs.pop('_path_to_item', ())
174
- _configuration = kwargs.pop('_configuration', None)
175
- _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
176
-
177
- self = super(OpenApiModel, cls).__new__(cls)
178
-
179
- if args:
180
- for arg in args:
181
- if isinstance(arg, dict):
182
- kwargs.update(arg)
183
- else:
184
- raise ApiTypeError(
185
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
186
- args,
187
- self.__class__.__name__,
188
- ),
189
- path_to_item=_path_to_item,
190
- valid_classes=(self.__class__,),
191
- )
192
-
193
- self._data_store = {}
194
- self._check_type = _check_type
195
- self._spec_property_naming = _spec_property_naming
196
- self._path_to_item = _path_to_item
197
- self._configuration = _configuration
198
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
199
-
200
- self.id = id
201
- for var_name, var_value in kwargs.items():
202
- if var_name not in self.attribute_map and \
203
- self._configuration is not None and \
204
- self._configuration.discard_unknown_keys and \
205
- self.additional_properties_type is None:
206
- # discard variable.
207
- continue
208
- setattr(self, var_name, var_value)
209
- return self
210
-
211
- required_properties = set([
212
- '_data_store',
213
- '_check_type',
214
- '_spec_property_naming',
215
- '_path_to_item',
216
- '_configuration',
217
- '_visited_composed_classes',
218
- ])
219
-
220
- @convert_js_args_to_python_args
221
- def __init__(self, id, *args, **kwargs): # noqa: E501
222
- """TemplateVariableValue - a model defined in OpenAPI
223
-
224
- Args:
225
- id (str): The id of the template variable the value is applied to
226
-
227
- Keyword Args:
228
- _check_type (bool): if True, values for parameters in openapi_types
229
- will be type checked and a TypeError will be
230
- raised if the wrong type is input.
231
- Defaults to True
232
- _path_to_item (tuple/list): This is a list of keys or values to
233
- drill down to the model in received_data
234
- when deserializing a response
235
- _spec_property_naming (bool): True if the variable names in the input data
236
- are serialized names, as specified in the OpenAPI document.
237
- False if the variable names in the input data
238
- are pythonic names, e.g. snake case (default)
239
- _configuration (Configuration): the instance to use when
240
- deserializing a file_type parameter.
241
- If passed, type conversion is attempted
242
- If omitted no type conversion is done.
243
- _visited_composed_classes (tuple): This stores a tuple of
244
- classes that we have traveled through so that
245
- if we see that class again we will not use its
246
- discriminator again.
247
- When traveling through a discriminator, the
248
- composed schema that is
249
- is traveled through is added to this set.
250
- For example if Animal has a discriminator
251
- petType and we pass in "Dog", and the class Dog
252
- allOf includes Animal, we move through Animal
253
- once using the discriminator, and pick Dog.
254
- Then in Dog, we will make an instance of the
255
- Animal class but this time we won't travel
256
- through its discriminator because we passed in
257
- _visited_composed_classes = (Animal,)
258
- text_variable_value (TextVariableValue): [optional] # noqa: E501
259
- choice_variable_value (ChoiceVariableValue): [optional] # noqa: E501
260
- color_variable_value (ColorVariableValue): [optional] # noqa: E501
261
- files_variable_value (FilesVariableValue): [optional] # noqa: E501
262
- hyperlink_variable_value (HyperlinkVariableValue): [optional] # noqa: E501
263
- """
264
-
265
- _check_type = kwargs.pop('_check_type', True)
266
- _spec_property_naming = kwargs.pop('_spec_property_naming', False)
267
- _path_to_item = kwargs.pop('_path_to_item', ())
268
- _configuration = kwargs.pop('_configuration', None)
269
- _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
270
-
271
- if args:
272
- for arg in args:
273
- if isinstance(arg, dict):
274
- kwargs.update(arg)
275
- else:
276
- raise ApiTypeError(
277
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
278
- args,
279
- self.__class__.__name__,
280
- ),
281
- path_to_item=_path_to_item,
282
- valid_classes=(self.__class__,),
283
- )
284
-
285
- self._data_store = {}
286
- self._check_type = _check_type
287
- self._spec_property_naming = _spec_property_naming
288
- self._path_to_item = _path_to_item
289
- self._configuration = _configuration
290
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
291
-
292
- self.id = id
293
- for var_name, var_value in kwargs.items():
294
- if var_name not in self.attribute_map and \
295
- self._configuration is not None and \
296
- self._configuration.discard_unknown_keys and \
297
- self.additional_properties_type is None:
298
- # discard variable.
299
- continue
300
- setattr(self, var_name, var_value)
301
- if var_name in self.read_only_vars:
302
- raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
303
- f"class with read only attributes.")
@@ -1,269 +0,0 @@
1
- """
2
- Criteo API
3
-
4
- Criteo API - RetailMedia # noqa: E501
5
-
6
- The version of the OpenAPI document: 2023-01
7
- Generated by: https://openapi-generator.tech
8
- """
9
-
10
-
11
- import re # noqa: F401
12
- import sys # noqa: F401
13
-
14
- from criteo_api_retailmedia_v2023_01.model_utils import ( # noqa: F401
15
- ApiTypeError,
16
- ModelComposed,
17
- ModelNormal,
18
- ModelSimple,
19
- cached_property,
20
- change_keys_js_to_python,
21
- convert_js_args_to_python_args,
22
- date,
23
- datetime,
24
- file_type,
25
- none_type,
26
- validate_get_composed_info,
27
- OpenApiModel
28
- )
29
- from criteo_api_retailmedia_v2023_01.exceptions import ApiAttributeError
30
-
31
-
32
-
33
- class TextVariableValue(ModelNormal):
34
- """NOTE: This class is auto generated by OpenAPI Generator.
35
- Ref: https://openapi-generator.tech
36
-
37
- Do not edit the class manually.
38
-
39
- Attributes:
40
- allowed_values (dict): The key is the tuple path to the attribute
41
- and the for var_name this is (var_name,). The value is a dict
42
- with a capitalized key describing the allowed value and an allowed
43
- value. These dicts store the allowed enum values.
44
- attribute_map (dict): The key is attribute name
45
- and the value is json key in definition.
46
- discriminator_value_class_map (dict): A dict to go from the discriminator
47
- variable value to the discriminator class name.
48
- validations (dict): The key is the tuple path to the attribute
49
- and the for var_name this is (var_name,). The value is a dict
50
- that stores validations for max_length, min_length, max_items,
51
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
52
- inclusive_minimum, and regex.
53
- additional_properties_type (tuple): A tuple of classes accepted
54
- as additional properties values.
55
- """
56
-
57
- allowed_values = {
58
- }
59
-
60
- validations = {
61
- }
62
-
63
- @cached_property
64
- def additional_properties_type():
65
- """
66
- This must be a method because a model may have properties that are
67
- of type self, this must run after the class is loaded
68
- """
69
- return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
70
-
71
- _nullable = False
72
-
73
- @cached_property
74
- def openapi_types():
75
- """
76
- This must be a method because a model may have properties that are
77
- of type self, this must run after the class is loaded
78
-
79
- Returns
80
- openapi_types (dict): The key is attribute name
81
- and the value is attribute type.
82
- """
83
- return {
84
- 'text': (str,), # noqa: E501
85
- }
86
-
87
- @cached_property
88
- def discriminator():
89
- return None
90
-
91
-
92
- attribute_map = {
93
- 'text': 'text', # noqa: E501
94
- }
95
-
96
- read_only_vars = {
97
- }
98
-
99
- _composed_schemas = {}
100
-
101
- @classmethod
102
- @convert_js_args_to_python_args
103
- def _from_openapi_data(cls, text, *args, **kwargs): # noqa: E501
104
- """TextVariableValue - a model defined in OpenAPI
105
-
106
- Args:
107
- text (str): The displayed text
108
-
109
- Keyword Args:
110
- _check_type (bool): if True, values for parameters in openapi_types
111
- will be type checked and a TypeError will be
112
- raised if the wrong type is input.
113
- Defaults to True
114
- _path_to_item (tuple/list): This is a list of keys or values to
115
- drill down to the model in received_data
116
- when deserializing a response
117
- _spec_property_naming (bool): True if the variable names in the input data
118
- are serialized names, as specified in the OpenAPI document.
119
- False if the variable names in the input data
120
- are pythonic names, e.g. snake case (default)
121
- _configuration (Configuration): the instance to use when
122
- deserializing a file_type parameter.
123
- If passed, type conversion is attempted
124
- If omitted no type conversion is done.
125
- _visited_composed_classes (tuple): This stores a tuple of
126
- classes that we have traveled through so that
127
- if we see that class again we will not use its
128
- discriminator again.
129
- When traveling through a discriminator, the
130
- composed schema that is
131
- is traveled through is added to this set.
132
- For example if Animal has a discriminator
133
- petType and we pass in "Dog", and the class Dog
134
- allOf includes Animal, we move through Animal
135
- once using the discriminator, and pick Dog.
136
- Then in Dog, we will make an instance of the
137
- Animal class but this time we won't travel
138
- through its discriminator because we passed in
139
- _visited_composed_classes = (Animal,)
140
- """
141
-
142
- _check_type = kwargs.pop('_check_type', True)
143
- _spec_property_naming = kwargs.pop('_spec_property_naming', True)
144
- _path_to_item = kwargs.pop('_path_to_item', ())
145
- _configuration = kwargs.pop('_configuration', None)
146
- _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
147
-
148
- self = super(OpenApiModel, cls).__new__(cls)
149
-
150
- if args:
151
- for arg in args:
152
- if isinstance(arg, dict):
153
- kwargs.update(arg)
154
- else:
155
- raise ApiTypeError(
156
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
157
- args,
158
- self.__class__.__name__,
159
- ),
160
- path_to_item=_path_to_item,
161
- valid_classes=(self.__class__,),
162
- )
163
-
164
- self._data_store = {}
165
- self._check_type = _check_type
166
- self._spec_property_naming = _spec_property_naming
167
- self._path_to_item = _path_to_item
168
- self._configuration = _configuration
169
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
170
-
171
- self.text = text
172
- for var_name, var_value in kwargs.items():
173
- if var_name not in self.attribute_map and \
174
- self._configuration is not None and \
175
- self._configuration.discard_unknown_keys and \
176
- self.additional_properties_type is None:
177
- # discard variable.
178
- continue
179
- setattr(self, var_name, var_value)
180
- return self
181
-
182
- required_properties = set([
183
- '_data_store',
184
- '_check_type',
185
- '_spec_property_naming',
186
- '_path_to_item',
187
- '_configuration',
188
- '_visited_composed_classes',
189
- ])
190
-
191
- @convert_js_args_to_python_args
192
- def __init__(self, text, *args, **kwargs): # noqa: E501
193
- """TextVariableValue - a model defined in OpenAPI
194
-
195
- Args:
196
- text (str): The displayed text
197
-
198
- Keyword Args:
199
- _check_type (bool): if True, values for parameters in openapi_types
200
- will be type checked and a TypeError will be
201
- raised if the wrong type is input.
202
- Defaults to True
203
- _path_to_item (tuple/list): This is a list of keys or values to
204
- drill down to the model in received_data
205
- when deserializing a response
206
- _spec_property_naming (bool): True if the variable names in the input data
207
- are serialized names, as specified in the OpenAPI document.
208
- False if the variable names in the input data
209
- are pythonic names, e.g. snake case (default)
210
- _configuration (Configuration): the instance to use when
211
- deserializing a file_type parameter.
212
- If passed, type conversion is attempted
213
- If omitted no type conversion is done.
214
- _visited_composed_classes (tuple): This stores a tuple of
215
- classes that we have traveled through so that
216
- if we see that class again we will not use its
217
- discriminator again.
218
- When traveling through a discriminator, the
219
- composed schema that is
220
- is traveled through is added to this set.
221
- For example if Animal has a discriminator
222
- petType and we pass in "Dog", and the class Dog
223
- allOf includes Animal, we move through Animal
224
- once using the discriminator, and pick Dog.
225
- Then in Dog, we will make an instance of the
226
- Animal class but this time we won't travel
227
- through its discriminator because we passed in
228
- _visited_composed_classes = (Animal,)
229
- """
230
-
231
- _check_type = kwargs.pop('_check_type', True)
232
- _spec_property_naming = kwargs.pop('_spec_property_naming', False)
233
- _path_to_item = kwargs.pop('_path_to_item', ())
234
- _configuration = kwargs.pop('_configuration', None)
235
- _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
236
-
237
- if args:
238
- for arg in args:
239
- if isinstance(arg, dict):
240
- kwargs.update(arg)
241
- else:
242
- raise ApiTypeError(
243
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
244
- args,
245
- self.__class__.__name__,
246
- ),
247
- path_to_item=_path_to_item,
248
- valid_classes=(self.__class__,),
249
- )
250
-
251
- self._data_store = {}
252
- self._check_type = _check_type
253
- self._spec_property_naming = _spec_property_naming
254
- self._path_to_item = _path_to_item
255
- self._configuration = _configuration
256
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
257
-
258
- self.text = text
259
- for var_name, var_value in kwargs.items():
260
- if var_name not in self.attribute_map and \
261
- self._configuration is not None and \
262
- self._configuration.discard_unknown_keys and \
263
- self.additional_properties_type is None:
264
- # discard variable.
265
- continue
266
- setattr(self, var_name, var_value)
267
- if var_name in self.read_only_vars:
268
- raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
269
- f"class with read only attributes.")