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

@@ -22,6 +22,7 @@ from criteo_api_retailmedia_preview.model_utils import ( # noqa: F401
22
22
  validate_and_convert_types
23
23
  )
24
24
  from criteo_api_retailmedia_preview.model.entity_resource_outcome_of_retail_media_account_v2 import EntityResourceOutcomeOfRetailMediaAccountV2
25
+ from criteo_api_retailmedia_preview.model.grant_consent_input import GrantConsentInput
25
26
  from criteo_api_retailmedia_preview.model.value_resource_collection_input_of_retail_media_seller import ValueResourceCollectionInputOfRetailMediaSeller
26
27
  from criteo_api_retailmedia_preview.model.value_resource_collection_outcome_of_retail_media_seller import ValueResourceCollectionOutcomeOfRetailMediaSeller
27
28
  from criteo_api_retailmedia_preview.model.value_resource_input_of_retail_media_brand_account_creation_v2 import ValueResourceInputOfRetailMediaBrandAccountCreationV2
@@ -41,6 +42,62 @@ class ThirdPartyAccountsApi(object):
41
42
  if api_client is None:
42
43
  api_client = ApiClient()
43
44
  self.api_client = api_client
45
+ self.grant_third_party_consent_endpoint = _Endpoint(
46
+ settings={
47
+ 'response_type': None,
48
+ 'auth': [
49
+ 'oauth',
50
+ 'oauth'
51
+ ],
52
+ 'endpoint_path': '/preview/retail-media/accounts/{accountId}/grant-third-party-consent',
53
+ 'operation_id': 'grant_third_party_consent',
54
+ 'http_method': 'POST',
55
+ 'servers': None,
56
+ },
57
+ params_map={
58
+ 'all': [
59
+ 'account_id',
60
+ 'grant_consent_input',
61
+ ],
62
+ 'required': [
63
+ 'account_id',
64
+ ],
65
+ 'nullable': [
66
+ ],
67
+ 'enum': [
68
+ ],
69
+ 'validation': [
70
+ ]
71
+ },
72
+ root_map={
73
+ 'validations': {
74
+ },
75
+ 'allowed_values': {
76
+ },
77
+ 'openapi_types': {
78
+ 'account_id':
79
+ (str,),
80
+ 'grant_consent_input':
81
+ (GrantConsentInput,),
82
+ },
83
+ 'attribute_map': {
84
+ 'account_id': 'accountId',
85
+ },
86
+ 'location_map': {
87
+ 'account_id': 'path',
88
+ 'grant_consent_input': 'body',
89
+ },
90
+ 'collection_format_map': {
91
+ }
92
+ },
93
+ headers_map={
94
+ 'accept': [],
95
+ 'content_type': [
96
+ 'application/json'
97
+ ]
98
+ },
99
+ api_client=api_client
100
+ )
44
101
  self.preview_retail_media_third_party_accounts_account_id_brands_add_post_endpoint = _Endpoint(
45
102
  settings={
46
103
  'response_type': (ValueResourceOutcomeOfRetailMediaBrands,),
@@ -332,6 +389,90 @@ class ThirdPartyAccountsApi(object):
332
389
  api_client=api_client
333
390
  )
334
391
 
392
+ def grant_third_party_consent(
393
+ self,
394
+ account_id,
395
+ **kwargs
396
+ ):
397
+ """ # noqa: E501
398
+
399
+ Grant third-party consent to a business application on behalf of a Private Market demand account # noqa: E501
400
+ This method makes a synchronous HTTP request by default. To make an
401
+ asynchronous HTTP request, please pass async_req=True
402
+
403
+ >>> thread = api.grant_third_party_consent(account_id, async_req=True)
404
+ >>> result = thread.get()
405
+
406
+ Args:
407
+ account_id (str): The demand account ID on which to grant consent
408
+
409
+ Keyword Args:
410
+ grant_consent_input (GrantConsentInput): The request input containing clientId, callbackURL, and callbackState. [optional]
411
+ _return_http_data_only (bool): response data without head status
412
+ code and headers. Default is True.
413
+ _preload_content (bool): if False, the urllib3.HTTPResponse object
414
+ will be returned without reading/decoding response data.
415
+ Default is True.
416
+ _request_timeout (int/float/tuple): timeout setting for this request. If
417
+ one number provided, it will be total request timeout. It can also
418
+ be a pair (tuple) of (connection, read) timeouts.
419
+ Default is None.
420
+ _check_input_type (bool): specifies if type checking
421
+ should be done one the data sent to the server.
422
+ Default is True.
423
+ _check_return_type (bool): specifies if type checking
424
+ should be done one the data received from the server.
425
+ Default is True.
426
+ _spec_property_naming (bool): True if the variable names in the input data
427
+ are serialized names, as specified in the OpenAPI document.
428
+ False if the variable names in the input data
429
+ are pythonic names, e.g. snake case (default)
430
+ _content_type (str/None): force body content-type.
431
+ Default is None and content-type will be predicted by allowed
432
+ content-types and body.
433
+ _host_index (int/None): specifies the index of the server
434
+ that we want to use.
435
+ Default is read from the configuration.
436
+ _request_auths (list): set to override the auth_settings for an a single
437
+ request; this effectively ignores the authentication
438
+ in the spec for a single request.
439
+ Default is None
440
+ async_req (bool): execute request asynchronously
441
+
442
+ Returns:
443
+ None
444
+ If the method is called asynchronously, returns the request
445
+ thread.
446
+ """
447
+ kwargs['async_req'] = kwargs.get(
448
+ 'async_req', False
449
+ )
450
+ kwargs['_return_http_data_only'] = kwargs.get(
451
+ '_return_http_data_only', True
452
+ )
453
+ kwargs['_preload_content'] = kwargs.get(
454
+ '_preload_content', True
455
+ )
456
+ kwargs['_request_timeout'] = kwargs.get(
457
+ '_request_timeout', None
458
+ )
459
+ kwargs['_check_input_type'] = kwargs.get(
460
+ '_check_input_type', True
461
+ )
462
+ kwargs['_check_return_type'] = kwargs.get(
463
+ '_check_return_type', True
464
+ )
465
+ kwargs['_spec_property_naming'] = kwargs.get(
466
+ '_spec_property_naming', False
467
+ )
468
+ kwargs['_content_type'] = kwargs.get(
469
+ '_content_type')
470
+ kwargs['_host_index'] = kwargs.get('_host_index')
471
+ kwargs['_request_auths'] = kwargs.get('_request_auths', None)
472
+ kwargs['account_id'] = \
473
+ account_id
474
+ return self.grant_third_party_consent_endpoint.call_with_http_info(**kwargs)
475
+
335
476
  def preview_retail_media_third_party_accounts_account_id_brands_add_post(
336
477
  self,
337
478
  account_id,
@@ -76,7 +76,7 @@ class ApiClient(object):
76
76
  self.default_headers[header_name] = header_value
77
77
  self.cookie = cookie
78
78
  # Set default User-Agent.
79
- self.user_agent = 'OpenAPI-Generator/0.0.251028/python'
79
+ self.user_agent = 'OpenAPI-Generator/0.0.251030/python'
80
80
 
81
81
  def __enter__(self):
82
82
  return self
@@ -395,7 +395,7 @@ class Configuration(object):
395
395
  "OS: {env}\n"\
396
396
  "Python Version: {pyversion}\n"\
397
397
  "Version of the API: Preview\n"\
398
- "SDK Package Version: 0.0.251028".\
398
+ "SDK Package Version: 0.0.251030".\
399
399
  format(env=sys.platform, pyversion=sys.version)
400
400
 
401
401
  def get_host_settings(self):
@@ -0,0 +1,269 @@
1
+ """
2
+ Criteo API
3
+
4
+ Criteo API - RetailMedia # noqa: E501
5
+
6
+ The version of the OpenAPI document: Preview
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_preview.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_preview.exceptions import ApiAttributeError
30
+
31
+
32
+ def lazy_import():
33
+ from criteo_api_retailmedia_preview.model.grant_consent_model_value_resource import GrantConsentModelValueResource
34
+ globals()['GrantConsentModelValueResource'] = GrantConsentModelValueResource
35
+
36
+
37
+ class GrantConsentInput(ModelNormal):
38
+ """NOTE: This class is auto generated by OpenAPI Generator.
39
+ Ref: https://openapi-generator.tech
40
+
41
+ Do not edit the class manually.
42
+
43
+ Attributes:
44
+ allowed_values (dict): The key is the tuple path to the attribute
45
+ and the for var_name this is (var_name,). The value is a dict
46
+ with a capitalized key describing the allowed value and an allowed
47
+ value. These dicts store the allowed enum values.
48
+ attribute_map (dict): The key is attribute name
49
+ and the value is json key in definition.
50
+ discriminator_value_class_map (dict): A dict to go from the discriminator
51
+ variable value to the discriminator class name.
52
+ validations (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
+ that stores validations for max_length, min_length, max_items,
55
+ min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
56
+ inclusive_minimum, and regex.
57
+ additional_properties_type (tuple): A tuple of classes accepted
58
+ as additional properties values.
59
+ """
60
+
61
+ allowed_values = {
62
+ }
63
+
64
+ validations = {
65
+ }
66
+
67
+ @cached_property
68
+ def additional_properties_type():
69
+ """
70
+ This must be a method because a model may have properties that are
71
+ of type self, this must run after the class is loaded
72
+ """
73
+ lazy_import()
74
+ return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
75
+
76
+ _nullable = False
77
+
78
+ @cached_property
79
+ def openapi_types():
80
+ """
81
+ This must be a method because a model may have properties that are
82
+ of type self, this must run after the class is loaded
83
+
84
+ Returns
85
+ openapi_types (dict): The key is attribute name
86
+ and the value is attribute type.
87
+ """
88
+ lazy_import()
89
+ return {
90
+ 'data': (GrantConsentModelValueResource,), # noqa: E501
91
+ }
92
+
93
+ @cached_property
94
+ def discriminator():
95
+ return None
96
+
97
+
98
+ attribute_map = {
99
+ 'data': 'data', # noqa: E501
100
+ }
101
+
102
+ read_only_vars = {
103
+ }
104
+
105
+ _composed_schemas = {}
106
+
107
+ @classmethod
108
+ @convert_js_args_to_python_args
109
+ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
110
+ """GrantConsentInput - a model defined in OpenAPI
111
+
112
+ Keyword Args:
113
+ _check_type (bool): if True, values for parameters in openapi_types
114
+ will be type checked and a TypeError will be
115
+ raised if the wrong type is input.
116
+ Defaults to True
117
+ _path_to_item (tuple/list): This is a list of keys or values to
118
+ drill down to the model in received_data
119
+ when deserializing a response
120
+ _spec_property_naming (bool): True if the variable names in the input data
121
+ are serialized names, as specified in the OpenAPI document.
122
+ False if the variable names in the input data
123
+ are pythonic names, e.g. snake case (default)
124
+ _configuration (Configuration): the instance to use when
125
+ deserializing a file_type parameter.
126
+ If passed, type conversion is attempted
127
+ If omitted no type conversion is done.
128
+ _visited_composed_classes (tuple): This stores a tuple of
129
+ classes that we have traveled through so that
130
+ if we see that class again we will not use its
131
+ discriminator again.
132
+ When traveling through a discriminator, the
133
+ composed schema that is
134
+ is traveled through is added to this set.
135
+ For example if Animal has a discriminator
136
+ petType and we pass in "Dog", and the class Dog
137
+ allOf includes Animal, we move through Animal
138
+ once using the discriminator, and pick Dog.
139
+ Then in Dog, we will make an instance of the
140
+ Animal class but this time we won't travel
141
+ through its discriminator because we passed in
142
+ _visited_composed_classes = (Animal,)
143
+ data (GrantConsentModelValueResource): [optional] # noqa: E501
144
+ """
145
+
146
+ _check_type = kwargs.pop('_check_type', True)
147
+ _spec_property_naming = kwargs.pop('_spec_property_naming', True)
148
+ _path_to_item = kwargs.pop('_path_to_item', ())
149
+ _configuration = kwargs.pop('_configuration', None)
150
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
151
+
152
+ self = super(OpenApiModel, cls).__new__(cls)
153
+
154
+ if args:
155
+ for arg in args:
156
+ if isinstance(arg, dict):
157
+ kwargs.update(arg)
158
+ else:
159
+ raise ApiTypeError(
160
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
161
+ args,
162
+ self.__class__.__name__,
163
+ ),
164
+ path_to_item=_path_to_item,
165
+ valid_classes=(self.__class__,),
166
+ )
167
+
168
+ self._data_store = {}
169
+ self._check_type = _check_type
170
+ self._spec_property_naming = _spec_property_naming
171
+ self._path_to_item = _path_to_item
172
+ self._configuration = _configuration
173
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
174
+
175
+ for var_name, var_value in kwargs.items():
176
+ if var_name not in self.attribute_map and \
177
+ self._configuration is not None and \
178
+ self._configuration.discard_unknown_keys and \
179
+ self.additional_properties_type is None:
180
+ # discard variable.
181
+ continue
182
+ setattr(self, var_name, var_value)
183
+ return self
184
+
185
+ required_properties = set([
186
+ '_data_store',
187
+ '_check_type',
188
+ '_spec_property_naming',
189
+ '_path_to_item',
190
+ '_configuration',
191
+ '_visited_composed_classes',
192
+ ])
193
+
194
+ @convert_js_args_to_python_args
195
+ def __init__(self, *args, **kwargs): # noqa: E501
196
+ """GrantConsentInput - a model defined in OpenAPI
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
+ data (GrantConsentModelValueResource): [optional] # noqa: E501
230
+ """
231
+
232
+ _check_type = kwargs.pop('_check_type', True)
233
+ _spec_property_naming = kwargs.pop('_spec_property_naming', False)
234
+ _path_to_item = kwargs.pop('_path_to_item', ())
235
+ _configuration = kwargs.pop('_configuration', None)
236
+ _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
237
+
238
+ if args:
239
+ for arg in args:
240
+ if isinstance(arg, dict):
241
+ kwargs.update(arg)
242
+ else:
243
+ raise ApiTypeError(
244
+ "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
245
+ args,
246
+ self.__class__.__name__,
247
+ ),
248
+ path_to_item=_path_to_item,
249
+ valid_classes=(self.__class__,),
250
+ )
251
+
252
+ self._data_store = {}
253
+ self._check_type = _check_type
254
+ self._spec_property_naming = _spec_property_naming
255
+ self._path_to_item = _path_to_item
256
+ self._configuration = _configuration
257
+ self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
258
+
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.")