baiducloud-python-sdk-agentidentity 0.0.1__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.
Files changed (70) hide show
  1. baiducloud_python_sdk_agentidentity/__init__.py +5 -0
  2. baiducloud_python_sdk_agentidentity/api/__init__.py +0 -0
  3. baiducloud_python_sdk_agentidentity/api/agentidentity_client.py +1361 -0
  4. baiducloud_python_sdk_agentidentity/models/__init__.py +65 -0
  5. baiducloud_python_sdk_agentidentity/models/agent_dto.py +133 -0
  6. baiducloud_python_sdk_agentidentity/models/authorize_endpoint_request.py +94 -0
  7. baiducloud_python_sdk_agentidentity/models/batch_acquisition_of_users_request.py +68 -0
  8. baiducloud_python_sdk_agentidentity/models/batch_get_resource_api_key_request.py +86 -0
  9. baiducloud_python_sdk_agentidentity/models/batch_get_resource_api_key_response.py +62 -0
  10. baiducloud_python_sdk_agentidentity/models/complete_oauth2session_request.py +104 -0
  11. baiducloud_python_sdk_agentidentity/models/create_agent_request.py +76 -0
  12. baiducloud_python_sdk_agentidentity/models/create_credential_provider_request.py +84 -0
  13. baiducloud_python_sdk_agentidentity/models/create_idp_configuration_request.py +180 -0
  14. baiducloud_python_sdk_agentidentity/models/create_oauth2_client_request.py +135 -0
  15. baiducloud_python_sdk_agentidentity/models/create_user_pool_request.py +68 -0
  16. baiducloud_python_sdk_agentidentity/models/create_user_request.py +102 -0
  17. baiducloud_python_sdk_agentidentity/models/credential_config.py +205 -0
  18. baiducloud_python_sdk_agentidentity/models/credential_provider_dto.py +135 -0
  19. baiducloud_python_sdk_agentidentity/models/delete_agent_request.py +60 -0
  20. baiducloud_python_sdk_agentidentity/models/delete_credential_provider_request.py +60 -0
  21. baiducloud_python_sdk_agentidentity/models/delete_idp_configuration_request.py +68 -0
  22. baiducloud_python_sdk_agentidentity/models/delete_oauth2_client_request.py +68 -0
  23. baiducloud_python_sdk_agentidentity/models/delete_user_pool_request.py +60 -0
  24. baiducloud_python_sdk_agentidentity/models/delete_user_request.py +68 -0
  25. baiducloud_python_sdk_agentidentity/models/disable_idp_configuration_request.py +68 -0
  26. baiducloud_python_sdk_agentidentity/models/enable_idp_configuration_request.py +68 -0
  27. baiducloud_python_sdk_agentidentity/models/get_agent_request.py +60 -0
  28. baiducloud_python_sdk_agentidentity/models/get_credential_provider_request.py +60 -0
  29. baiducloud_python_sdk_agentidentity/models/get_idp_configuration_request.py +68 -0
  30. baiducloud_python_sdk_agentidentity/models/get_oauth2_client_request.py +68 -0
  31. baiducloud_python_sdk_agentidentity/models/get_resource_apikey_request.py +86 -0
  32. baiducloud_python_sdk_agentidentity/models/get_resource_oauth2token_request.py +136 -0
  33. baiducloud_python_sdk_agentidentity/models/get_user_pool_request.py +60 -0
  34. baiducloud_python_sdk_agentidentity/models/get_user_request.py +76 -0
  35. baiducloud_python_sdk_agentidentity/models/get_wat_for_user_request.py +102 -0
  36. baiducloud_python_sdk_agentidentity/models/get_workload_access_token_request.py +84 -0
  37. baiducloud_python_sdk_agentidentity/models/list_agents_request.py +76 -0
  38. baiducloud_python_sdk_agentidentity/models/list_agents_response.py +86 -0
  39. baiducloud_python_sdk_agentidentity/models/list_credential_providers_request.py +84 -0
  40. baiducloud_python_sdk_agentidentity/models/list_credential_providers_response.py +86 -0
  41. baiducloud_python_sdk_agentidentity/models/list_idp_configurations_request.py +84 -0
  42. baiducloud_python_sdk_agentidentity/models/list_idp_configurations_response.py +86 -0
  43. baiducloud_python_sdk_agentidentity/models/list_oauth2_clients_request.py +84 -0
  44. baiducloud_python_sdk_agentidentity/models/list_oauth2_clients_response.py +86 -0
  45. baiducloud_python_sdk_agentidentity/models/list_user_pools_request.py +76 -0
  46. baiducloud_python_sdk_agentidentity/models/list_user_pools_response.py +86 -0
  47. baiducloud_python_sdk_agentidentity/models/list_users_request.py +84 -0
  48. baiducloud_python_sdk_agentidentity/models/list_users_response.py +86 -0
  49. baiducloud_python_sdk_agentidentity/models/o_idc_discovery_request.py +58 -0
  50. baiducloud_python_sdk_agentidentity/models/oauth2idp_callback_request.py +70 -0
  51. baiducloud_python_sdk_agentidentity/models/reset_password_request.py +92 -0
  52. baiducloud_python_sdk_agentidentity/models/resource_credential_dto.py +90 -0
  53. baiducloud_python_sdk_agentidentity/models/token_endpoint_request.py +108 -0
  54. baiducloud_python_sdk_agentidentity/models/update_agent_request.py +76 -0
  55. baiducloud_python_sdk_agentidentity/models/update_credential_provider_request.py +76 -0
  56. baiducloud_python_sdk_agentidentity/models/update_idp_configuration_request.py +162 -0
  57. baiducloud_python_sdk_agentidentity/models/update_oauth2_client_request.py +135 -0
  58. baiducloud_python_sdk_agentidentity/models/update_user_pool_request.py +76 -0
  59. baiducloud_python_sdk_agentidentity/models/update_user_request.py +84 -0
  60. baiducloud_python_sdk_agentidentity/models/user_pool_dto.py +187 -0
  61. baiducloud_python_sdk_agentidentity/models/user_pool_idp_config_dto.py +205 -0
  62. baiducloud_python_sdk_agentidentity/models/user_pool_o_auth2_client_dto.py +178 -0
  63. baiducloud_python_sdk_agentidentity/models/user_pool_user_dto.py +115 -0
  64. baiducloud_python_sdk_agentidentity/models/userinfo_endpoint_request.py +76 -0
  65. baiducloud_python_sdk_agentidentity/models/userinfo_endpoint_response.py +77 -0
  66. baiducloud_python_sdk_agentidentity-0.0.1.dist-info/LICENSE +177 -0
  67. baiducloud_python_sdk_agentidentity-0.0.1.dist-info/METADATA +76 -0
  68. baiducloud_python_sdk_agentidentity-0.0.1.dist-info/RECORD +70 -0
  69. baiducloud_python_sdk_agentidentity-0.0.1.dist-info/WHEEL +5 -0
  70. baiducloud_python_sdk_agentidentity-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1361 @@
