smallestai 2.1.0__py3-none-any.whl → 3.0.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.
Potentially problematic release.
This version of smallestai might be problematic. Click here for more details.
- smallestai/__init__.py +95 -0
- smallestai/atoms/__init__.py +182 -0
- smallestai/atoms/api/__init__.py +12 -0
- smallestai/atoms/api/agent_templates_api.py +573 -0
- smallestai/atoms/api/agents_api.py +1465 -0
- smallestai/atoms/api/calls_api.py +320 -0
- smallestai/atoms/api/campaigns_api.py +1689 -0
- smallestai/atoms/api/knowledge_base_api.py +2271 -0
- smallestai/atoms/api/logs_api.py +305 -0
- smallestai/atoms/api/organization_api.py +285 -0
- smallestai/atoms/api/user_api.py +285 -0
- smallestai/atoms/api_client.py +797 -0
- smallestai/atoms/api_response.py +21 -0
- smallestai/atoms/atoms_client.py +560 -0
- smallestai/atoms/configuration.py +582 -0
- smallestai/atoms/exceptions.py +216 -0
- smallestai/atoms/models/__init__.py +72 -0
- smallestai/atoms/models/agent_dto.py +130 -0
- smallestai/atoms/models/agent_dto_language.py +91 -0
- smallestai/atoms/models/agent_dto_synthesizer.py +99 -0
- smallestai/atoms/models/agent_dto_synthesizer_voice_config.py +111 -0
- smallestai/atoms/models/api_response.py +89 -0
- smallestai/atoms/models/bad_request_error_response.py +89 -0
- smallestai/atoms/models/create_agent_from_template200_response.py +89 -0
- smallestai/atoms/models/create_agent_from_template_request.py +91 -0
- smallestai/atoms/models/create_agent_request.py +113 -0
- smallestai/atoms/models/create_agent_request_language.py +124 -0
- smallestai/atoms/models/create_agent_request_language_synthesizer.py +110 -0
- smallestai/atoms/models/create_agent_request_language_synthesizer_voice_config.py +137 -0
- smallestai/atoms/models/create_campaign200_response.py +93 -0
- smallestai/atoms/models/create_campaign200_response_data.py +106 -0
- smallestai/atoms/models/create_campaign200_response_inner.py +106 -0
- smallestai/atoms/models/create_campaign201_response.py +93 -0
- smallestai/atoms/models/create_campaign201_response_data.py +104 -0
- smallestai/atoms/models/create_campaign_request.py +93 -0
- smallestai/atoms/models/create_knowledge_base201_response.py +89 -0
- smallestai/atoms/models/create_knowledge_base_request.py +89 -0
- smallestai/atoms/models/delete_agent200_response.py +87 -0
- smallestai/atoms/models/get_agent_by_id200_response.py +93 -0
- smallestai/atoms/models/get_agent_templates200_response.py +97 -0
- smallestai/atoms/models/get_agent_templates200_response_data_inner.py +97 -0
- smallestai/atoms/models/get_agents200_response.py +93 -0
- smallestai/atoms/models/get_agents200_response_data.py +101 -0
- smallestai/atoms/models/get_campaign_by_id200_response.py +93 -0
- smallestai/atoms/models/get_campaign_by_id200_response_data.py +114 -0
- smallestai/atoms/models/get_campaigns200_response.py +97 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner.py +118 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner_agent.py +89 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner_audience.py +89 -0
- smallestai/atoms/models/get_campaigns_request.py +89 -0
- smallestai/atoms/models/get_conversation200_response.py +93 -0
- smallestai/atoms/models/get_conversation200_response_data.py +125 -0
- smallestai/atoms/models/get_conversation_logs200_response.py +93 -0
- smallestai/atoms/models/get_conversation_logs200_response_data.py +125 -0
- smallestai/atoms/models/get_current_user200_response.py +93 -0
- smallestai/atoms/models/get_current_user200_response_data.py +99 -0
- smallestai/atoms/models/get_knowledge_base_by_id200_response.py +93 -0
- smallestai/atoms/models/get_knowledge_base_items200_response.py +97 -0
- smallestai/atoms/models/get_knowledge_bases200_response.py +97 -0
- smallestai/atoms/models/get_organization200_response.py +93 -0
- smallestai/atoms/models/get_organization200_response_data.py +105 -0
- smallestai/atoms/models/get_organization200_response_data_members_inner.py +89 -0
- smallestai/atoms/models/get_organization200_response_data_subscription.py +87 -0
- smallestai/atoms/models/internal_server_error_response.py +89 -0
- smallestai/atoms/models/knowledge_base_dto.py +93 -0
- smallestai/atoms/models/knowledge_base_item_dto.py +124 -0
- smallestai/atoms/models/start_outbound_call200_response.py +93 -0
- smallestai/atoms/models/start_outbound_call200_response_data.py +87 -0
- smallestai/atoms/models/start_outbound_call_request.py +89 -0
- smallestai/atoms/models/unauthorized_error_reponse.py +89 -0
- smallestai/atoms/models/update_agent200_response.py +89 -0
- smallestai/atoms/models/update_agent_request.py +119 -0
- smallestai/atoms/models/update_agent_request_language.py +99 -0
- smallestai/atoms/models/update_agent_request_synthesizer.py +110 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config.py +137 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py +111 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py +99 -0
- smallestai/atoms/models/upload_text_to_knowledge_base_request.py +89 -0
- smallestai/atoms/py.typed +0 -0
- smallestai/atoms/rest.py +258 -0
- smallestai/waves/__init__.py +5 -0
- smallest/async_tts.py → smallestai/waves/async_waves_client.py +60 -47
- smallestai/waves/stream_tts.py +272 -0
- {smallest → smallestai/waves}/utils.py +8 -8
- smallest/tts.py → smallestai/waves/waves_client.py +58 -46
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/METADATA +194 -43
- smallestai-3.0.0.dist-info/RECORD +92 -0
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/WHEEL +1 -1
- smallestai-3.0.0.dist-info/top_level.txt +1 -0
- smallest/__init__.py +0 -5
- smallest/stream_tts.py +0 -161
- smallestai-2.1.0.dist-info/RECORD +0 -12
- smallestai-2.1.0.dist-info/top_level.txt +0 -1
- {smallest → smallestai/waves}/exceptions.py +0 -0
- {smallest → smallestai/waves}/models.py +0 -0
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,1689 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Agent Management API
|
|
5
|
+
|
|
6
|
+
API for managing agents, their templates, and call logs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictStr
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from smallestai.atoms.models.create_campaign201_response import CreateCampaign201Response
|
|
22
|
+
from smallestai.atoms.models.create_campaign_request import CreateCampaignRequest
|
|
23
|
+
from smallestai.atoms.models.delete_agent200_response import DeleteAgent200Response
|
|
24
|
+
from smallestai.atoms.models.get_campaign_by_id200_response import GetCampaignById200Response
|
|
25
|
+
from smallestai.atoms.models.get_campaigns200_response import GetCampaigns200Response
|
|
26
|
+
from smallestai.atoms.models.get_campaigns_request import GetCampaignsRequest
|
|
27
|
+
|
|
28
|
+
from smallestai.atoms.api_client import ApiClient, RequestSerialized
|
|
29
|
+
from smallestai.atoms.api_response import ApiResponse
|
|
30
|
+
from smallestai.atoms.rest import RESTResponseType
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class CampaignsApi:
|
|
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
|
+
|
|
40
|
+
def __init__(self, api_client=None) -> None:
|
|
41
|
+
if api_client is None:
|
|
42
|
+
api_client = ApiClient.get_default()
|
|
43
|
+
self.api_client = api_client
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@validate_call
|
|
47
|
+
def create_campaign(
|
|
48
|
+
self,
|
|
49
|
+
create_campaign_request: CreateCampaignRequest,
|
|
50
|
+
_request_timeout: Union[
|
|
51
|
+
None,
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
53
|
+
Tuple[
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
55
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
56
|
+
]
|
|
57
|
+
] = None,
|
|
58
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
59
|
+
_content_type: Optional[StrictStr] = None,
|
|
60
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
61
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
62
|
+
) -> CreateCampaign201Response:
|
|
63
|
+
"""Create a campaign
|
|
64
|
+
|
|
65
|
+
Create a campaign
|
|
66
|
+
|
|
67
|
+
:param create_campaign_request: (required)
|
|
68
|
+
:type create_campaign_request: CreateCampaignRequest
|
|
69
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
70
|
+
number provided, it will be total request
|
|
71
|
+
timeout. It can also be a pair (tuple) of
|
|
72
|
+
(connection, read) timeouts.
|
|
73
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
74
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
75
|
+
request; this effectively ignores the
|
|
76
|
+
authentication in the spec for a single request.
|
|
77
|
+
:type _request_auth: dict, optional
|
|
78
|
+
:param _content_type: force content-type for the request.
|
|
79
|
+
:type _content_type: str, Optional
|
|
80
|
+
:param _headers: set to override the headers for a single
|
|
81
|
+
request; this effectively ignores the headers
|
|
82
|
+
in the spec for a single request.
|
|
83
|
+
:type _headers: dict, optional
|
|
84
|
+
:param _host_index: set to override the host_index for a single
|
|
85
|
+
request; this effectively ignores the host_index
|
|
86
|
+
in the spec for a single request.
|
|
87
|
+
:type _host_index: int, optional
|
|
88
|
+
:return: Returns the result object.
|
|
89
|
+
""" # noqa: E501
|
|
90
|
+
|
|
91
|
+
_param = self._create_campaign_serialize(
|
|
92
|
+
create_campaign_request=create_campaign_request,
|
|
93
|
+
_request_auth=_request_auth,
|
|
94
|
+
_content_type=_content_type,
|
|
95
|
+
_headers=_headers,
|
|
96
|
+
_host_index=_host_index
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
100
|
+
'201': "CreateCampaign201Response",
|
|
101
|
+
'400': "BadRequestErrorResponse",
|
|
102
|
+
'401': "UnauthorizedErrorReponse",
|
|
103
|
+
'500': "InternalServerErrorResponse",
|
|
104
|
+
}
|
|
105
|
+
response_data = self.api_client.call_api(
|
|
106
|
+
*_param,
|
|
107
|
+
_request_timeout=_request_timeout
|
|
108
|
+
)
|
|
109
|
+
response_data.read()
|
|
110
|
+
return self.api_client.response_deserialize(
|
|
111
|
+
response_data=response_data,
|
|
112
|
+
response_types_map=_response_types_map,
|
|
113
|
+
).data
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
@validate_call
|
|
117
|
+
def create_campaign_with_http_info(
|
|
118
|
+
self,
|
|
119
|
+
create_campaign_request: CreateCampaignRequest,
|
|
120
|
+
_request_timeout: Union[
|
|
121
|
+
None,
|
|
122
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
123
|
+
Tuple[
|
|
124
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
125
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
126
|
+
]
|
|
127
|
+
] = None,
|
|
128
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
129
|
+
_content_type: Optional[StrictStr] = None,
|
|
130
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
131
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
132
|
+
) -> ApiResponse[CreateCampaign201Response]:
|
|
133
|
+
"""Create a campaign
|
|
134
|
+
|
|
135
|
+
Create a campaign
|
|
136
|
+
|
|
137
|
+
:param create_campaign_request: (required)
|
|
138
|
+
:type create_campaign_request: CreateCampaignRequest
|
|
139
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
140
|
+
number provided, it will be total request
|
|
141
|
+
timeout. It can also be a pair (tuple) of
|
|
142
|
+
(connection, read) timeouts.
|
|
143
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
144
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
145
|
+
request; this effectively ignores the
|
|
146
|
+
authentication in the spec for a single request.
|
|
147
|
+
:type _request_auth: dict, optional
|
|
148
|
+
:param _content_type: force content-type for the request.
|
|
149
|
+
:type _content_type: str, Optional
|
|
150
|
+
:param _headers: set to override the headers for a single
|
|
151
|
+
request; this effectively ignores the headers
|
|
152
|
+
in the spec for a single request.
|
|
153
|
+
:type _headers: dict, optional
|
|
154
|
+
:param _host_index: set to override the host_index for a single
|
|
155
|
+
request; this effectively ignores the host_index
|
|
156
|
+
in the spec for a single request.
|
|
157
|
+
:type _host_index: int, optional
|
|
158
|
+
:return: Returns the result object.
|
|
159
|
+
""" # noqa: E501
|
|
160
|
+
|
|
161
|
+
_param = self._create_campaign_serialize(
|
|
162
|
+
create_campaign_request=create_campaign_request,
|
|
163
|
+
_request_auth=_request_auth,
|
|
164
|
+
_content_type=_content_type,
|
|
165
|
+
_headers=_headers,
|
|
166
|
+
_host_index=_host_index
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
170
|
+
'201': "CreateCampaign201Response",
|
|
171
|
+
'400': "BadRequestErrorResponse",
|
|
172
|
+
'401': "UnauthorizedErrorReponse",
|
|
173
|
+
'500': "InternalServerErrorResponse",
|
|
174
|
+
}
|
|
175
|
+
response_data = self.api_client.call_api(
|
|
176
|
+
*_param,
|
|
177
|
+
_request_timeout=_request_timeout
|
|
178
|
+
)
|
|
179
|
+
response_data.read()
|
|
180
|
+
return self.api_client.response_deserialize(
|
|
181
|
+
response_data=response_data,
|
|
182
|
+
response_types_map=_response_types_map,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
@validate_call
|
|
187
|
+
def create_campaign_without_preload_content(
|
|
188
|
+
self,
|
|
189
|
+
create_campaign_request: CreateCampaignRequest,
|
|
190
|
+
_request_timeout: Union[
|
|
191
|
+
None,
|
|
192
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
193
|
+
Tuple[
|
|
194
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
195
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
196
|
+
]
|
|
197
|
+
] = None,
|
|
198
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
199
|
+
_content_type: Optional[StrictStr] = None,
|
|
200
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
201
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
202
|
+
) -> RESTResponseType:
|
|
203
|
+
"""Create a campaign
|
|
204
|
+
|
|
205
|
+
Create a campaign
|
|
206
|
+
|
|
207
|
+
:param create_campaign_request: (required)
|
|
208
|
+
:type create_campaign_request: CreateCampaignRequest
|
|
209
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
210
|
+
number provided, it will be total request
|
|
211
|
+
timeout. It can also be a pair (tuple) of
|
|
212
|
+
(connection, read) timeouts.
|
|
213
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
214
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
215
|
+
request; this effectively ignores the
|
|
216
|
+
authentication in the spec for a single request.
|
|
217
|
+
:type _request_auth: dict, optional
|
|
218
|
+
:param _content_type: force content-type for the request.
|
|
219
|
+
:type _content_type: str, Optional
|
|
220
|
+
:param _headers: set to override the headers for a single
|
|
221
|
+
request; this effectively ignores the headers
|
|
222
|
+
in the spec for a single request.
|
|
223
|
+
:type _headers: dict, optional
|
|
224
|
+
:param _host_index: set to override the host_index for a single
|
|
225
|
+
request; this effectively ignores the host_index
|
|
226
|
+
in the spec for a single request.
|
|
227
|
+
:type _host_index: int, optional
|
|
228
|
+
:return: Returns the result object.
|
|
229
|
+
""" # noqa: E501
|
|
230
|
+
|
|
231
|
+
_param = self._create_campaign_serialize(
|
|
232
|
+
create_campaign_request=create_campaign_request,
|
|
233
|
+
_request_auth=_request_auth,
|
|
234
|
+
_content_type=_content_type,
|
|
235
|
+
_headers=_headers,
|
|
236
|
+
_host_index=_host_index
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
240
|
+
'201': "CreateCampaign201Response",
|
|
241
|
+
'400': "BadRequestErrorResponse",
|
|
242
|
+
'401': "UnauthorizedErrorReponse",
|
|
243
|
+
'500': "InternalServerErrorResponse",
|
|
244
|
+
}
|
|
245
|
+
response_data = self.api_client.call_api(
|
|
246
|
+
*_param,
|
|
247
|
+
_request_timeout=_request_timeout
|
|
248
|
+
)
|
|
249
|
+
return response_data.response
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def _create_campaign_serialize(
|
|
253
|
+
self,
|
|
254
|
+
create_campaign_request,
|
|
255
|
+
_request_auth,
|
|
256
|
+
_content_type,
|
|
257
|
+
_headers,
|
|
258
|
+
_host_index,
|
|
259
|
+
) -> RequestSerialized:
|
|
260
|
+
|
|
261
|
+
_host = None
|
|
262
|
+
|
|
263
|
+
_collection_formats: Dict[str, str] = {
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
_path_params: Dict[str, str] = {}
|
|
267
|
+
_query_params: List[Tuple[str, str]] = []
|
|
268
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
269
|
+
_form_params: List[Tuple[str, str]] = []
|
|
270
|
+
_files: Dict[
|
|
271
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
272
|
+
] = {}
|
|
273
|
+
_body_params: Optional[bytes] = None
|
|
274
|
+
|
|
275
|
+
# process the path parameters
|
|
276
|
+
# process the query parameters
|
|
277
|
+
# process the header parameters
|
|
278
|
+
# process the form parameters
|
|
279
|
+
# process the body parameter
|
|
280
|
+
if create_campaign_request is not None:
|
|
281
|
+
_body_params = create_campaign_request
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
# set the HTTP header `Accept`
|
|
285
|
+
if 'Accept' not in _header_params:
|
|
286
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
287
|
+
[
|
|
288
|
+
'application/json'
|
|
289
|
+
]
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
# set the HTTP header `Content-Type`
|
|
293
|
+
if _content_type:
|
|
294
|
+
_header_params['Content-Type'] = _content_type
|
|
295
|
+
else:
|
|
296
|
+
_default_content_type = (
|
|
297
|
+
self.api_client.select_header_content_type(
|
|
298
|
+
[
|
|
299
|
+
'application/json'
|
|
300
|
+
]
|
|
301
|
+
)
|
|
302
|
+
)
|
|
303
|
+
if _default_content_type is not None:
|
|
304
|
+
_header_params['Content-Type'] = _default_content_type
|
|
305
|
+
|
|
306
|
+
# authentication setting
|
|
307
|
+
_auth_settings: List[str] = [
|
|
308
|
+
'BearerAuth'
|
|
309
|
+
]
|
|
310
|
+
|
|
311
|
+
return self.api_client.param_serialize(
|
|
312
|
+
method='POST',
|
|
313
|
+
resource_path='/campaign',
|
|
314
|
+
path_params=_path_params,
|
|
315
|
+
query_params=_query_params,
|
|
316
|
+
header_params=_header_params,
|
|
317
|
+
body=_body_params,
|
|
318
|
+
post_params=_form_params,
|
|
319
|
+
files=_files,
|
|
320
|
+
auth_settings=_auth_settings,
|
|
321
|
+
collection_formats=_collection_formats,
|
|
322
|
+
_host=_host,
|
|
323
|
+
_request_auth=_request_auth
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
@validate_call
|
|
330
|
+
def delete_campaign(
|
|
331
|
+
self,
|
|
332
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
333
|
+
_request_timeout: Union[
|
|
334
|
+
None,
|
|
335
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
336
|
+
Tuple[
|
|
337
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
338
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
339
|
+
]
|
|
340
|
+
] = None,
|
|
341
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
342
|
+
_content_type: Optional[StrictStr] = None,
|
|
343
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
344
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
345
|
+
) -> DeleteAgent200Response:
|
|
346
|
+
"""Delete a campaign
|
|
347
|
+
|
|
348
|
+
Delete a campaign
|
|
349
|
+
|
|
350
|
+
:param id: The ID of the campaign (required)
|
|
351
|
+
:type id: str
|
|
352
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
353
|
+
number provided, it will be total request
|
|
354
|
+
timeout. It can also be a pair (tuple) of
|
|
355
|
+
(connection, read) timeouts.
|
|
356
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
357
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
358
|
+
request; this effectively ignores the
|
|
359
|
+
authentication in the spec for a single request.
|
|
360
|
+
:type _request_auth: dict, optional
|
|
361
|
+
:param _content_type: force content-type for the request.
|
|
362
|
+
:type _content_type: str, Optional
|
|
363
|
+
:param _headers: set to override the headers for a single
|
|
364
|
+
request; this effectively ignores the headers
|
|
365
|
+
in the spec for a single request.
|
|
366
|
+
:type _headers: dict, optional
|
|
367
|
+
:param _host_index: set to override the host_index for a single
|
|
368
|
+
request; this effectively ignores the host_index
|
|
369
|
+
in the spec for a single request.
|
|
370
|
+
:type _host_index: int, optional
|
|
371
|
+
:return: Returns the result object.
|
|
372
|
+
""" # noqa: E501
|
|
373
|
+
|
|
374
|
+
_param = self._delete_campaign_serialize(
|
|
375
|
+
id=id,
|
|
376
|
+
_request_auth=_request_auth,
|
|
377
|
+
_content_type=_content_type,
|
|
378
|
+
_headers=_headers,
|
|
379
|
+
_host_index=_host_index
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
383
|
+
'200': "DeleteAgent200Response",
|
|
384
|
+
'400': "BadRequestErrorResponse",
|
|
385
|
+
'401': "UnauthorizedErrorReponse",
|
|
386
|
+
'500': "InternalServerErrorResponse",
|
|
387
|
+
}
|
|
388
|
+
response_data = self.api_client.call_api(
|
|
389
|
+
*_param,
|
|
390
|
+
_request_timeout=_request_timeout
|
|
391
|
+
)
|
|
392
|
+
response_data.read()
|
|
393
|
+
return self.api_client.response_deserialize(
|
|
394
|
+
response_data=response_data,
|
|
395
|
+
response_types_map=_response_types_map,
|
|
396
|
+
).data
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
@validate_call
|
|
400
|
+
def delete_campaign_with_http_info(
|
|
401
|
+
self,
|
|
402
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
403
|
+
_request_timeout: Union[
|
|
404
|
+
None,
|
|
405
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
406
|
+
Tuple[
|
|
407
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
408
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
409
|
+
]
|
|
410
|
+
] = None,
|
|
411
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
412
|
+
_content_type: Optional[StrictStr] = None,
|
|
413
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
414
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
415
|
+
) -> ApiResponse[DeleteAgent200Response]:
|
|
416
|
+
"""Delete a campaign
|
|
417
|
+
|
|
418
|
+
Delete a campaign
|
|
419
|
+
|
|
420
|
+
:param id: The ID of the campaign (required)
|
|
421
|
+
:type id: str
|
|
422
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
423
|
+
number provided, it will be total request
|
|
424
|
+
timeout. It can also be a pair (tuple) of
|
|
425
|
+
(connection, read) timeouts.
|
|
426
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
427
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
428
|
+
request; this effectively ignores the
|
|
429
|
+
authentication in the spec for a single request.
|
|
430
|
+
:type _request_auth: dict, optional
|
|
431
|
+
:param _content_type: force content-type for the request.
|
|
432
|
+
:type _content_type: str, Optional
|
|
433
|
+
:param _headers: set to override the headers for a single
|
|
434
|
+
request; this effectively ignores the headers
|
|
435
|
+
in the spec for a single request.
|
|
436
|
+
:type _headers: dict, optional
|
|
437
|
+
:param _host_index: set to override the host_index for a single
|
|
438
|
+
request; this effectively ignores the host_index
|
|
439
|
+
in the spec for a single request.
|
|
440
|
+
:type _host_index: int, optional
|
|
441
|
+
:return: Returns the result object.
|
|
442
|
+
""" # noqa: E501
|
|
443
|
+
|
|
444
|
+
_param = self._delete_campaign_serialize(
|
|
445
|
+
id=id,
|
|
446
|
+
_request_auth=_request_auth,
|
|
447
|
+
_content_type=_content_type,
|
|
448
|
+
_headers=_headers,
|
|
449
|
+
_host_index=_host_index
|
|
450
|
+
)
|
|
451
|
+
|
|
452
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
453
|
+
'200': "DeleteAgent200Response",
|
|
454
|
+
'400': "BadRequestErrorResponse",
|
|
455
|
+
'401': "UnauthorizedErrorReponse",
|
|
456
|
+
'500': "InternalServerErrorResponse",
|
|
457
|
+
}
|
|
458
|
+
response_data = self.api_client.call_api(
|
|
459
|
+
*_param,
|
|
460
|
+
_request_timeout=_request_timeout
|
|
461
|
+
)
|
|
462
|
+
response_data.read()
|
|
463
|
+
return self.api_client.response_deserialize(
|
|
464
|
+
response_data=response_data,
|
|
465
|
+
response_types_map=_response_types_map,
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
@validate_call
|
|
470
|
+
def delete_campaign_without_preload_content(
|
|
471
|
+
self,
|
|
472
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
473
|
+
_request_timeout: Union[
|
|
474
|
+
None,
|
|
475
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
476
|
+
Tuple[
|
|
477
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
478
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
479
|
+
]
|
|
480
|
+
] = None,
|
|
481
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
482
|
+
_content_type: Optional[StrictStr] = None,
|
|
483
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
484
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
485
|
+
) -> RESTResponseType:
|
|
486
|
+
"""Delete a campaign
|
|
487
|
+
|
|
488
|
+
Delete a campaign
|
|
489
|
+
|
|
490
|
+
:param id: The ID of the campaign (required)
|
|
491
|
+
:type id: str
|
|
492
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
493
|
+
number provided, it will be total request
|
|
494
|
+
timeout. It can also be a pair (tuple) of
|
|
495
|
+
(connection, read) timeouts.
|
|
496
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
497
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
498
|
+
request; this effectively ignores the
|
|
499
|
+
authentication in the spec for a single request.
|
|
500
|
+
:type _request_auth: dict, optional
|
|
501
|
+
:param _content_type: force content-type for the request.
|
|
502
|
+
:type _content_type: str, Optional
|
|
503
|
+
:param _headers: set to override the headers for a single
|
|
504
|
+
request; this effectively ignores the headers
|
|
505
|
+
in the spec for a single request.
|
|
506
|
+
:type _headers: dict, optional
|
|
507
|
+
:param _host_index: set to override the host_index for a single
|
|
508
|
+
request; this effectively ignores the host_index
|
|
509
|
+
in the spec for a single request.
|
|
510
|
+
:type _host_index: int, optional
|
|
511
|
+
:return: Returns the result object.
|
|
512
|
+
""" # noqa: E501
|
|
513
|
+
|
|
514
|
+
_param = self._delete_campaign_serialize(
|
|
515
|
+
id=id,
|
|
516
|
+
_request_auth=_request_auth,
|
|
517
|
+
_content_type=_content_type,
|
|
518
|
+
_headers=_headers,
|
|
519
|
+
_host_index=_host_index
|
|
520
|
+
)
|
|
521
|
+
|
|
522
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
523
|
+
'200': "DeleteAgent200Response",
|
|
524
|
+
'400': "BadRequestErrorResponse",
|
|
525
|
+
'401': "UnauthorizedErrorReponse",
|
|
526
|
+
'500': "InternalServerErrorResponse",
|
|
527
|
+
}
|
|
528
|
+
response_data = self.api_client.call_api(
|
|
529
|
+
*_param,
|
|
530
|
+
_request_timeout=_request_timeout
|
|
531
|
+
)
|
|
532
|
+
return response_data.response
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
def _delete_campaign_serialize(
|
|
536
|
+
self,
|
|
537
|
+
id,
|
|
538
|
+
_request_auth,
|
|
539
|
+
_content_type,
|
|
540
|
+
_headers,
|
|
541
|
+
_host_index,
|
|
542
|
+
) -> RequestSerialized:
|
|
543
|
+
|
|
544
|
+
_host = None
|
|
545
|
+
|
|
546
|
+
_collection_formats: Dict[str, str] = {
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
_path_params: Dict[str, str] = {}
|
|
550
|
+
_query_params: List[Tuple[str, str]] = []
|
|
551
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
552
|
+
_form_params: List[Tuple[str, str]] = []
|
|
553
|
+
_files: Dict[
|
|
554
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
555
|
+
] = {}
|
|
556
|
+
_body_params: Optional[bytes] = None
|
|
557
|
+
|
|
558
|
+
# process the path parameters
|
|
559
|
+
if id is not None:
|
|
560
|
+
_path_params['id'] = id
|
|
561
|
+
# process the query parameters
|
|
562
|
+
# process the header parameters
|
|
563
|
+
# process the form parameters
|
|
564
|
+
# process the body parameter
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
# set the HTTP header `Accept`
|
|
568
|
+
if 'Accept' not in _header_params:
|
|
569
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
570
|
+
[
|
|
571
|
+
'application/json'
|
|
572
|
+
]
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
# authentication setting
|
|
577
|
+
_auth_settings: List[str] = [
|
|
578
|
+
'BearerAuth'
|
|
579
|
+
]
|
|
580
|
+
|
|
581
|
+
return self.api_client.param_serialize(
|
|
582
|
+
method='DELETE',
|
|
583
|
+
resource_path='/campaign/{id}',
|
|
584
|
+
path_params=_path_params,
|
|
585
|
+
query_params=_query_params,
|
|
586
|
+
header_params=_header_params,
|
|
587
|
+
body=_body_params,
|
|
588
|
+
post_params=_form_params,
|
|
589
|
+
files=_files,
|
|
590
|
+
auth_settings=_auth_settings,
|
|
591
|
+
collection_formats=_collection_formats,
|
|
592
|
+
_host=_host,
|
|
593
|
+
_request_auth=_request_auth
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
@validate_call
|
|
600
|
+
def get_campaign_by_id(
|
|
601
|
+
self,
|
|
602
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
603
|
+
_request_timeout: Union[
|
|
604
|
+
None,
|
|
605
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
606
|
+
Tuple[
|
|
607
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
608
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
609
|
+
]
|
|
610
|
+
] = None,
|
|
611
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
612
|
+
_content_type: Optional[StrictStr] = None,
|
|
613
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
614
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
615
|
+
) -> GetCampaignById200Response:
|
|
616
|
+
"""Get a campaign
|
|
617
|
+
|
|
618
|
+
Get a campaign
|
|
619
|
+
|
|
620
|
+
:param id: The ID of the campaign (required)
|
|
621
|
+
:type id: str
|
|
622
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
623
|
+
number provided, it will be total request
|
|
624
|
+
timeout. It can also be a pair (tuple) of
|
|
625
|
+
(connection, read) timeouts.
|
|
626
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
627
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
628
|
+
request; this effectively ignores the
|
|
629
|
+
authentication in the spec for a single request.
|
|
630
|
+
:type _request_auth: dict, optional
|
|
631
|
+
:param _content_type: force content-type for the request.
|
|
632
|
+
:type _content_type: str, Optional
|
|
633
|
+
:param _headers: set to override the headers for a single
|
|
634
|
+
request; this effectively ignores the headers
|
|
635
|
+
in the spec for a single request.
|
|
636
|
+
:type _headers: dict, optional
|
|
637
|
+
:param _host_index: set to override the host_index for a single
|
|
638
|
+
request; this effectively ignores the host_index
|
|
639
|
+
in the spec for a single request.
|
|
640
|
+
:type _host_index: int, optional
|
|
641
|
+
:return: Returns the result object.
|
|
642
|
+
""" # noqa: E501
|
|
643
|
+
|
|
644
|
+
_param = self._get_campaign_by_id_serialize(
|
|
645
|
+
id=id,
|
|
646
|
+
_request_auth=_request_auth,
|
|
647
|
+
_content_type=_content_type,
|
|
648
|
+
_headers=_headers,
|
|
649
|
+
_host_index=_host_index
|
|
650
|
+
)
|
|
651
|
+
|
|
652
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
653
|
+
'200': "GetCampaignById200Response",
|
|
654
|
+
'400': "BadRequestErrorResponse",
|
|
655
|
+
'401': "UnauthorizedErrorReponse",
|
|
656
|
+
'500': "InternalServerErrorResponse",
|
|
657
|
+
}
|
|
658
|
+
response_data = self.api_client.call_api(
|
|
659
|
+
*_param,
|
|
660
|
+
_request_timeout=_request_timeout
|
|
661
|
+
)
|
|
662
|
+
response_data.read()
|
|
663
|
+
return self.api_client.response_deserialize(
|
|
664
|
+
response_data=response_data,
|
|
665
|
+
response_types_map=_response_types_map,
|
|
666
|
+
).data
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
@validate_call
|
|
670
|
+
def get_campaign_by_id_with_http_info(
|
|
671
|
+
self,
|
|
672
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
673
|
+
_request_timeout: Union[
|
|
674
|
+
None,
|
|
675
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
676
|
+
Tuple[
|
|
677
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
678
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
679
|
+
]
|
|
680
|
+
] = None,
|
|
681
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
682
|
+
_content_type: Optional[StrictStr] = None,
|
|
683
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
684
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
685
|
+
) -> ApiResponse[GetCampaignById200Response]:
|
|
686
|
+
"""Get a campaign
|
|
687
|
+
|
|
688
|
+
Get a campaign
|
|
689
|
+
|
|
690
|
+
:param id: The ID of the campaign (required)
|
|
691
|
+
:type id: str
|
|
692
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
693
|
+
number provided, it will be total request
|
|
694
|
+
timeout. It can also be a pair (tuple) of
|
|
695
|
+
(connection, read) timeouts.
|
|
696
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
697
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
698
|
+
request; this effectively ignores the
|
|
699
|
+
authentication in the spec for a single request.
|
|
700
|
+
:type _request_auth: dict, optional
|
|
701
|
+
:param _content_type: force content-type for the request.
|
|
702
|
+
:type _content_type: str, Optional
|
|
703
|
+
:param _headers: set to override the headers for a single
|
|
704
|
+
request; this effectively ignores the headers
|
|
705
|
+
in the spec for a single request.
|
|
706
|
+
:type _headers: dict, optional
|
|
707
|
+
:param _host_index: set to override the host_index for a single
|
|
708
|
+
request; this effectively ignores the host_index
|
|
709
|
+
in the spec for a single request.
|
|
710
|
+
:type _host_index: int, optional
|
|
711
|
+
:return: Returns the result object.
|
|
712
|
+
""" # noqa: E501
|
|
713
|
+
|
|
714
|
+
_param = self._get_campaign_by_id_serialize(
|
|
715
|
+
id=id,
|
|
716
|
+
_request_auth=_request_auth,
|
|
717
|
+
_content_type=_content_type,
|
|
718
|
+
_headers=_headers,
|
|
719
|
+
_host_index=_host_index
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
723
|
+
'200': "GetCampaignById200Response",
|
|
724
|
+
'400': "BadRequestErrorResponse",
|
|
725
|
+
'401': "UnauthorizedErrorReponse",
|
|
726
|
+
'500': "InternalServerErrorResponse",
|
|
727
|
+
}
|
|
728
|
+
response_data = self.api_client.call_api(
|
|
729
|
+
*_param,
|
|
730
|
+
_request_timeout=_request_timeout
|
|
731
|
+
)
|
|
732
|
+
response_data.read()
|
|
733
|
+
return self.api_client.response_deserialize(
|
|
734
|
+
response_data=response_data,
|
|
735
|
+
response_types_map=_response_types_map,
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
@validate_call
|
|
740
|
+
def get_campaign_by_id_without_preload_content(
|
|
741
|
+
self,
|
|
742
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
743
|
+
_request_timeout: Union[
|
|
744
|
+
None,
|
|
745
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
746
|
+
Tuple[
|
|
747
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
748
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
749
|
+
]
|
|
750
|
+
] = None,
|
|
751
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
752
|
+
_content_type: Optional[StrictStr] = None,
|
|
753
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
754
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
755
|
+
) -> RESTResponseType:
|
|
756
|
+
"""Get a campaign
|
|
757
|
+
|
|
758
|
+
Get a campaign
|
|
759
|
+
|
|
760
|
+
:param id: The ID of the campaign (required)
|
|
761
|
+
:type id: str
|
|
762
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
763
|
+
number provided, it will be total request
|
|
764
|
+
timeout. It can also be a pair (tuple) of
|
|
765
|
+
(connection, read) timeouts.
|
|
766
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
767
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
768
|
+
request; this effectively ignores the
|
|
769
|
+
authentication in the spec for a single request.
|
|
770
|
+
:type _request_auth: dict, optional
|
|
771
|
+
:param _content_type: force content-type for the request.
|
|
772
|
+
:type _content_type: str, Optional
|
|
773
|
+
:param _headers: set to override the headers for a single
|
|
774
|
+
request; this effectively ignores the headers
|
|
775
|
+
in the spec for a single request.
|
|
776
|
+
:type _headers: dict, optional
|
|
777
|
+
:param _host_index: set to override the host_index for a single
|
|
778
|
+
request; this effectively ignores the host_index
|
|
779
|
+
in the spec for a single request.
|
|
780
|
+
:type _host_index: int, optional
|
|
781
|
+
:return: Returns the result object.
|
|
782
|
+
""" # noqa: E501
|
|
783
|
+
|
|
784
|
+
_param = self._get_campaign_by_id_serialize(
|
|
785
|
+
id=id,
|
|
786
|
+
_request_auth=_request_auth,
|
|
787
|
+
_content_type=_content_type,
|
|
788
|
+
_headers=_headers,
|
|
789
|
+
_host_index=_host_index
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
793
|
+
'200': "GetCampaignById200Response",
|
|
794
|
+
'400': "BadRequestErrorResponse",
|
|
795
|
+
'401': "UnauthorizedErrorReponse",
|
|
796
|
+
'500': "InternalServerErrorResponse",
|
|
797
|
+
}
|
|
798
|
+
response_data = self.api_client.call_api(
|
|
799
|
+
*_param,
|
|
800
|
+
_request_timeout=_request_timeout
|
|
801
|
+
)
|
|
802
|
+
return response_data.response
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
def _get_campaign_by_id_serialize(
|
|
806
|
+
self,
|
|
807
|
+
id,
|
|
808
|
+
_request_auth,
|
|
809
|
+
_content_type,
|
|
810
|
+
_headers,
|
|
811
|
+
_host_index,
|
|
812
|
+
) -> RequestSerialized:
|
|
813
|
+
|
|
814
|
+
_host = None
|
|
815
|
+
|
|
816
|
+
_collection_formats: Dict[str, str] = {
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
_path_params: Dict[str, str] = {}
|
|
820
|
+
_query_params: List[Tuple[str, str]] = []
|
|
821
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
822
|
+
_form_params: List[Tuple[str, str]] = []
|
|
823
|
+
_files: Dict[
|
|
824
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
825
|
+
] = {}
|
|
826
|
+
_body_params: Optional[bytes] = None
|
|
827
|
+
|
|
828
|
+
# process the path parameters
|
|
829
|
+
if id is not None:
|
|
830
|
+
_path_params['id'] = id
|
|
831
|
+
# process the query parameters
|
|
832
|
+
# process the header parameters
|
|
833
|
+
# process the form parameters
|
|
834
|
+
# process the body parameter
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
# set the HTTP header `Accept`
|
|
838
|
+
if 'Accept' not in _header_params:
|
|
839
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
840
|
+
[
|
|
841
|
+
'application/json'
|
|
842
|
+
]
|
|
843
|
+
)
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
# authentication setting
|
|
847
|
+
_auth_settings: List[str] = [
|
|
848
|
+
'BearerAuth'
|
|
849
|
+
]
|
|
850
|
+
|
|
851
|
+
return self.api_client.param_serialize(
|
|
852
|
+
method='GET',
|
|
853
|
+
resource_path='/campaign/{id}',
|
|
854
|
+
path_params=_path_params,
|
|
855
|
+
query_params=_query_params,
|
|
856
|
+
header_params=_header_params,
|
|
857
|
+
body=_body_params,
|
|
858
|
+
post_params=_form_params,
|
|
859
|
+
files=_files,
|
|
860
|
+
auth_settings=_auth_settings,
|
|
861
|
+
collection_formats=_collection_formats,
|
|
862
|
+
_host=_host,
|
|
863
|
+
_request_auth=_request_auth
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
@validate_call
|
|
870
|
+
def get_campaigns(
|
|
871
|
+
self,
|
|
872
|
+
get_campaigns_request: GetCampaignsRequest,
|
|
873
|
+
_request_timeout: Union[
|
|
874
|
+
None,
|
|
875
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
876
|
+
Tuple[
|
|
877
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
878
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
879
|
+
]
|
|
880
|
+
] = None,
|
|
881
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
882
|
+
_content_type: Optional[StrictStr] = None,
|
|
883
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
884
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
885
|
+
) -> GetCampaigns200Response:
|
|
886
|
+
"""Retrieve all campaigns
|
|
887
|
+
|
|
888
|
+
Get all campaigns
|
|
889
|
+
|
|
890
|
+
:param get_campaigns_request: (required)
|
|
891
|
+
:type get_campaigns_request: GetCampaignsRequest
|
|
892
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
893
|
+
number provided, it will be total request
|
|
894
|
+
timeout. It can also be a pair (tuple) of
|
|
895
|
+
(connection, read) timeouts.
|
|
896
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
897
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
898
|
+
request; this effectively ignores the
|
|
899
|
+
authentication in the spec for a single request.
|
|
900
|
+
:type _request_auth: dict, optional
|
|
901
|
+
:param _content_type: force content-type for the request.
|
|
902
|
+
:type _content_type: str, Optional
|
|
903
|
+
:param _headers: set to override the headers for a single
|
|
904
|
+
request; this effectively ignores the headers
|
|
905
|
+
in the spec for a single request.
|
|
906
|
+
:type _headers: dict, optional
|
|
907
|
+
:param _host_index: set to override the host_index for a single
|
|
908
|
+
request; this effectively ignores the host_index
|
|
909
|
+
in the spec for a single request.
|
|
910
|
+
:type _host_index: int, optional
|
|
911
|
+
:return: Returns the result object.
|
|
912
|
+
""" # noqa: E501
|
|
913
|
+
|
|
914
|
+
_param = self._get_campaigns_serialize(
|
|
915
|
+
get_campaigns_request=get_campaigns_request,
|
|
916
|
+
_request_auth=_request_auth,
|
|
917
|
+
_content_type=_content_type,
|
|
918
|
+
_headers=_headers,
|
|
919
|
+
_host_index=_host_index
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
923
|
+
'200': "GetCampaigns200Response",
|
|
924
|
+
'400': "BadRequestErrorResponse",
|
|
925
|
+
'401': "UnauthorizedErrorReponse",
|
|
926
|
+
'500': "InternalServerErrorResponse",
|
|
927
|
+
}
|
|
928
|
+
response_data = self.api_client.call_api(
|
|
929
|
+
*_param,
|
|
930
|
+
_request_timeout=_request_timeout
|
|
931
|
+
)
|
|
932
|
+
response_data.read()
|
|
933
|
+
return self.api_client.response_deserialize(
|
|
934
|
+
response_data=response_data,
|
|
935
|
+
response_types_map=_response_types_map,
|
|
936
|
+
).data
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
@validate_call
|
|
940
|
+
def get_campaigns_with_http_info(
|
|
941
|
+
self,
|
|
942
|
+
get_campaigns_request: GetCampaignsRequest,
|
|
943
|
+
_request_timeout: Union[
|
|
944
|
+
None,
|
|
945
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
946
|
+
Tuple[
|
|
947
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
948
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
949
|
+
]
|
|
950
|
+
] = None,
|
|
951
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
952
|
+
_content_type: Optional[StrictStr] = None,
|
|
953
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
954
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
955
|
+
) -> ApiResponse[GetCampaigns200Response]:
|
|
956
|
+
"""Retrieve all campaigns
|
|
957
|
+
|
|
958
|
+
Get all campaigns
|
|
959
|
+
|
|
960
|
+
:param get_campaigns_request: (required)
|
|
961
|
+
:type get_campaigns_request: GetCampaignsRequest
|
|
962
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
963
|
+
number provided, it will be total request
|
|
964
|
+
timeout. It can also be a pair (tuple) of
|
|
965
|
+
(connection, read) timeouts.
|
|
966
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
967
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
968
|
+
request; this effectively ignores the
|
|
969
|
+
authentication in the spec for a single request.
|
|
970
|
+
:type _request_auth: dict, optional
|
|
971
|
+
:param _content_type: force content-type for the request.
|
|
972
|
+
:type _content_type: str, Optional
|
|
973
|
+
:param _headers: set to override the headers for a single
|
|
974
|
+
request; this effectively ignores the headers
|
|
975
|
+
in the spec for a single request.
|
|
976
|
+
:type _headers: dict, optional
|
|
977
|
+
:param _host_index: set to override the host_index for a single
|
|
978
|
+
request; this effectively ignores the host_index
|
|
979
|
+
in the spec for a single request.
|
|
980
|
+
:type _host_index: int, optional
|
|
981
|
+
:return: Returns the result object.
|
|
982
|
+
""" # noqa: E501
|
|
983
|
+
|
|
984
|
+
_param = self._get_campaigns_serialize(
|
|
985
|
+
get_campaigns_request=get_campaigns_request,
|
|
986
|
+
_request_auth=_request_auth,
|
|
987
|
+
_content_type=_content_type,
|
|
988
|
+
_headers=_headers,
|
|
989
|
+
_host_index=_host_index
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
993
|
+
'200': "GetCampaigns200Response",
|
|
994
|
+
'400': "BadRequestErrorResponse",
|
|
995
|
+
'401': "UnauthorizedErrorReponse",
|
|
996
|
+
'500': "InternalServerErrorResponse",
|
|
997
|
+
}
|
|
998
|
+
response_data = self.api_client.call_api(
|
|
999
|
+
*_param,
|
|
1000
|
+
_request_timeout=_request_timeout
|
|
1001
|
+
)
|
|
1002
|
+
response_data.read()
|
|
1003
|
+
return self.api_client.response_deserialize(
|
|
1004
|
+
response_data=response_data,
|
|
1005
|
+
response_types_map=_response_types_map,
|
|
1006
|
+
)
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
@validate_call
|
|
1010
|
+
def get_campaigns_without_preload_content(
|
|
1011
|
+
self,
|
|
1012
|
+
get_campaigns_request: GetCampaignsRequest,
|
|
1013
|
+
_request_timeout: Union[
|
|
1014
|
+
None,
|
|
1015
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1016
|
+
Tuple[
|
|
1017
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1018
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1019
|
+
]
|
|
1020
|
+
] = None,
|
|
1021
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1022
|
+
_content_type: Optional[StrictStr] = None,
|
|
1023
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1024
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1025
|
+
) -> RESTResponseType:
|
|
1026
|
+
"""Retrieve all campaigns
|
|
1027
|
+
|
|
1028
|
+
Get all campaigns
|
|
1029
|
+
|
|
1030
|
+
:param get_campaigns_request: (required)
|
|
1031
|
+
:type get_campaigns_request: GetCampaignsRequest
|
|
1032
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1033
|
+
number provided, it will be total request
|
|
1034
|
+
timeout. It can also be a pair (tuple) of
|
|
1035
|
+
(connection, read) timeouts.
|
|
1036
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1037
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1038
|
+
request; this effectively ignores the
|
|
1039
|
+
authentication in the spec for a single request.
|
|
1040
|
+
:type _request_auth: dict, optional
|
|
1041
|
+
:param _content_type: force content-type for the request.
|
|
1042
|
+
:type _content_type: str, Optional
|
|
1043
|
+
:param _headers: set to override the headers for a single
|
|
1044
|
+
request; this effectively ignores the headers
|
|
1045
|
+
in the spec for a single request.
|
|
1046
|
+
:type _headers: dict, optional
|
|
1047
|
+
:param _host_index: set to override the host_index for a single
|
|
1048
|
+
request; this effectively ignores the host_index
|
|
1049
|
+
in the spec for a single request.
|
|
1050
|
+
:type _host_index: int, optional
|
|
1051
|
+
:return: Returns the result object.
|
|
1052
|
+
""" # noqa: E501
|
|
1053
|
+
|
|
1054
|
+
_param = self._get_campaigns_serialize(
|
|
1055
|
+
get_campaigns_request=get_campaigns_request,
|
|
1056
|
+
_request_auth=_request_auth,
|
|
1057
|
+
_content_type=_content_type,
|
|
1058
|
+
_headers=_headers,
|
|
1059
|
+
_host_index=_host_index
|
|
1060
|
+
)
|
|
1061
|
+
|
|
1062
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1063
|
+
'200': "GetCampaigns200Response",
|
|
1064
|
+
'400': "BadRequestErrorResponse",
|
|
1065
|
+
'401': "UnauthorizedErrorReponse",
|
|
1066
|
+
'500': "InternalServerErrorResponse",
|
|
1067
|
+
}
|
|
1068
|
+
response_data = self.api_client.call_api(
|
|
1069
|
+
*_param,
|
|
1070
|
+
_request_timeout=_request_timeout
|
|
1071
|
+
)
|
|
1072
|
+
return response_data.response
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
def _get_campaigns_serialize(
|
|
1076
|
+
self,
|
|
1077
|
+
get_campaigns_request,
|
|
1078
|
+
_request_auth,
|
|
1079
|
+
_content_type,
|
|
1080
|
+
_headers,
|
|
1081
|
+
_host_index,
|
|
1082
|
+
) -> RequestSerialized:
|
|
1083
|
+
|
|
1084
|
+
_host = None
|
|
1085
|
+
|
|
1086
|
+
_collection_formats: Dict[str, str] = {
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
_path_params: Dict[str, str] = {}
|
|
1090
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1091
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1092
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1093
|
+
_files: Dict[
|
|
1094
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1095
|
+
] = {}
|
|
1096
|
+
_body_params: Optional[bytes] = None
|
|
1097
|
+
|
|
1098
|
+
# process the path parameters
|
|
1099
|
+
# process the query parameters
|
|
1100
|
+
# process the header parameters
|
|
1101
|
+
# process the form parameters
|
|
1102
|
+
# process the body parameter
|
|
1103
|
+
if get_campaigns_request is not None:
|
|
1104
|
+
_body_params = get_campaigns_request
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
# set the HTTP header `Accept`
|
|
1108
|
+
if 'Accept' not in _header_params:
|
|
1109
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1110
|
+
[
|
|
1111
|
+
'application/json'
|
|
1112
|
+
]
|
|
1113
|
+
)
|
|
1114
|
+
|
|
1115
|
+
# set the HTTP header `Content-Type`
|
|
1116
|
+
if _content_type:
|
|
1117
|
+
_header_params['Content-Type'] = _content_type
|
|
1118
|
+
else:
|
|
1119
|
+
_default_content_type = (
|
|
1120
|
+
self.api_client.select_header_content_type(
|
|
1121
|
+
[
|
|
1122
|
+
'application/json'
|
|
1123
|
+
]
|
|
1124
|
+
)
|
|
1125
|
+
)
|
|
1126
|
+
if _default_content_type is not None:
|
|
1127
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1128
|
+
|
|
1129
|
+
# authentication setting
|
|
1130
|
+
_auth_settings: List[str] = [
|
|
1131
|
+
'BearerAuth'
|
|
1132
|
+
]
|
|
1133
|
+
|
|
1134
|
+
return self.api_client.param_serialize(
|
|
1135
|
+
method='GET',
|
|
1136
|
+
resource_path='/campaign',
|
|
1137
|
+
path_params=_path_params,
|
|
1138
|
+
query_params=_query_params,
|
|
1139
|
+
header_params=_header_params,
|
|
1140
|
+
body=_body_params,
|
|
1141
|
+
post_params=_form_params,
|
|
1142
|
+
files=_files,
|
|
1143
|
+
auth_settings=_auth_settings,
|
|
1144
|
+
collection_formats=_collection_formats,
|
|
1145
|
+
_host=_host,
|
|
1146
|
+
_request_auth=_request_auth
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
@validate_call
|
|
1153
|
+
def pause_campaign(
|
|
1154
|
+
self,
|
|
1155
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1156
|
+
_request_timeout: Union[
|
|
1157
|
+
None,
|
|
1158
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1159
|
+
Tuple[
|
|
1160
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1161
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1162
|
+
]
|
|
1163
|
+
] = None,
|
|
1164
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1165
|
+
_content_type: Optional[StrictStr] = None,
|
|
1166
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1167
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1168
|
+
) -> DeleteAgent200Response:
|
|
1169
|
+
"""Pause a campaign
|
|
1170
|
+
|
|
1171
|
+
Pause a campaign
|
|
1172
|
+
|
|
1173
|
+
:param id: The ID of the campaign (required)
|
|
1174
|
+
:type id: str
|
|
1175
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1176
|
+
number provided, it will be total request
|
|
1177
|
+
timeout. It can also be a pair (tuple) of
|
|
1178
|
+
(connection, read) timeouts.
|
|
1179
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1180
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1181
|
+
request; this effectively ignores the
|
|
1182
|
+
authentication in the spec for a single request.
|
|
1183
|
+
:type _request_auth: dict, optional
|
|
1184
|
+
:param _content_type: force content-type for the request.
|
|
1185
|
+
:type _content_type: str, Optional
|
|
1186
|
+
:param _headers: set to override the headers for a single
|
|
1187
|
+
request; this effectively ignores the headers
|
|
1188
|
+
in the spec for a single request.
|
|
1189
|
+
:type _headers: dict, optional
|
|
1190
|
+
:param _host_index: set to override the host_index for a single
|
|
1191
|
+
request; this effectively ignores the host_index
|
|
1192
|
+
in the spec for a single request.
|
|
1193
|
+
:type _host_index: int, optional
|
|
1194
|
+
:return: Returns the result object.
|
|
1195
|
+
""" # noqa: E501
|
|
1196
|
+
|
|
1197
|
+
_param = self._pause_campaign_serialize(
|
|
1198
|
+
id=id,
|
|
1199
|
+
_request_auth=_request_auth,
|
|
1200
|
+
_content_type=_content_type,
|
|
1201
|
+
_headers=_headers,
|
|
1202
|
+
_host_index=_host_index
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1206
|
+
'200': "DeleteAgent200Response",
|
|
1207
|
+
'400': "BadRequestErrorResponse",
|
|
1208
|
+
'401': "UnauthorizedErrorReponse",
|
|
1209
|
+
'500': "InternalServerErrorResponse",
|
|
1210
|
+
}
|
|
1211
|
+
response_data = self.api_client.call_api(
|
|
1212
|
+
*_param,
|
|
1213
|
+
_request_timeout=_request_timeout
|
|
1214
|
+
)
|
|
1215
|
+
response_data.read()
|
|
1216
|
+
return self.api_client.response_deserialize(
|
|
1217
|
+
response_data=response_data,
|
|
1218
|
+
response_types_map=_response_types_map,
|
|
1219
|
+
).data
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
@validate_call
|
|
1223
|
+
def pause_campaign_with_http_info(
|
|
1224
|
+
self,
|
|
1225
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1226
|
+
_request_timeout: Union[
|
|
1227
|
+
None,
|
|
1228
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1229
|
+
Tuple[
|
|
1230
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1231
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1232
|
+
]
|
|
1233
|
+
] = None,
|
|
1234
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1235
|
+
_content_type: Optional[StrictStr] = None,
|
|
1236
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1237
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1238
|
+
) -> ApiResponse[DeleteAgent200Response]:
|
|
1239
|
+
"""Pause a campaign
|
|
1240
|
+
|
|
1241
|
+
Pause a campaign
|
|
1242
|
+
|
|
1243
|
+
:param id: The ID of the campaign (required)
|
|
1244
|
+
:type id: str
|
|
1245
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1246
|
+
number provided, it will be total request
|
|
1247
|
+
timeout. It can also be a pair (tuple) of
|
|
1248
|
+
(connection, read) timeouts.
|
|
1249
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1250
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1251
|
+
request; this effectively ignores the
|
|
1252
|
+
authentication in the spec for a single request.
|
|
1253
|
+
:type _request_auth: dict, optional
|
|
1254
|
+
:param _content_type: force content-type for the request.
|
|
1255
|
+
:type _content_type: str, Optional
|
|
1256
|
+
:param _headers: set to override the headers for a single
|
|
1257
|
+
request; this effectively ignores the headers
|
|
1258
|
+
in the spec for a single request.
|
|
1259
|
+
:type _headers: dict, optional
|
|
1260
|
+
:param _host_index: set to override the host_index for a single
|
|
1261
|
+
request; this effectively ignores the host_index
|
|
1262
|
+
in the spec for a single request.
|
|
1263
|
+
:type _host_index: int, optional
|
|
1264
|
+
:return: Returns the result object.
|
|
1265
|
+
""" # noqa: E501
|
|
1266
|
+
|
|
1267
|
+
_param = self._pause_campaign_serialize(
|
|
1268
|
+
id=id,
|
|
1269
|
+
_request_auth=_request_auth,
|
|
1270
|
+
_content_type=_content_type,
|
|
1271
|
+
_headers=_headers,
|
|
1272
|
+
_host_index=_host_index
|
|
1273
|
+
)
|
|
1274
|
+
|
|
1275
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1276
|
+
'200': "DeleteAgent200Response",
|
|
1277
|
+
'400': "BadRequestErrorResponse",
|
|
1278
|
+
'401': "UnauthorizedErrorReponse",
|
|
1279
|
+
'500': "InternalServerErrorResponse",
|
|
1280
|
+
}
|
|
1281
|
+
response_data = self.api_client.call_api(
|
|
1282
|
+
*_param,
|
|
1283
|
+
_request_timeout=_request_timeout
|
|
1284
|
+
)
|
|
1285
|
+
response_data.read()
|
|
1286
|
+
return self.api_client.response_deserialize(
|
|
1287
|
+
response_data=response_data,
|
|
1288
|
+
response_types_map=_response_types_map,
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
@validate_call
|
|
1293
|
+
def pause_campaign_without_preload_content(
|
|
1294
|
+
self,
|
|
1295
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1296
|
+
_request_timeout: Union[
|
|
1297
|
+
None,
|
|
1298
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1299
|
+
Tuple[
|
|
1300
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1301
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1302
|
+
]
|
|
1303
|
+
] = None,
|
|
1304
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1305
|
+
_content_type: Optional[StrictStr] = None,
|
|
1306
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1307
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1308
|
+
) -> RESTResponseType:
|
|
1309
|
+
"""Pause a campaign
|
|
1310
|
+
|
|
1311
|
+
Pause a campaign
|
|
1312
|
+
|
|
1313
|
+
:param id: The ID of the campaign (required)
|
|
1314
|
+
:type id: str
|
|
1315
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1316
|
+
number provided, it will be total request
|
|
1317
|
+
timeout. It can also be a pair (tuple) of
|
|
1318
|
+
(connection, read) timeouts.
|
|
1319
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1320
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1321
|
+
request; this effectively ignores the
|
|
1322
|
+
authentication in the spec for a single request.
|
|
1323
|
+
:type _request_auth: dict, optional
|
|
1324
|
+
:param _content_type: force content-type for the request.
|
|
1325
|
+
:type _content_type: str, Optional
|
|
1326
|
+
:param _headers: set to override the headers for a single
|
|
1327
|
+
request; this effectively ignores the headers
|
|
1328
|
+
in the spec for a single request.
|
|
1329
|
+
:type _headers: dict, optional
|
|
1330
|
+
:param _host_index: set to override the host_index for a single
|
|
1331
|
+
request; this effectively ignores the host_index
|
|
1332
|
+
in the spec for a single request.
|
|
1333
|
+
:type _host_index: int, optional
|
|
1334
|
+
:return: Returns the result object.
|
|
1335
|
+
""" # noqa: E501
|
|
1336
|
+
|
|
1337
|
+
_param = self._pause_campaign_serialize(
|
|
1338
|
+
id=id,
|
|
1339
|
+
_request_auth=_request_auth,
|
|
1340
|
+
_content_type=_content_type,
|
|
1341
|
+
_headers=_headers,
|
|
1342
|
+
_host_index=_host_index
|
|
1343
|
+
)
|
|
1344
|
+
|
|
1345
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1346
|
+
'200': "DeleteAgent200Response",
|
|
1347
|
+
'400': "BadRequestErrorResponse",
|
|
1348
|
+
'401': "UnauthorizedErrorReponse",
|
|
1349
|
+
'500': "InternalServerErrorResponse",
|
|
1350
|
+
}
|
|
1351
|
+
response_data = self.api_client.call_api(
|
|
1352
|
+
*_param,
|
|
1353
|
+
_request_timeout=_request_timeout
|
|
1354
|
+
)
|
|
1355
|
+
return response_data.response
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
def _pause_campaign_serialize(
|
|
1359
|
+
self,
|
|
1360
|
+
id,
|
|
1361
|
+
_request_auth,
|
|
1362
|
+
_content_type,
|
|
1363
|
+
_headers,
|
|
1364
|
+
_host_index,
|
|
1365
|
+
) -> RequestSerialized:
|
|
1366
|
+
|
|
1367
|
+
_host = None
|
|
1368
|
+
|
|
1369
|
+
_collection_formats: Dict[str, str] = {
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
_path_params: Dict[str, str] = {}
|
|
1373
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1374
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1375
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1376
|
+
_files: Dict[
|
|
1377
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1378
|
+
] = {}
|
|
1379
|
+
_body_params: Optional[bytes] = None
|
|
1380
|
+
|
|
1381
|
+
# process the path parameters
|
|
1382
|
+
if id is not None:
|
|
1383
|
+
_path_params['id'] = id
|
|
1384
|
+
# process the query parameters
|
|
1385
|
+
# process the header parameters
|
|
1386
|
+
# process the form parameters
|
|
1387
|
+
# process the body parameter
|
|
1388
|
+
|
|
1389
|
+
|
|
1390
|
+
# set the HTTP header `Accept`
|
|
1391
|
+
if 'Accept' not in _header_params:
|
|
1392
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1393
|
+
[
|
|
1394
|
+
'application/json'
|
|
1395
|
+
]
|
|
1396
|
+
)
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
# authentication setting
|
|
1400
|
+
_auth_settings: List[str] = [
|
|
1401
|
+
'BearerAuth'
|
|
1402
|
+
]
|
|
1403
|
+
|
|
1404
|
+
return self.api_client.param_serialize(
|
|
1405
|
+
method='POST',
|
|
1406
|
+
resource_path='/campaign/{id}/pause',
|
|
1407
|
+
path_params=_path_params,
|
|
1408
|
+
query_params=_query_params,
|
|
1409
|
+
header_params=_header_params,
|
|
1410
|
+
body=_body_params,
|
|
1411
|
+
post_params=_form_params,
|
|
1412
|
+
files=_files,
|
|
1413
|
+
auth_settings=_auth_settings,
|
|
1414
|
+
collection_formats=_collection_formats,
|
|
1415
|
+
_host=_host,
|
|
1416
|
+
_request_auth=_request_auth
|
|
1417
|
+
)
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
@validate_call
|
|
1423
|
+
def start_campaign(
|
|
1424
|
+
self,
|
|
1425
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1426
|
+
_request_timeout: Union[
|
|
1427
|
+
None,
|
|
1428
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1429
|
+
Tuple[
|
|
1430
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1431
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1432
|
+
]
|
|
1433
|
+
] = None,
|
|
1434
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1435
|
+
_content_type: Optional[StrictStr] = None,
|
|
1436
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1437
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1438
|
+
) -> DeleteAgent200Response:
|
|
1439
|
+
"""Start a campaign
|
|
1440
|
+
|
|
1441
|
+
Start a campaign
|
|
1442
|
+
|
|
1443
|
+
:param id: The ID of the campaign (required)
|
|
1444
|
+
:type id: str
|
|
1445
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1446
|
+
number provided, it will be total request
|
|
1447
|
+
timeout. It can also be a pair (tuple) of
|
|
1448
|
+
(connection, read) timeouts.
|
|
1449
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1450
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1451
|
+
request; this effectively ignores the
|
|
1452
|
+
authentication in the spec for a single request.
|
|
1453
|
+
:type _request_auth: dict, optional
|
|
1454
|
+
:param _content_type: force content-type for the request.
|
|
1455
|
+
:type _content_type: str, Optional
|
|
1456
|
+
:param _headers: set to override the headers for a single
|
|
1457
|
+
request; this effectively ignores the headers
|
|
1458
|
+
in the spec for a single request.
|
|
1459
|
+
:type _headers: dict, optional
|
|
1460
|
+
:param _host_index: set to override the host_index for a single
|
|
1461
|
+
request; this effectively ignores the host_index
|
|
1462
|
+
in the spec for a single request.
|
|
1463
|
+
:type _host_index: int, optional
|
|
1464
|
+
:return: Returns the result object.
|
|
1465
|
+
""" # noqa: E501
|
|
1466
|
+
|
|
1467
|
+
_param = self._start_campaign_serialize(
|
|
1468
|
+
id=id,
|
|
1469
|
+
_request_auth=_request_auth,
|
|
1470
|
+
_content_type=_content_type,
|
|
1471
|
+
_headers=_headers,
|
|
1472
|
+
_host_index=_host_index
|
|
1473
|
+
)
|
|
1474
|
+
|
|
1475
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1476
|
+
'201': "DeleteAgent200Response",
|
|
1477
|
+
'400': "BadRequestErrorResponse",
|
|
1478
|
+
'401': "UnauthorizedErrorReponse",
|
|
1479
|
+
'500': "InternalServerErrorResponse",
|
|
1480
|
+
}
|
|
1481
|
+
response_data = self.api_client.call_api(
|
|
1482
|
+
*_param,
|
|
1483
|
+
_request_timeout=_request_timeout
|
|
1484
|
+
)
|
|
1485
|
+
response_data.read()
|
|
1486
|
+
return self.api_client.response_deserialize(
|
|
1487
|
+
response_data=response_data,
|
|
1488
|
+
response_types_map=_response_types_map,
|
|
1489
|
+
).data
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
@validate_call
|
|
1493
|
+
def start_campaign_with_http_info(
|
|
1494
|
+
self,
|
|
1495
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1496
|
+
_request_timeout: Union[
|
|
1497
|
+
None,
|
|
1498
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1499
|
+
Tuple[
|
|
1500
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1501
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1502
|
+
]
|
|
1503
|
+
] = None,
|
|
1504
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1505
|
+
_content_type: Optional[StrictStr] = None,
|
|
1506
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1507
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1508
|
+
) -> ApiResponse[DeleteAgent200Response]:
|
|
1509
|
+
"""Start a campaign
|
|
1510
|
+
|
|
1511
|
+
Start a campaign
|
|
1512
|
+
|
|
1513
|
+
:param id: The ID of the campaign (required)
|
|
1514
|
+
:type id: str
|
|
1515
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1516
|
+
number provided, it will be total request
|
|
1517
|
+
timeout. It can also be a pair (tuple) of
|
|
1518
|
+
(connection, read) timeouts.
|
|
1519
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1520
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1521
|
+
request; this effectively ignores the
|
|
1522
|
+
authentication in the spec for a single request.
|
|
1523
|
+
:type _request_auth: dict, optional
|
|
1524
|
+
:param _content_type: force content-type for the request.
|
|
1525
|
+
:type _content_type: str, Optional
|
|
1526
|
+
:param _headers: set to override the headers for a single
|
|
1527
|
+
request; this effectively ignores the headers
|
|
1528
|
+
in the spec for a single request.
|
|
1529
|
+
:type _headers: dict, optional
|
|
1530
|
+
:param _host_index: set to override the host_index for a single
|
|
1531
|
+
request; this effectively ignores the host_index
|
|
1532
|
+
in the spec for a single request.
|
|
1533
|
+
:type _host_index: int, optional
|
|
1534
|
+
:return: Returns the result object.
|
|
1535
|
+
""" # noqa: E501
|
|
1536
|
+
|
|
1537
|
+
_param = self._start_campaign_serialize(
|
|
1538
|
+
id=id,
|
|
1539
|
+
_request_auth=_request_auth,
|
|
1540
|
+
_content_type=_content_type,
|
|
1541
|
+
_headers=_headers,
|
|
1542
|
+
_host_index=_host_index
|
|
1543
|
+
)
|
|
1544
|
+
|
|
1545
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1546
|
+
'201': "DeleteAgent200Response",
|
|
1547
|
+
'400': "BadRequestErrorResponse",
|
|
1548
|
+
'401': "UnauthorizedErrorReponse",
|
|
1549
|
+
'500': "InternalServerErrorResponse",
|
|
1550
|
+
}
|
|
1551
|
+
response_data = self.api_client.call_api(
|
|
1552
|
+
*_param,
|
|
1553
|
+
_request_timeout=_request_timeout
|
|
1554
|
+
)
|
|
1555
|
+
response_data.read()
|
|
1556
|
+
return self.api_client.response_deserialize(
|
|
1557
|
+
response_data=response_data,
|
|
1558
|
+
response_types_map=_response_types_map,
|
|
1559
|
+
)
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
@validate_call
|
|
1563
|
+
def start_campaign_without_preload_content(
|
|
1564
|
+
self,
|
|
1565
|
+
id: Annotated[StrictStr, Field(description="The ID of the campaign")],
|
|
1566
|
+
_request_timeout: Union[
|
|
1567
|
+
None,
|
|
1568
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1569
|
+
Tuple[
|
|
1570
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1571
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1572
|
+
]
|
|
1573
|
+
] = None,
|
|
1574
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1575
|
+
_content_type: Optional[StrictStr] = None,
|
|
1576
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1577
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1578
|
+
) -> RESTResponseType:
|
|
1579
|
+
"""Start a campaign
|
|
1580
|
+
|
|
1581
|
+
Start a campaign
|
|
1582
|
+
|
|
1583
|
+
:param id: The ID of the campaign (required)
|
|
1584
|
+
:type id: str
|
|
1585
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1586
|
+
number provided, it will be total request
|
|
1587
|
+
timeout. It can also be a pair (tuple) of
|
|
1588
|
+
(connection, read) timeouts.
|
|
1589
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1590
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1591
|
+
request; this effectively ignores the
|
|
1592
|
+
authentication in the spec for a single request.
|
|
1593
|
+
:type _request_auth: dict, optional
|
|
1594
|
+
:param _content_type: force content-type for the request.
|
|
1595
|
+
:type _content_type: str, Optional
|
|
1596
|
+
:param _headers: set to override the headers for a single
|
|
1597
|
+
request; this effectively ignores the headers
|
|
1598
|
+
in the spec for a single request.
|
|
1599
|
+
:type _headers: dict, optional
|
|
1600
|
+
:param _host_index: set to override the host_index for a single
|
|
1601
|
+
request; this effectively ignores the host_index
|
|
1602
|
+
in the spec for a single request.
|
|
1603
|
+
:type _host_index: int, optional
|
|
1604
|
+
:return: Returns the result object.
|
|
1605
|
+
""" # noqa: E501
|
|
1606
|
+
|
|
1607
|
+
_param = self._start_campaign_serialize(
|
|
1608
|
+
id=id,
|
|
1609
|
+
_request_auth=_request_auth,
|
|
1610
|
+
_content_type=_content_type,
|
|
1611
|
+
_headers=_headers,
|
|
1612
|
+
_host_index=_host_index
|
|
1613
|
+
)
|
|
1614
|
+
|
|
1615
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1616
|
+
'201': "DeleteAgent200Response",
|
|
1617
|
+
'400': "BadRequestErrorResponse",
|
|
1618
|
+
'401': "UnauthorizedErrorReponse",
|
|
1619
|
+
'500': "InternalServerErrorResponse",
|
|
1620
|
+
}
|
|
1621
|
+
response_data = self.api_client.call_api(
|
|
1622
|
+
*_param,
|
|
1623
|
+
_request_timeout=_request_timeout
|
|
1624
|
+
)
|
|
1625
|
+
return response_data.response
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
def _start_campaign_serialize(
|
|
1629
|
+
self,
|
|
1630
|
+
id,
|
|
1631
|
+
_request_auth,
|
|
1632
|
+
_content_type,
|
|
1633
|
+
_headers,
|
|
1634
|
+
_host_index,
|
|
1635
|
+
) -> RequestSerialized:
|
|
1636
|
+
|
|
1637
|
+
_host = None
|
|
1638
|
+
|
|
1639
|
+
_collection_formats: Dict[str, str] = {
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
_path_params: Dict[str, str] = {}
|
|
1643
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1644
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1645
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1646
|
+
_files: Dict[
|
|
1647
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1648
|
+
] = {}
|
|
1649
|
+
_body_params: Optional[bytes] = None
|
|
1650
|
+
|
|
1651
|
+
# process the path parameters
|
|
1652
|
+
if id is not None:
|
|
1653
|
+
_path_params['id'] = id
|
|
1654
|
+
# process the query parameters
|
|
1655
|
+
# process the header parameters
|
|
1656
|
+
# process the form parameters
|
|
1657
|
+
# process the body parameter
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
# set the HTTP header `Accept`
|
|
1661
|
+
if 'Accept' not in _header_params:
|
|
1662
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1663
|
+
[
|
|
1664
|
+
'application/json'
|
|
1665
|
+
]
|
|
1666
|
+
)
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
# authentication setting
|
|
1670
|
+
_auth_settings: List[str] = [
|
|
1671
|
+
'BearerAuth'
|
|
1672
|
+
]
|
|
1673
|
+
|
|
1674
|
+
return self.api_client.param_serialize(
|
|
1675
|
+
method='POST',
|
|
1676
|
+
resource_path='/campaign/{id}/start',
|
|
1677
|
+
path_params=_path_params,
|
|
1678
|
+
query_params=_query_params,
|
|
1679
|
+
header_params=_header_params,
|
|
1680
|
+
body=_body_params,
|
|
1681
|
+
post_params=_form_params,
|
|
1682
|
+
files=_files,
|
|
1683
|
+
auth_settings=_auth_settings,
|
|
1684
|
+
collection_formats=_collection_formats,
|
|
1685
|
+
_host=_host,
|
|
1686
|
+
_request_auth=_request_auth
|
|
1687
|
+
)
|
|
1688
|
+
|
|
1689
|
+
|