1
+ """
2
+ Example for agentidentity client.
3
+ """
4
+
5
+ import copy
6
+ import logging
7
+
8
+ from baiducloud_python_sdk_core import utils, bce_base_client
9
+ from baiducloud_python_sdk_core.auth import bce_v1_signer
10
+ from baiducloud_python_sdk_core.bce_base_client import BceBaseClient
11
+ from baiducloud_python_sdk_core.http import bce_http_client
12
+ from baiducloud_python_sdk_core.http import handler
13
+ from baiducloud_python_sdk_core.http import http_methods
14
+ from baiducloud_python_sdk_agentidentity.models.batch_get_resource_api_key_response import (
15
+ BatchGetResourceApiKeyResponse,
16
+ )
17
+ from baiducloud_python_sdk_agentidentity.models.list_agents_response import ListAgentsResponse
18
+ from baiducloud_python_sdk_agentidentity.models.list_credential_providers_response import (
19
+ ListCredentialProvidersResponse,
20
+ )
21
+ from baiducloud_python_sdk_agentidentity.models.list_idp_configurations_response import ListIdpConfigurationsResponse
22
+ from baiducloud_python_sdk_agentidentity.models.list_oauth2_clients_response import ListOauth2ClientsResponse
23
+ from baiducloud_python_sdk_agentidentity.models.list_user_pools_response import ListUserPoolsResponse
24
+ from baiducloud_python_sdk_agentidentity.models.list_users_response import ListUsersResponse
25
+ from baiducloud_python_sdk_agentidentity.models.userinfo_endpoint_response import UserinfoEndpointResponse
26
+
27
+ _logger = logging.getLogger(__name__)
28
+
29
+
30
+ class AgentidentityClient(BceBaseClient):
31
+ """
32
+ agentidentity base sdk client
33
+ """
34
+
35
+ VERSION_V1 = b'/v1'
36
+
37
+ CONSTANT_AGENT_IDENTITY = b'agent-identity'
38
+
39
+ CONSTANT_WORKLOAD_ACCESS_TOKEN = b'workload-access-token'
40
+
41
+ CONSTANT_AGENT = b'agent'
42
+
43
+ CONSTANT_LIST = b'list'
44
+
45
+ CONSTANT_USER_POOL = b'user-pool'
46
+
47
+ CONSTANT_USER = b'user'
48
+
49
+ CONSTANT_RESET_PASSWORD = b'resetPassword'
50
+
51
+ CONSTANT_OAUTH2_CLIENT = b'oauth2-client'
52
+
53
+ CONSTANT_GET = b'get'
54
+
55
+ CONSTANT_UPDATE = b'update'
56
+
57
+ CONSTANT_CREDENTIAL = b'credential'
58
+
59
+ CONSTANT_APIKEY = b'apikey'
60
+
61
+ CONSTANT_BATCH = b'batch'
62
+
63
+ CONSTANT_IDP_CONFIG = b'idp-config'
64
+
65
+ CONSTANT_CREATE = b'create'
66
+
67
+ CONSTANT_DELETE = b'delete'
68
+
69
+ CONSTANT_CREDENTIAL_PROVIDER = b'credential-provider'
70
+
71
+ CONSTANT_INBOUND = b'inbound'
72
+
73
+ CONSTANT_TOKEN = b'token'
74
+
75
+ CONSTANT_WORKLOAD_ACCESS_TOKEN_FOR_USER = b'workload-access-token-for-user'
76
+
77
+ CONSTANT_OAUTH2 = b'oauth2'
78
+
79
+ CONSTANT_CALLBACK = b'callback'
80
+
81
+ CONSTANT_WELL_KNOWN = b'.well-known'
82
+
83
+ CONSTANT_OPENID_CONFIGURATION = b'openid-configuration'
84
+
85
+ CONSTANT_ENABLE = b'enable'
86
+
87
+ CONSTANT_USERINFO = b'userinfo'
88
+
89
+ CONSTANT_AUTHORIZE = b'authorize'
90
+
91
+ CONSTANT_COMPLETE_AUTH = b'complete-auth'
92
+
93
+ CONSTANT_DISABLE = b'disable'
94
+
95
+ def __init__(self, config=None):
96
+ """
97
+ Initialize the agentidentity client.
98
+
99
+ :param config: Client configuration
100
+ :type config: baidubce.BceClientConfiguration
101
+ """
102
+ bce_base_client.BceBaseClient.__init__(self, config)
103
+
104
+ def authorize_endpoint(self, request, config=None):
105
+ """
106
+ authorize_endpoint
107
+
108
+ :param request: Request entity containing all parameters
109
+ :type request: AgentidentityClientRequest
110
+ :param config: Optional request configuration override
111
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
112
+
113
+ :return: API response
114
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
115
+
116
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
117
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
118
+ """
119
+ path = utils.append_uri(
120
+ AgentidentityClient.VERSION_V1,
121
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
122
+ AgentidentityClient.CONSTANT_INBOUND,
123
+ request.user_pool_id,
124
+ AgentidentityClient.CONSTANT_AUTHORIZE,
125
+ )
126
+ headers = None
127
+ params = {}
128
+ if request.client_id is not None:
129
+ params['clientId'] = request.client_id
130
+ if request.redirect_uri is not None:
131
+ params['redirectUri'] = request.redirect_uri
132
+ if request.response_type is not None:
133
+ params['responseType'] = request.response_type
134
+ if request.scope is not None:
135
+ params['scope'] = request.scope
136
+ if request.state is not None:
137
+ params['state'] = request.state
138
+ if request.nonce is not None:
139
+ params['nonce'] = request.nonce
140
+ merged_config = self._create_request_with_host(request, config)
141
+ return self._send_request(http_methods.GET, path=path, params=params, config=merged_config)
142
+
143
+ def batch_acquisition_of_users(self, request, config=None):
144
+ """
145
+ batch_acquisition_of_users
146
+
147
+ :param request: Request entity containing all parameters
148
+ :type request: AgentidentityClientRequest
149
+ :param config: Optional request configuration override
150
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
151
+
152
+ :return: API response
153
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
154
+
155
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
156
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
157
+ """
158
+ path = utils.append_uri(
159
+ AgentidentityClient.VERSION_V1,
160
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
161
+ AgentidentityClient.CONSTANT_USER_POOL,
162
+ AgentidentityClient.CONSTANT_USER,
163
+ AgentidentityClient.CONSTANT_BATCH,
164
+ )
165
+ headers = None
166
+ merged_config = self._create_request_with_host(request, config)
167
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
168
+
169
+ def batch_get_resource_api_key(self, request, config=None):
170
+ """
171
+ batch_get_resource_api_key
172
+
173
+ :param request: Request entity containing all parameters
174
+ :type request: AgentidentityClientRequest
175
+ :param config: Optional request configuration override
176
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
177
+
178
+ :return: API response containing BatchGetResourceApiKeyResponse data
179
+ :rtype: BatchGetResourceApiKeyResponse
180
+
181
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
182
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
183
+ """
184
+ path = utils.append_uri(
185
+ AgentidentityClient.VERSION_V1,
186
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
187
+ AgentidentityClient.CONSTANT_CREDENTIAL,
188
+ AgentidentityClient.CONSTANT_APIKEY,
189
+ AgentidentityClient.CONSTANT_BATCH,
190
+ )
191
+ headers = None
192
+ merged_config = self._create_request_with_host(request, config)
193
+ return self._send_request(
194
+ http_methods.POST,
195
+ path=path,
196
+ body=request.to_json_string(),
197
+ config=merged_config,
198
+ model=BatchGetResourceApiKeyResponse,
199
+ )
200
+
201
+ def complete_oauth2session(self, request, config=None):
202
+ """
203
+ complete_oauth2session
204
+
205
+ :param request: Request entity containing all parameters
206
+ :type request: AgentidentityClientRequest
207
+ :param config: Optional request configuration override
208
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
209
+
210
+ :return: API response
211
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
212
+
213
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
214
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
215
+ """
216
+ path = utils.append_uri(
217
+ AgentidentityClient.VERSION_V1,
218
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
219
+ AgentidentityClient.CONSTANT_OAUTH2,
220
+ AgentidentityClient.CONSTANT_COMPLETE_AUTH,
221
+ )
222
+ headers = None
223
+ merged_config = self._create_request_with_host(request, config)
224
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
225
+
226
+ def create_agent(self, request, config=None):
227
+ """
228
+ create_agent
229
+
230
+ :param request: Request entity containing all parameters
231
+ :type request: AgentidentityClientRequest
232
+ :param config: Optional request configuration override
233
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
234
+
235
+ :return: API response
236
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
237
+
238
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
239
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
240
+ """
241
+ path = utils.append_uri(
242
+ AgentidentityClient.VERSION_V1,
243
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
244
+ AgentidentityClient.CONSTANT_AGENT,
245
+ AgentidentityClient.CONSTANT_CREATE,
246
+ )
247
+ headers = None
248
+ merged_config = self._create_request_with_host(request, config)
249
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
250
+
251
+ def create_credential_provider(self, request, config=None):
252
+ """
253
+ create_credential_provider
254
+
255
+ :param request: Request entity containing all parameters
256
+ :type request: AgentidentityClientRequest
257
+ :param config: Optional request configuration override
258
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
259
+
260
+ :return: API response
261
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
262
+
263
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
264
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
265
+ """
266
+ path = utils.append_uri(
267
+ AgentidentityClient.VERSION_V1,
268
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
269
+ AgentidentityClient.CONSTANT_CREDENTIAL_PROVIDER,
270
+ AgentidentityClient.CONSTANT_CREATE,
271
+ )
272
+ headers = None
273
+ merged_config = self._create_request_with_host(request, config)
274
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
275
+
276
+ def create_idp_configuration(self, request, config=None):
277
+ """
278
+ create_idp_configuration
279
+
280
+ :param request: Request entity containing all parameters
281
+ :type request: AgentidentityClientRequest
282
+ :param config: Optional request configuration override
283
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
284
+
285
+ :return: API response
286
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
287
+
288
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
289
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
290
+ """
291
+ path = utils.append_uri(
292
+ AgentidentityClient.VERSION_V1,
293
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
294
+ AgentidentityClient.CONSTANT_USER_POOL,
295
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
296
+ AgentidentityClient.CONSTANT_CREATE,
297
+ )
298
+ headers = None
299
+ merged_config = self._create_request_with_host(request, config)
300
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
301
+
302
+ def create_oauth2_client(self, request, config=None):
303
+ """
304
+ create_oauth2_client
305
+
306
+ :param request: Request entity containing all parameters
307
+ :type request: AgentidentityClientRequest
308
+ :param config: Optional request configuration override
309
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
310
+
311
+ :return: API response
312
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
313
+
314
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
315
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
316
+ """
317
+ path = utils.append_uri(
318
+ AgentidentityClient.VERSION_V1,
319
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
320
+ AgentidentityClient.CONSTANT_USER_POOL,
321
+ AgentidentityClient.CONSTANT_OAUTH2_CLIENT,
322
+ AgentidentityClient.CONSTANT_CREATE,
323
+ )
324
+ headers = None
325
+ merged_config = self._create_request_with_host(request, config)
326
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
327
+
328
+ def create_user(self, request, config=None):
329
+ """
330
+ create_user
331
+
332
+ :param request: Request entity containing all parameters
333
+ :type request: AgentidentityClientRequest
334
+ :param config: Optional request configuration override
335
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
336
+
337
+ :return: API response
338
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
339
+
340
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
341
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
342
+ """
343
+ path = utils.append_uri(
344
+ AgentidentityClient.VERSION_V1,
345
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
346
+ AgentidentityClient.CONSTANT_USER_POOL,
347
+ AgentidentityClient.CONSTANT_USER,
348
+ AgentidentityClient.CONSTANT_CREATE,
349
+ )
350
+ headers = None
351
+ merged_config = self._create_request_with_host(request, config)
352
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
353
+
354
+ def create_user_pool(self, request, config=None):
355
+ """
356
+ create_user_pool
357
+
358
+ :param request: Request entity containing all parameters
359
+ :type request: AgentidentityClientRequest
360
+ :param config: Optional request configuration override
361
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
362
+
363
+ :return: API response
364
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
365
+
366
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
367
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
368
+ """
369
+ path = utils.append_uri(
370
+ AgentidentityClient.VERSION_V1,
371
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
372
+ AgentidentityClient.CONSTANT_USER_POOL,
373
+ AgentidentityClient.CONSTANT_CREATE,
374
+ )
375
+ headers = None
376
+ merged_config = self._create_request_with_host(request, config)
377
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
378
+
379
+ def delete_agent(self, request, config=None):
380
+ """
381
+ delete_agent
382
+
383
+ :param request: Request entity containing all parameters
384
+ :type request: AgentidentityClientRequest
385
+ :param config: Optional request configuration override
386
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
387
+
388
+ :return: API response
389
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
390
+
391
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
392
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
393
+ """
394
+ path = utils.append_uri(
395
+ AgentidentityClient.VERSION_V1,
396
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
397
+ AgentidentityClient.CONSTANT_AGENT,
398
+ AgentidentityClient.CONSTANT_DELETE,
399
+ )
400
+ headers = None
401
+ merged_config = self._create_request_with_host(request, config)
402
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
403
+
404
+ def delete_credential_provider(self, request, config=None):
405
+ """
406
+ delete_credential_provider
407
+
408
+ :param request: Request entity containing all parameters
409
+ :type request: AgentidentityClientRequest
410
+ :param config: Optional request configuration override
411
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
412
+
413
+ :return: API response
414
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
415
+
416
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
417
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
418
+ """
419
+ path = utils.append_uri(
420
+ AgentidentityClient.VERSION_V1,
421
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
422
+ AgentidentityClient.CONSTANT_CREDENTIAL_PROVIDER,
423
+ AgentidentityClient.CONSTANT_DELETE,
424
+ )
425
+ headers = None
426
+ merged_config = self._create_request_with_host(request, config)
427
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
428
+
429
+ def delete_idp_configuration(self, request, config=None):
430
+ """
431
+ delete_idp_configuration
432
+
433
+ :param request: Request entity containing all parameters
434
+ :type request: AgentidentityClientRequest
435
+ :param config: Optional request configuration override
436
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
437
+
438
+ :return: API response
439
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
440
+
441
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
442
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
443
+ """
444
+ path = utils.append_uri(
445
+ AgentidentityClient.VERSION_V1,
446
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
447
+ AgentidentityClient.CONSTANT_USER_POOL,
448
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
449
+ AgentidentityClient.CONSTANT_DELETE,
450
+ )
451
+ headers = None
452
+ merged_config = self._create_request_with_host(request, config)
453
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
454
+
455
+ def delete_oauth2_client(self, request, config=None):
456
+ """
457
+ delete_oauth2_client
458
+
459
+ :param request: Request entity containing all parameters
460
+ :type request: AgentidentityClientRequest
461
+ :param config: Optional request configuration override
462
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
463
+
464
+ :return: API response
465
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
466
+
467
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
468
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
469
+ """
470
+ path = utils.append_uri(
471
+ AgentidentityClient.VERSION_V1,
472
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
473
+ AgentidentityClient.CONSTANT_USER_POOL,
474
+ AgentidentityClient.CONSTANT_OAUTH2_CLIENT,
475
+ AgentidentityClient.CONSTANT_DELETE,
476
+ )
477
+ headers = None
478
+ merged_config = self._create_request_with_host(request, config)
479
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
480
+
481
+ def delete_user(self, request, config=None):
482
+ """
483
+ delete_user
484
+
485
+ :param request: Request entity containing all parameters
486
+ :type request: AgentidentityClientRequest
487
+ :param config: Optional request configuration override
488
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
489
+
490
+ :return: API response
491
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
492
+
493
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
494
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
495
+ """
496
+ path = utils.append_uri(
497
+ AgentidentityClient.VERSION_V1,
498
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
499
+ AgentidentityClient.CONSTANT_USER_POOL,
500
+ AgentidentityClient.CONSTANT_USER,
501
+ AgentidentityClient.CONSTANT_DELETE,
502
+ )
503
+ headers = None
504
+ merged_config = self._create_request_with_host(request, config)
505
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
506
+
507
+ def delete_user_pool(self, request, config=None):
508
+ """
509
+ delete_user_pool
510
+
511
+ :param request: Request entity containing all parameters
512
+ :type request: AgentidentityClientRequest
513
+ :param config: Optional request configuration override
514
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
515
+
516
+ :return: API response
517
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
518
+
519
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
520
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
521
+ """
522
+ path = utils.append_uri(
523
+ AgentidentityClient.VERSION_V1,
524
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
525
+ AgentidentityClient.CONSTANT_USER_POOL,
526
+ AgentidentityClient.CONSTANT_DELETE,
527
+ )
528
+ headers = None
529
+ merged_config = self._create_request_with_host(request, config)
530
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
531
+
532
+ def disable_idp_configuration(self, request, config=None):
533
+ """
534
+ disable_idp_configuration
535
+
536
+ :param request: Request entity containing all parameters
537
+ :type request: AgentidentityClientRequest
538
+ :param config: Optional request configuration override
539
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
540
+
541
+ :return: API response
542
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
543
+
544
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
545
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
546
+ """
547
+ path = utils.append_uri(
548
+ AgentidentityClient.VERSION_V1,
549
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
550
+ AgentidentityClient.CONSTANT_USER_POOL,
551
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
552
+ AgentidentityClient.CONSTANT_DISABLE,
553
+ )
554
+ headers = None
555
+ merged_config = self._create_request_with_host(request, config)
556
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
557
+
558
+ def enable_idp_configuration(self, request, config=None):
559
+ """
560
+ enable_idp_configuration
561
+
562
+ :param request: Request entity containing all parameters
563
+ :type request: AgentidentityClientRequest
564
+ :param config: Optional request configuration override
565
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
566
+
567
+ :return: API response
568
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
569
+
570
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
571
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
572
+ """
573
+ path = utils.append_uri(
574
+ AgentidentityClient.VERSION_V1,
575
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
576
+ AgentidentityClient.CONSTANT_USER_POOL,
577
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
578
+ AgentidentityClient.CONSTANT_ENABLE,
579
+ )
580
+ headers = None
581
+ merged_config = self._create_request_with_host(request, config)
582
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
583
+
584
+ def get_agent(self, request, config=None):
585
+ """
586
+ get_agent
587
+
588
+ :param request: Request entity containing all parameters
589
+ :type request: AgentidentityClientRequest
590
+ :param config: Optional request configuration override
591
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
592
+
593
+ :return: API response
594
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
595
+
596
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
597
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
598
+ """
599
+ path = utils.append_uri(
600
+ AgentidentityClient.VERSION_V1,
601
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
602
+ AgentidentityClient.CONSTANT_AGENT,
603
+ AgentidentityClient.CONSTANT_GET,
604
+ )
605
+ headers = None
606
+ merged_config = self._create_request_with_host(request, config)
607
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
608
+
609
+ def get_credential_provider(self, request, config=None):
610
+ """
611
+ get_credential_provider
612
+
613
+ :param request: Request entity containing all parameters
614
+ :type request: AgentidentityClientRequest
615
+ :param config: Optional request configuration override
616
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
617
+
618
+ :return: API response
619
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
620
+
621
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
622
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
623
+ """
624
+ path = utils.append_uri(
625
+ AgentidentityClient.VERSION_V1,
626
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
627
+ AgentidentityClient.CONSTANT_CREDENTIAL_PROVIDER,
628
+ AgentidentityClient.CONSTANT_GET,
629
+ )
630
+ headers = None
631
+ merged_config = self._create_request_with_host(request, config)
632
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
633
+
634
+ def get_idp_configuration(self, request, config=None):
635
+ """
636
+ get_idp_configuration
637
+
638
+ :param request: Request entity containing all parameters
639
+ :type request: AgentidentityClientRequest
640
+ :param config: Optional request configuration override
641
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
642
+
643
+ :return: API response
644
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
645
+
646
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
647
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
648
+ """
649
+ path = utils.append_uri(
650
+ AgentidentityClient.VERSION_V1,
651
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
652
+ AgentidentityClient.CONSTANT_USER_POOL,
653
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
654
+ AgentidentityClient.CONSTANT_GET,
655
+ )
656
+ headers = None
657
+ merged_config = self._create_request_with_host(request, config)
658
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
659
+
660
+ def get_oauth2_client(self, request, config=None):
661
+ """
662
+ get_oauth2_client
663
+
664
+ :param request: Request entity containing all parameters
665
+ :type request: AgentidentityClientRequest
666
+ :param config: Optional request configuration override
667
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
668
+
669
+ :return: API response
670
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
671
+
672
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
673
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
674
+ """
675
+ path = utils.append_uri(
676
+ AgentidentityClient.VERSION_V1,
677
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
678
+ AgentidentityClient.CONSTANT_USER_POOL,
679
+ AgentidentityClient.CONSTANT_OAUTH2_CLIENT,
680
+ AgentidentityClient.CONSTANT_GET,
681
+ )
682
+ headers = None
683
+ merged_config = self._create_request_with_host(request, config)
684
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
685
+
686
+ def get_resource_apikey(self, request, config=None):
687
+ """
688
+ get_resource_apikey
689
+
690
+ :param request: Request entity containing all parameters
691
+ :type request: AgentidentityClientRequest
692
+ :param config: Optional request configuration override
693
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
694
+
695
+ :return: API response
696
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
697
+
698
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
699
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
700
+ """
701
+ path = utils.append_uri(
702
+ AgentidentityClient.VERSION_V1,
703
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
704
+ AgentidentityClient.CONSTANT_CREDENTIAL,
705
+ AgentidentityClient.CONSTANT_APIKEY,
706
+ )
707
+ headers = None
708
+ merged_config = self._create_request_with_host(request, config)
709
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
710
+
711
+ def get_resource_oauth2token(self, request, config=None):
712
+ """
713
+ get_resource_oauth2token
714
+
715
+ :param request: Request entity containing all parameters
716
+ :type request: AgentidentityClientRequest
717
+ :param config: Optional request configuration override
718
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
719
+
720
+ :return: API response
721
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
722
+
723
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
724
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
725
+ """
726
+ path = utils.append_uri(
727
+ AgentidentityClient.VERSION_V1,
728
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
729
+ AgentidentityClient.CONSTANT_CREDENTIAL,
730
+ AgentidentityClient.CONSTANT_OAUTH2,
731
+ )
732
+ headers = None
733
+ merged_config = self._create_request_with_host(request, config)
734
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
735
+
736
+ def get_user(self, request, config=None):
737
+ """
738
+ get_user
739
+
740
+ :param request: Request entity containing all parameters
741
+ :type request: AgentidentityClientRequest
742
+ :param config: Optional request configuration override
743
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
744
+
745
+ :return: API response
746
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
747
+
748
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
749
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
750
+ """
751
+ path = utils.append_uri(
752
+ AgentidentityClient.VERSION_V1,
753
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
754
+ AgentidentityClient.CONSTANT_USER_POOL,
755
+ AgentidentityClient.CONSTANT_USER,
756
+ AgentidentityClient.CONSTANT_GET,
757
+ )
758
+ headers = None
759
+ merged_config = self._create_request_with_host(request, config)
760
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
761
+
762
+ def get_user_pool(self, request, config=None):
763
+ """
764
+ get_user_pool
765
+
766
+ :param request: Request entity containing all parameters
767
+ :type request: AgentidentityClientRequest
768
+ :param config: Optional request configuration override
769
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
770
+
771
+ :return: API response
772
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
773
+
774
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
775
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
776
+ """
777
+ path = utils.append_uri(
778
+ AgentidentityClient.VERSION_V1,
779
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
780
+ AgentidentityClient.CONSTANT_USER_POOL,
781
+ AgentidentityClient.CONSTANT_GET,
782
+ )
783
+ headers = None
784
+ merged_config = self._create_request_with_host(request, config)
785
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
786
+
787
+ def get_wat_for_user(self, request, config=None):
788
+ """
789
+ get_wat_for_user
790
+
791
+ :param request: Request entity containing all parameters
792
+ :type request: AgentidentityClientRequest
793
+ :param config: Optional request configuration override
794
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
795
+
796
+ :return: API response
797
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
798
+
799
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
800
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
801
+ """
802
+ path = utils.append_uri(
803
+ AgentidentityClient.VERSION_V1,
804
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
805
+ AgentidentityClient.CONSTANT_WORKLOAD_ACCESS_TOKEN_FOR_USER,
806
+ )
807
+ headers = None
808
+ merged_config = self._create_request_with_host(request, config)
809
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
810
+
811
+ def get_workload_access_token(self, request, config=None):
812
+ """
813
+ get_workload_access_token
814
+
815
+ :param request: Request entity containing all parameters
816
+ :type request: AgentidentityClientRequest
817
+ :param config: Optional request configuration override
818
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
819
+
820
+ :return: API response
821
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
822
+
823
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
824
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
825
+ """
826
+ path = utils.append_uri(
827
+ AgentidentityClient.VERSION_V1,
828
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
829
+ AgentidentityClient.CONSTANT_WORKLOAD_ACCESS_TOKEN,
830
+ )
831
+ headers = None
832
+ merged_config = self._create_request_with_host(request, config)
833
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
834
+
835
+ def list_agents(self, request, config=None):
836
+ """
837
+ list_agents
838
+
839
+ :param request: Request entity containing all parameters
840
+ :type request: AgentidentityClientRequest
841
+ :param config: Optional request configuration override
842
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
843
+
844
+ :return: API response containing ListAgentsResponse data
845
+ :rtype: ListAgentsResponse
846
+
847
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
848
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
849
+ """
850
+ path = utils.append_uri(
851
+ AgentidentityClient.VERSION_V1,
852
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
853
+ AgentidentityClient.CONSTANT_AGENT,
854
+ AgentidentityClient.CONSTANT_LIST,
855
+ )
856
+ headers = None
857
+ merged_config = self._create_request_with_host(request, config)
858
+ return self._send_request(
859
+ http_methods.POST, path=path, body=request.to_json_string(), config=merged_config, model=ListAgentsResponse
860
+ )
861
+
862
+ def list_credential_providers(self, request, config=None):
863
+ """
864
+ list_credential_providers
865
+
866
+ :param request: Request entity containing all parameters
867
+ :type request: AgentidentityClientRequest
868
+ :param config: Optional request configuration override
869
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
870
+
871
+ :return: API response containing ListCredentialProvidersResponse data
872
+ :rtype: ListCredentialProvidersResponse
873
+
874
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
875
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
876
+ """
877
+ path = utils.append_uri(
878
+ AgentidentityClient.VERSION_V1,
879
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
880
+ AgentidentityClient.CONSTANT_CREDENTIAL_PROVIDER,
881
+ AgentidentityClient.CONSTANT_LIST,
882
+ )
883
+ headers = None
884
+ merged_config = self._create_request_with_host(request, config)
885
+ return self._send_request(
886
+ http_methods.POST,
887
+ path=path,
888
+ body=request.to_json_string(),
889
+ config=merged_config,
890
+ model=ListCredentialProvidersResponse,
891
+ )
892
+
893
+ def list_idp_configurations(self, request, config=None):
894
+ """
895
+ list_idp_configurations
896
+
897
+ :param request: Request entity containing all parameters
898
+ :type request: AgentidentityClientRequest
899
+ :param config: Optional request configuration override
900
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
901
+
902
+ :return: API response containing ListIdpConfigurationsResponse data
903
+ :rtype: ListIdpConfigurationsResponse
904
+
905
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
906
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
907
+ """
908
+ path = utils.append_uri(
909
+ AgentidentityClient.VERSION_V1,
910
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
911
+ AgentidentityClient.CONSTANT_USER_POOL,
912
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
913
+ AgentidentityClient.CONSTANT_LIST,
914
+ )
915
+ headers = None
916
+ merged_config = self._create_request_with_host(request, config)
917
+ return self._send_request(
918
+ http_methods.POST,
919
+ path=path,
920
+ body=request.to_json_string(),
921
+ config=merged_config,
922
+ model=ListIdpConfigurationsResponse,
923
+ )
924
+
925
+ def list_oauth2_clients(self, request, config=None):
926
+ """
927
+ list_oauth2_clients
928
+
929
+ :param request: Request entity containing all parameters
930
+ :type request: AgentidentityClientRequest
931
+ :param config: Optional request configuration override
932
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
933
+
934
+ :return: API response containing ListOauth2ClientsResponse data
935
+ :rtype: ListOauth2ClientsResponse
936
+
937
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
938
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
939
+ """
940
+ path = utils.append_uri(
941
+ AgentidentityClient.VERSION_V1,
942
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
943
+ AgentidentityClient.CONSTANT_USER_POOL,
944
+ AgentidentityClient.CONSTANT_OAUTH2_CLIENT,
945
+ AgentidentityClient.CONSTANT_LIST,
946
+ )
947
+ headers = None
948
+ merged_config = self._create_request_with_host(request, config)
949
+ return self._send_request(
950
+ http_methods.POST,
951
+ path=path,
952
+ body=request.to_json_string(),
953
+ config=merged_config,
954
+ model=ListOauth2ClientsResponse,
955
+ )
956
+
957
+ def list_user_pools(self, request, config=None):
958
+ """
959
+ list_user_pools
960
+
961
+ :param request: Request entity containing all parameters
962
+ :type request: AgentidentityClientRequest
963
+ :param config: Optional request configuration override
964
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
965
+
966
+ :return: API response containing ListUserPoolsResponse data
967
+ :rtype: ListUserPoolsResponse
968
+
969
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
970
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
971
+ """
972
+ path = utils.append_uri(
973
+ AgentidentityClient.VERSION_V1,
974
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
975
+ AgentidentityClient.CONSTANT_USER_POOL,
976
+ AgentidentityClient.CONSTANT_LIST,
977
+ )
978
+ headers = None
979
+ merged_config = self._create_request_with_host(request, config)
980
+ return self._send_request(
981
+ http_methods.POST,
982
+ path=path,
983
+ body=request.to_json_string(),
984
+ config=merged_config,
985
+ model=ListUserPoolsResponse,
986
+ )
987
+
988
+ def list_users(self, request, config=None):
989
+ """
990
+ list_users
991
+
992
+ :param request: Request entity containing all parameters
993
+ :type request: AgentidentityClientRequest
994
+ :param config: Optional request configuration override
995
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
996
+
997
+ :return: API response containing ListUsersResponse data
998
+ :rtype: ListUsersResponse
999
+
1000
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1001
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1002
+ """
1003
+ path = utils.append_uri(
1004
+ AgentidentityClient.VERSION_V1,
1005
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1006
+ AgentidentityClient.CONSTANT_USER_POOL,
1007
+ AgentidentityClient.CONSTANT_USER,
1008
+ AgentidentityClient.CONSTANT_LIST,
1009
+ )
1010
+ headers = None
1011
+ merged_config = self._create_request_with_host(request, config)
1012
+ return self._send_request(
1013
+ http_methods.POST, path=path, body=request.to_json_string(), config=merged_config, model=ListUsersResponse
1014
+ )
1015
+
1016
+ def o_idc_discovery(self, request, config=None):
1017
+ """
1018
+ o_idc_discovery
1019
+
1020
+ :param request: Request entity containing all parameters
1021
+ :type request: AgentidentityClientRequest
1022
+ :param config: Optional request configuration override
1023
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1024
+
1025
+ :return: API response
1026
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1027
+
1028
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1029
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1030
+ """
1031
+ path = utils.append_uri(
1032
+ AgentidentityClient.VERSION_V1,
1033
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1034
+ AgentidentityClient.CONSTANT_INBOUND,
1035
+ request.user_pool_id,
1036
+ AgentidentityClient.CONSTANT_WELL_KNOWN,
1037
+ AgentidentityClient.CONSTANT_OPENID_CONFIGURATION,
1038
+ )
1039
+ headers = None
1040
+ merged_config = self._create_request_with_host(request, config)
1041
+ return self._send_request(http_methods.GET, path=path, config=merged_config)
1042
+
1043
+ def oauth2idp_callback(self, request, config=None):
1044
+ """
1045
+ oauth2idp_callback
1046
+
1047
+ :param request: Request entity containing all parameters
1048
+ :type request: AgentidentityClientRequest
1049
+ :param config: Optional request configuration override
1050
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1051
+
1052
+ :return: API response
1053
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1054
+
1055
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1056
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1057
+ """
1058
+ path = utils.append_uri(
1059
+ AgentidentityClient.VERSION_V1,
1060
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1061
+ AgentidentityClient.CONSTANT_OAUTH2,
1062
+ AgentidentityClient.CONSTANT_CALLBACK,
1063
+ request.provider_id,
1064
+ )
1065
+ headers = None
1066
+ params = {}
1067
+ if request.code is not None:
1068
+ params['code'] = request.code
1069
+ if request.state is not None:
1070
+ params['state'] = request.state
1071
+ merged_config = self._create_request_with_host(request, config)
1072
+ return self._send_request(http_methods.GET, path=path, params=params, config=merged_config)
1073
+
1074
+ def reset_password(self, request, config=None):
1075
+ """
1076
+ reset_password
1077
+
1078
+ :param request: Request entity containing all parameters
1079
+ :type request: AgentidentityClientRequest
1080
+ :param config: Optional request configuration override
1081
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1082
+
1083
+ :return: API response
1084
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1085
+
1086
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1087
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1088
+ """
1089
+ path = utils.append_uri(
1090
+ AgentidentityClient.VERSION_V1,
1091
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1092
+ AgentidentityClient.CONSTANT_USER_POOL,
1093
+ AgentidentityClient.CONSTANT_USER,
1094
+ AgentidentityClient.CONSTANT_RESET_PASSWORD,
1095
+ )
1096
+ headers = None
1097
+ merged_config = self._create_request_with_host(request, config)
1098
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1099
+
1100
+ def token_endpoint(self, request, config=None):
1101
+ """
1102
+ token_endpoint
1103
+
1104
+ :param request: Request entity containing all parameters
1105
+ :type request: AgentidentityClientRequest
1106
+ :param config: Optional request configuration override
1107
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1108
+
1109
+ :return: API response
1110
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1111
+
1112
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1113
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1114
+ """
1115
+ path = utils.append_uri(
1116
+ AgentidentityClient.VERSION_V1,
1117
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1118
+ AgentidentityClient.CONSTANT_INBOUND,
1119
+ request.user_pool_id,
1120
+ AgentidentityClient.CONSTANT_TOKEN,
1121
+ )
1122
+ headers = None
1123
+ merged_config = self._create_request_with_host(request, config)
1124
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1125
+
1126
+ def update_agent(self, request, config=None):
1127
+ """
1128
+ update_agent
1129
+
1130
+ :param request: Request entity containing all parameters
1131
+ :type request: AgentidentityClientRequest
1132
+ :param config: Optional request configuration override
1133
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1134
+
1135
+ :return: API response
1136
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1137
+
1138
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1139
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1140
+ """
1141
+ path = utils.append_uri(
1142
+ AgentidentityClient.VERSION_V1,
1143
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1144
+ AgentidentityClient.CONSTANT_AGENT,
1145
+ AgentidentityClient.CONSTANT_UPDATE,
1146
+ )
1147
+ headers = None
1148
+ merged_config = self._create_request_with_host(request, config)
1149
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1150
+
1151
+ def update_credential_provider(self, request, config=None):
1152
+ """
1153
+ update_credential_provider
1154
+
1155
+ :param request: Request entity containing all parameters
1156
+ :type request: AgentidentityClientRequest
1157
+ :param config: Optional request configuration override
1158
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1159
+
1160
+ :return: API response
1161
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1162
+
1163
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1164
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1165
+ """
1166
+ path = utils.append_uri(
1167
+ AgentidentityClient.VERSION_V1,
1168
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1169
+ AgentidentityClient.CONSTANT_CREDENTIAL_PROVIDER,
1170
+ AgentidentityClient.CONSTANT_UPDATE,
1171
+ )
1172
+ headers = None
1173
+ merged_config = self._create_request_with_host(request, config)
1174
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1175
+
1176
+ def update_idp_configuration(self, request, config=None):
1177
+ """
1178
+ update_idp_configuration
1179
+
1180
+ :param request: Request entity containing all parameters
1181
+ :type request: AgentidentityClientRequest
1182
+ :param config: Optional request configuration override
1183
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1184
+
1185
+ :return: API response
1186
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1187
+
1188
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1189
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1190
+ """
1191
+ path = utils.append_uri(
1192
+ AgentidentityClient.VERSION_V1,
1193
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1194
+ AgentidentityClient.CONSTANT_USER_POOL,
1195
+ AgentidentityClient.CONSTANT_IDP_CONFIG,
1196
+ AgentidentityClient.CONSTANT_UPDATE,
1197
+ )
1198
+ headers = None
1199
+ merged_config = self._create_request_with_host(request, config)
1200
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1201
+
1202
+ def update_oauth2_client(self, request, config=None):
1203
+ """
1204
+ update_oauth2_client
1205
+
1206
+ :param request: Request entity containing all parameters
1207
+ :type request: AgentidentityClientRequest
1208
+ :param config: Optional request configuration override
1209
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1210
+
1211
+ :return: API response
1212
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1213
+
1214
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1215
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1216
+ """
1217
+ path = utils.append_uri(
1218
+ AgentidentityClient.VERSION_V1,
1219
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1220
+ AgentidentityClient.CONSTANT_USER_POOL,
1221
+ AgentidentityClient.CONSTANT_OAUTH2_CLIENT,
1222
+ AgentidentityClient.CONSTANT_UPDATE,
1223
+ )
1224
+ headers = None
1225
+ merged_config = self._create_request_with_host(request, config)
1226
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1227
+
1228
+ def update_user(self, request, config=None):
1229
+ """
1230
+ update_user
1231
+
1232
+ :param request: Request entity containing all parameters
1233
+ :type request: AgentidentityClientRequest
1234
+ :param config: Optional request configuration override
1235
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1236
+
1237
+ :return: API response
1238
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1239
+
1240
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1241
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1242
+ """
1243
+ path = utils.append_uri(
1244
+ AgentidentityClient.VERSION_V1,
1245
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1246
+ AgentidentityClient.CONSTANT_USER_POOL,
1247
+ AgentidentityClient.CONSTANT_USER,
1248
+ AgentidentityClient.CONSTANT_UPDATE,
1249
+ )
1250
+ headers = None
1251
+ merged_config = self._create_request_with_host(request, config)
1252
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1253
+
1254
+ def update_user_pool(self, request, config=None):
1255
+ """
1256
+ update_user_pool
1257
+
1258
+ :param request: Request entity containing all parameters
1259
+ :type request: AgentidentityClientRequest
1260
+ :param config: Optional request configuration override
1261
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1262
+
1263
+ :return: API response
1264
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1265
+
1266
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1267
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1268
+ """
1269
+ path = utils.append_uri(
1270
+ AgentidentityClient.VERSION_V1,
1271
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1272
+ AgentidentityClient.CONSTANT_USER_POOL,
1273
+ AgentidentityClient.CONSTANT_UPDATE,
1274
+ )
1275
+ headers = None
1276
+ merged_config = self._create_request_with_host(request, config)
1277
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=merged_config)
1278
+
1279
+ def userinfo_endpoint(self, request, config=None):
1280
+ """
1281
+ userinfo_endpoint
1282
+
1283
+ :param request: Request entity containing all parameters
1284
+ :type request: AgentidentityClientRequest
1285
+ :param config: Optional request configuration override
1286
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1287
+
1288
+ :return: API response containing UserinfoEndpointResponse data
1289
+ :rtype: UserinfoEndpointResponse
1290
+
1291
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
1292
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
1293
+ """
1294
+ path = utils.append_uri(
1295
+ AgentidentityClient.VERSION_V1,
1296
+ AgentidentityClient.CONSTANT_AGENT_IDENTITY,
1297
+ AgentidentityClient.CONSTANT_INBOUND,
1298
+ request.user_pool_id,
1299
+ AgentidentityClient.CONSTANT_USERINFO,
1300
+ )
1301
+ headers = None
1302
+ merged_config = self._create_request_with_host(request, config)
1303
+ return self._send_request(http_methods.GET, path=path, config=merged_config, model=UserinfoEndpointResponse)
1304
+
1305
+ def _merge_config(self, config=None):
1306
+ """
1307
+ :param config:
1308
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1309
+ """
1310
+ if config is None:
1311
+ return self.config
1312
+ else:
1313
+ new_config = copy.copy(self.config)
1314
+ new_config.merge_non_none_values(config)
1315
+ return new_config
1316
+
1317
+ def _send_request(
1318
+ self, http_method, path, body=None, headers=None, params=None, config=None, body_parser=None, model=None
1319
+ ):
1320
+ """
1321
+ Send an HTTP request to the service endpoint.
1322
+
1323
+ :param http_method: HTTP method (GET, POST, PUT, DELETE, etc.)
1324
+ :type http_method: bytes
1325
+ :param path: Request path
1326
+ :type path: bytes
1327
+ :param body: Optional request body
1328
+ :type body: str or bytes
1329
+ :param headers: Optional HTTP headers
1330
+ :type headers: dict
1331
+ :param params: Optional query parameters
1332
+ :type params: dict
1333
+ :param config: Optional request configuration override
1334
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
1335
+ :param body_parser: Optional custom body parser function
1336
+ :type body_parser: callable
1337
+ :param model: Optional response model class for deserialization
1338
+ :type model: class
1339
+
1340
+ :return: API response
1341
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
1342
+
1343
+ :raises BceClientError: Client error (network connection failure, SSL errors, etc.)
1344
+ :raises BceServerError: Server returned error response
1345
+ """
1346
+ config = self._merge_config(config)
1347
+ if body_parser is None:
1348
+ body_parser = handler.parse_json
1349
+ if headers is None:
1350
+ headers = {b'Accept': b'*/*', b'Content-Type': b'application/json;charset=utf-8'}
1351
+ return bce_http_client.send_request(
1352
+ config,
1353
+ bce_v1_signer.sign,
1354
+ [handler.parse_error, body_parser],
1355
+ http_method,
1356
+ path,
1357
+ body,
1358
+ headers,
1359
+ params,
1360
+ model=model,
1361
+ )