baiducloud-python-sdk-rds 0.0.2__py3-none-any.whl → 0.0.3__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 (21) hide show
  1. baiducloud_python_sdk_rds/__init__.py +1 -1
  2. baiducloud_python_sdk_rds/api/rds_client.py +98 -1
  3. baiducloud_python_sdk_rds/models/__init__.py +12 -0
  4. baiducloud_python_sdk_rds/models/billing.py +66 -0
  5. baiducloud_python_sdk_rds/models/create_a_primary_instance_request.py +345 -0
  6. baiducloud_python_sdk_rds/models/create_a_primary_instance_response.py +69 -0
  7. baiducloud_python_sdk_rds/models/create_a_proxy_instance_request.py +162 -0
  8. baiducloud_python_sdk_rds/models/create_a_proxy_instance_response.py +69 -0
  9. baiducloud_python_sdk_rds/models/create_read_only_instance_request.py +252 -0
  10. baiducloud_python_sdk_rds/models/create_read_only_instance_response.py +70 -0
  11. baiducloud_python_sdk_rds/models/initial_data_reference.py +82 -0
  12. baiducloud_python_sdk_rds/models/recovery_to_source_instance_model.py +84 -0
  13. baiducloud_python_sdk_rds/models/subnet_map.py +66 -0
  14. baiducloud_python_sdk_rds/models/table.py +66 -0
  15. baiducloud_python_sdk_rds/models/tag.py +66 -0
  16. {baiducloud_python_sdk_rds-0.0.2.dist-info → baiducloud_python_sdk_rds-0.0.3.dist-info}/METADATA +1 -1
  17. baiducloud_python_sdk_rds-0.0.3.dist-info/RECORD +25 -0
  18. baiducloud_python_sdk_rds-0.0.2.dist-info/RECORD +0 -13
  19. {baiducloud_python_sdk_rds-0.0.2.dist-info → baiducloud_python_sdk_rds-0.0.3.dist-info}/LICENSE +0 -0
  20. {baiducloud_python_sdk_rds-0.0.2.dist-info → baiducloud_python_sdk_rds-0.0.3.dist-info}/WHEEL +0 -0
  21. {baiducloud_python_sdk_rds-0.0.2.dist-info → baiducloud_python_sdk_rds-0.0.3.dist-info}/top_level.txt +0 -0
@@ -2,4 +2,4 @@
2
2
  This module defines some common string constants.
3
3
  """
4
4
 
5
- SDK_VERSION = b'0.0.2'
5
+ SDK_VERSION = b'0.0.3'
@@ -11,6 +11,9 @@ from baiducloud_python_sdk_core.http import bce_http_client
11
11
  from baiducloud_python_sdk_core.http import handler
12
12
  from baiducloud_python_sdk_core.http import http_methods
13
13
  from baiducloud_python_sdk_core.util import request_body_utils
14
+ from baiducloud_python_sdk_rds.models.create_a_primary_instance_response import CreateAPrimaryInstanceResponse
15
+ from baiducloud_python_sdk_rds.models.create_a_proxy_instance_response import CreateAProxyInstanceResponse
16
+ from baiducloud_python_sdk_rds.models.create_read_only_instance_response import CreateReadOnlyInstanceResponse
14
17
  from baiducloud_python_sdk_rds.models.query_task_list_response import QueryTaskListResponse
15
18
 
16
19
  _logger = logging.getLogger(__name__)
@@ -21,10 +24,12 @@ class RdsClient(BceBaseClient):
21
24
  rds base sdk client
22
25
  """
23
26
 
24
- CONSTANT_V1 = b'v1'
27
+ VERSION_V1 = b'/v1'
25
28
 
26
29
  CONSTANT_INSTANCE = b'instance'
27
30
 
31
+ CONSTANT_V1 = b'v1'
32
+
28
33
  CONSTANT_TASK = b'task'
29
34
 
30
35
  def __init__(self, config=None):
@@ -36,6 +41,98 @@ class RdsClient(BceBaseClient):
36
41
  """
37
42
  bce_base_client.BceBaseClient.__init__(self, config)
38
43
 
44
+ def create_a_primary_instance(self, request, config=None):
45
+ """
46
+ create_a_primary_instance
47
+
48
+ :param request: Request entity containing all parameters
49
+ :type request: RdsClientRequest
50
+ :param config: Optional request configuration override
51
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
52
+
53
+ :return: API response containing CreateAPrimaryInstanceResponse data
54
+ :rtype: CreateAPrimaryInstanceResponse
55
+
56
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
57
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
58
+ """
59
+ path = utils.append_uri(RdsClient.VERSION_V1, RdsClient.CONSTANT_INSTANCE)
60
+ headers = None
61
+ params = {}
62
+ if request.client_token is not None:
63
+ params['clientToken'] = request.client_token
64
+ merged_config = self._create_request_with_host(request, config)
65
+ return self._send_request(
66
+ http_methods.POST,
67
+ path=path,
68
+ body=request.to_json_string(),
69
+ params=params,
70
+ config=merged_config,
71
+ model=CreateAPrimaryInstanceResponse,
72
+ )
73
+
74
+ def create_a_proxy_instance(self, request, config=None):
75
+ """
76
+ create_a_proxy_instance
77
+
78
+ :param request: Request entity containing all parameters
79
+ :type request: RdsClientRequest
80
+ :param config: Optional request configuration override
81
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
82
+
83
+ :return: API response containing CreateAProxyInstanceResponse data
84
+ :rtype: CreateAProxyInstanceResponse
85
+
86
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
87
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
88
+ """
89
+ path = utils.append_uri(RdsClient.VERSION_V1, RdsClient.CONSTANT_INSTANCE)
90
+ headers = None
91
+ params = {}
92
+ params['rdsproxy'] = None
93
+ if request.client_token is not None:
94
+ params['clientToken'] = request.client_token
95
+ merged_config = self._create_request_with_host(request, config)
96
+ return self._send_request(
97
+ http_methods.POST,
98
+ path=path,
99
+ body=request.to_json_string(),
100
+ params=params,
101
+ config=merged_config,
102
+ model=CreateAProxyInstanceResponse,
103
+ )
104
+
105
+ def create_read_only_instance(self, request, config=None):
106
+ """
107
+ create_read_only_instance
108
+
109
+ :param request: Request entity containing all parameters
110
+ :type request: RdsClientRequest
111
+ :param config: Optional request configuration override
112
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
113
+
114
+ :return: API response containing CreateReadOnlyInstanceResponse data
115
+ :rtype: CreateReadOnlyInstanceResponse
116
+
117
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
118
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
119
+ """
120
+ path = utils.append_uri(RdsClient.VERSION_V1, RdsClient.CONSTANT_INSTANCE)
121
+ headers = None
122
+ params = {}
123
+ params['readReplica'] = None
124
+ if request.client_token is not None:
125
+ params['clientToken'] = request.client_token
126
+ merged_config = self._create_request_with_host(request, config)
127
+ return self._send_request(
128
+ http_methods.POST,
129
+ path=path,
130
+ body=request.to_json_string(),
131
+ params=params,
132
+ config=merged_config,
133
+ model=CreateReadOnlyInstanceResponse,
134
+ )
135
+
39
136
  def query_task_list(self, request, config=None):
40
137
  """
41
138
  query_task_list
@@ -2,7 +2,19 @@
2
2
  Models for rds SDK.
3
3
  """
4
4
 
5
+ from .billing import Billing
6
+ from .create_a_primary_instance_request import CreateAPrimaryInstanceRequest
7
+ from .create_a_primary_instance_response import CreateAPrimaryInstanceResponse
8
+ from .create_a_proxy_instance_request import CreateAProxyInstanceRequest
9
+ from .create_a_proxy_instance_response import CreateAProxyInstanceResponse
10
+ from .create_read_only_instance_request import CreateReadOnlyInstanceRequest
11
+ from .create_read_only_instance_response import CreateReadOnlyInstanceResponse
12
+ from .initial_data_reference import InitialDataReference
5
13
  from .progress import Progress
6
14
  from .query_task_list_request import QueryTaskListRequest
7
15
  from .query_task_list_response import QueryTaskListResponse
16
+ from .recovery_to_source_instance_model import RecoveryToSourceInstanceModel
17
+ from .subnet_map import SubnetMap
18
+ from .table import Table
19
+ from .tag import Tag
8
20
  from .task import Task
@@ -0,0 +1,66 @@
1
+ """
2
+ Billing information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Billing(AbstractModel):
9
+ """
10
+ Billing
11
+ """
12
+
13
+ def __init__(self, payment_timing=None, reservation=None):
14
+ """
15
+ Initialize Billing instance.
16
+
17
+ :param payment_timing: 付款方式(后付费:Postpaid;只读实例只支持后付费)
18
+ :type payment_timing: str (optional)
19
+
20
+ :param reservation:
21
+ :type reservation: object (optional)
22
+ """
23
+ super().__init__()
24
+ self.payment_timing = payment_timing
25
+ self.reservation = reservation
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the model instance to a dictionary representation.
30
+
31
+ Nested model objects are recursively converted to dictionaries.
32
+
33
+ :return: Dictionary representation of the model
34
+ :rtype: dict
35
+ """
36
+ _map = super().to_dict()
37
+ if _map is not None:
38
+ return _map
39
+ result = dict()
40
+ if self.payment_timing is not None:
41
+ result['paymentTiming'] = self.payment_timing
42
+ if self.reservation is not None:
43
+ result['reservation'] = self.reservation
44
+ return result
45
+
46
+ def from_dict(self, m):
47
+ """
48
+ Populate the model instance from a dictionary.
49
+
50
+ Nested dictionaries are recursively converted to model objects.
51
+
52
+ :param m: Dictionary containing model data
53
+ :type m: dict
54
+
55
+ :return: Self reference for method chaining
56
+ :rtype: Billing
57
+
58
+ :raises TypeError: If input is not a dictionary type
59
+ :raises ValueError: If nested model conversion fails
60
+ """
61
+ m = m or dict()
62
+ if m.get('paymentTiming') is not None:
63
+ self.payment_timing = m.get('paymentTiming')
64
+ if m.get('reservation') is not None:
65
+ self.reservation = m.get('reservation')
66
+ return self
@@ -0,0 +1,345 @@
1
+ """
2
+ Request entity for CreateAPrimaryInstanceRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+ from baiducloud_python_sdk_rds.models.billing import Billing
7
+ from baiducloud_python_sdk_rds.models.subnet_map import SubnetMap
8
+ from baiducloud_python_sdk_rds.models.tag import Tag
9
+ from baiducloud_python_sdk_rds.models.initial_data_reference import InitialDataReference
10
+ from baiducloud_python_sdk_rds.models.recovery_to_source_instance_model import RecoveryToSourceInstanceModel
11
+
12
+
13
+ class CreateAPrimaryInstanceRequest(AbstractModel):
14
+ """
15
+ Request entity for CreateAPrimaryInstanceRequest operation.
16
+
17
+ This class encapsulates all parameters for the API request.
18
+ """
19
+
20
+ def __init__(
21
+ self,
22
+ billing,
23
+ engine,
24
+ engine_version,
25
+ cpu_count,
26
+ memory_capacity,
27
+ volume_capacity,
28
+ disk_io_type,
29
+ vpc_id,
30
+ initial_data_reference,
31
+ client_token=None,
32
+ purchase_count=None,
33
+ instance_name=None,
34
+ category=None,
35
+ zone_names=None,
36
+ bcm_group_name=None,
37
+ is_direct_pay=None,
38
+ subnets=None,
39
+ tags=None,
40
+ bgw_group_id=None,
41
+ bgw_group_exclusive=None,
42
+ character_set_name=None,
43
+ auto_renew_time_unit=None,
44
+ auto_renew_time=None,
45
+ lower_case_table_names=None,
46
+ parameter_template_id=None,
47
+ ovip=None,
48
+ entry_port=None,
49
+ replication_type=None,
50
+ resource_group_id=None,
51
+ data=None,
52
+ leader_instance_id=None,
53
+ resource_type=None,
54
+ ):
55
+ """
56
+ Initialize CreateAPrimaryInstanceRequest request entity.
57
+
58
+ :param client_token: client_token parameter
59
+ :type client_token: str (optional)
60
+
61
+ :param billing: billing parameter
62
+ :type billing: Billing (required)
63
+
64
+ :param purchase_count: 批量创建云数据库 RDS 实例个数, 最大不超过10;默认1
65
+ :type purchase_count: int (optional)
66
+
67
+ :param instance_name: instance_name parameter
68
+ :type instance_name: str (optional)
69
+
70
+ :param engine: engine parameter
71
+ :type engine: str (required)
72
+
73
+ :param engine_version: engine_version parameter
74
+ :type engine_version: str (required)
75
+
76
+ :param category: category parameter
77
+ :type category: str (optional)
78
+
79
+ :param cpu_count: cpu_count parameter
80
+ :type cpu_count: int (required)
81
+
82
+ :param memory_capacity: memory_capacity parameter
83
+ :type memory_capacity: int (required)
84
+
85
+ :param volume_capacity: volume_capacity parameter
86
+ :type volume_capacity: int (required)
87
+
88
+ :param disk_io_type: disk_io_type parameter
89
+ :type disk_io_type: str (required)
90
+
91
+ :param zone_names: zone_names parameter
92
+ :type zone_names: List[str] (optional)
93
+
94
+ :param bcm_group_name: 默认为空,代表bcm实例组名称
95
+ :type bcm_group_name: str (optional)
96
+
97
+ :param vpc_id: vpc_id parameter
98
+ :type vpc_id: str (required)
99
+
100
+ :param is_direct_pay: 是否进行直接支付,默认false,设置为直接支付的变配订单会直接扣款,不需要在走支付逻辑
101
+ :type is_direct_pay: bool (optional)
102
+
103
+ :param subnets: subnets parameter
104
+ :type subnets: List[SubnetMap] (optional)
105
+
106
+ :param tags: 实例绑定的标签信息
107
+ :type tags: List[Tag] (optional)
108
+
109
+ :param bgw_group_id: bgw_group_id parameter
110
+ :type bgw_group_id: str (optional)
111
+
112
+ :param bgw_group_exclusive: 负载均衡集群属性,true表示指定专属集群,false表示使用共享集群
113
+ :type bgw_group_exclusive: bool (optional)
114
+
115
+ :param character_set_name: character_set_name parameter
116
+ :type character_set_name: str (optional)
117
+
118
+ :param auto_renew_time_unit: 自动续费单位(\"year\";\"month\")
119
+ :type auto_renew_time_unit: str (optional)
120
+
121
+ :param auto_renew_time: 自动续费时长(续费单位为year 不大于3,续费单位为month 不大于9)
122
+ :type auto_renew_time: int (optional)
123
+
124
+ :param lower_case_table_names: 表名是否区分大小写。默认为0,表示大小写敏感,区分大小写;传1表示不区分大小写
125
+ :type lower_case_table_names: int (optional)
126
+
127
+ :param parameter_template_id: 参数模板ID
128
+ :type parameter_template_id: str (optional)
129
+
130
+ :param ovip: ovip parameter
131
+ :type ovip: str (optional)
132
+
133
+ :param entry_port: entry_port parameter
134
+ :type entry_port: int (optional)
135
+
136
+ :param replication_type: 数据复制方式。异步复制:async,半同步复制:semi\\_sync
137
+ :type replication_type: str (optional)
138
+
139
+ :param resource_group_id: 资源分组ID。例如:RESG-bKMxbExtnoG
140
+ :type resource_group_id: str (optional)
141
+
142
+ :param initial_data_reference: initial_data_reference parameter
143
+ :type initial_data_reference: InitialDataReference (required)
144
+
145
+ :param data: 库表恢复到新实例,恢复的库表信息
146
+ :type data: List[RecoveryToSourceInstanceModel] (optional)
147
+
148
+ :param leader_instance_id: leader_instance_id parameter
149
+ :type leader_instance_id: str (optional)
150
+
151
+ :param resource_type: resource_type parameter
152
+ :type resource_type: str (optional)
153
+ """
154
+ super().__init__()
155
+ self.client_token = client_token
156
+ self.billing = billing
157
+ self.purchase_count = purchase_count
158
+ self.instance_name = instance_name
159
+ self.engine = engine
160
+ self.engine_version = engine_version
161
+ self.category = category
162
+ self.cpu_count = cpu_count
163
+ self.memory_capacity = memory_capacity
164
+ self.volume_capacity = volume_capacity
165
+ self.disk_io_type = disk_io_type
166
+ self.zone_names = zone_names
167
+ self.bcm_group_name = bcm_group_name
168
+ self.vpc_id = vpc_id
169
+ self.is_direct_pay = is_direct_pay
170
+ self.subnets = subnets
171
+ self.tags = tags
172
+ self.bgw_group_id = bgw_group_id
173
+ self.bgw_group_exclusive = bgw_group_exclusive
174
+ self.character_set_name = character_set_name
175
+ self.auto_renew_time_unit = auto_renew_time_unit
176
+ self.auto_renew_time = auto_renew_time
177
+ self.lower_case_table_names = lower_case_table_names
178
+ self.parameter_template_id = parameter_template_id
179
+ self.ovip = ovip
180
+ self.entry_port = entry_port
181
+ self.replication_type = replication_type
182
+ self.resource_group_id = resource_group_id
183
+ self.initial_data_reference = initial_data_reference
184
+ self.data = data
185
+ self.leader_instance_id = leader_instance_id
186
+ self.resource_type = resource_type
187
+
188
+ def to_dict(self):
189
+ """
190
+ Convert the request entity to a dictionary representation.
191
+
192
+ Nested model objects are recursively converted to dictionaries.
193
+
194
+ :return: Dictionary representation of the request
195
+ :rtype: dict
196
+ """
197
+ _map = super().to_dict()
198
+ if _map is not None:
199
+ return _map
200
+ result = dict()
201
+ if self.billing is not None:
202
+ result['billing'] = self.billing.to_dict()
203
+ if self.purchase_count is not None:
204
+ result['purchaseCount'] = self.purchase_count
205
+ if self.instance_name is not None:
206
+ result['instanceName'] = self.instance_name
207
+ if self.engine is not None:
208
+ result['engine'] = self.engine
209
+ if self.engine_version is not None:
210
+ result['engineVersion'] = self.engine_version
211
+ if self.category is not None:
212
+ result['category'] = self.category
213
+ if self.cpu_count is not None:
214
+ result['cpuCount'] = self.cpu_count
215
+ if self.memory_capacity is not None:
216
+ result['memoryCapacity'] = self.memory_capacity
217
+ if self.volume_capacity is not None:
218
+ result['volumeCapacity'] = self.volume_capacity
219
+ if self.disk_io_type is not None:
220
+ result['diskIoType'] = self.disk_io_type
221
+ if self.zone_names is not None:
222
+ result['zoneNames'] = self.zone_names
223
+ if self.bcm_group_name is not None:
224
+ result['bcmGroupName'] = self.bcm_group_name
225
+ if self.vpc_id is not None:
226
+ result['vpcId'] = self.vpc_id
227
+ if self.is_direct_pay is not None:
228
+ result['isDirectPay'] = self.is_direct_pay
229
+ if self.subnets is not None:
230
+ result['subnets'] = [i.to_dict() for i in self.subnets]
231
+ if self.tags is not None:
232
+ result['tags'] = [i.to_dict() for i in self.tags]
233
+ if self.bgw_group_id is not None:
234
+ result['bgwGroupId'] = self.bgw_group_id
235
+ if self.bgw_group_exclusive is not None:
236
+ result['bgwGroupExclusive'] = self.bgw_group_exclusive
237
+ if self.character_set_name is not None:
238
+ result['characterSetName'] = self.character_set_name
239
+ if self.auto_renew_time_unit is not None:
240
+ result['autoRenewTimeUnit'] = self.auto_renew_time_unit
241
+ if self.auto_renew_time is not None:
242
+ result['autoRenewTime'] = self.auto_renew_time
243
+ if self.lower_case_table_names is not None:
244
+ result['lowerCaseTableNames'] = self.lower_case_table_names
245
+ if self.parameter_template_id is not None:
246
+ result['parameterTemplateId'] = self.parameter_template_id
247
+ if self.ovip is not None:
248
+ result['ovip'] = self.ovip
249
+ if self.entry_port is not None:
250
+ result['entryPort'] = self.entry_port
251
+ if self.replication_type is not None:
252
+ result['replicationType'] = self.replication_type
253
+ if self.resource_group_id is not None:
254
+ result['resourceGroupId'] = self.resource_group_id
255
+ if self.initial_data_reference is not None:
256
+ result['initialDataReference'] = self.initial_data_reference.to_dict()
257
+ if self.data is not None:
258
+ result['data'] = [i.to_dict() for i in self.data]
259
+ if self.leader_instance_id is not None:
260
+ result['leaderInstanceId'] = self.leader_instance_id
261
+ if self.resource_type is not None:
262
+ result['resourceType'] = self.resource_type
263
+ return result
264
+
265
+ def from_dict(self, m):
266
+ """
267
+ Populate the request entity from a dictionary.
268
+
269
+ Nested dictionaries are recursively converted to model objects.
270
+
271
+ :param m: Dictionary containing request data
272
+ :type m: dict
273
+
274
+ :return: Self reference for method chaining
275
+ :rtype: CreateAPrimaryInstanceRequest
276
+
277
+ :raises TypeError: If input is not a dictionary or field type mismatch
278
+ :raises ValueError: If nested model conversion fails
279
+ """
280
+ m = m or dict()
281
+ if m.get('clientToken') is not None:
282
+ self.client_token = m.get('clientToken')
283
+ if m.get('billing') is not None:
284
+ self.billing = Billing().from_dict(m.get('billing'))
285
+ if m.get('purchaseCount') is not None:
286
+ self.purchase_count = m.get('purchaseCount')
287
+ if m.get('instanceName') is not None:
288
+ self.instance_name = m.get('instanceName')
289
+ if m.get('engine') is not None:
290
+ self.engine = m.get('engine')
291
+ if m.get('engineVersion') is not None:
292
+ self.engine_version = m.get('engineVersion')
293
+ if m.get('category') is not None:
294
+ self.category = m.get('category')
295
+ if m.get('cpuCount') is not None:
296
+ self.cpu_count = m.get('cpuCount')
297
+ if m.get('memoryCapacity') is not None:
298
+ self.memory_capacity = m.get('memoryCapacity')
299
+ if m.get('volumeCapacity') is not None:
300
+ self.volume_capacity = m.get('volumeCapacity')
301
+ if m.get('diskIoType') is not None:
302
+ self.disk_io_type = m.get('diskIoType')
303
+ if m.get('zoneNames') is not None:
304
+ self.zone_names = m.get('zoneNames')
305
+ if m.get('bcmGroupName') is not None:
306
+ self.bcm_group_name = m.get('bcmGroupName')
307
+ if m.get('vpcId') is not None:
308
+ self.vpc_id = m.get('vpcId')
309
+ if m.get('isDirectPay') is not None:
310
+ self.is_direct_pay = m.get('isDirectPay')
311
+ if m.get('subnets') is not None:
312
+ self.subnets = [SubnetMap().from_dict(i) for i in m.get('subnets')]
313
+ if m.get('tags') is not None:
314
+ self.tags = [Tag().from_dict(i) for i in m.get('tags')]
315
+ if m.get('bgwGroupId') is not None:
316
+ self.bgw_group_id = m.get('bgwGroupId')
317
+ if m.get('bgwGroupExclusive') is not None:
318
+ self.bgw_group_exclusive = m.get('bgwGroupExclusive')
319
+ if m.get('characterSetName') is not None:
320
+ self.character_set_name = m.get('characterSetName')
321
+ if m.get('autoRenewTimeUnit') is not None:
322
+ self.auto_renew_time_unit = m.get('autoRenewTimeUnit')
323
+ if m.get('autoRenewTime') is not None:
324
+ self.auto_renew_time = m.get('autoRenewTime')
325
+ if m.get('lowerCaseTableNames') is not None:
326
+ self.lower_case_table_names = m.get('lowerCaseTableNames')
327
+ if m.get('parameterTemplateId') is not None:
328
+ self.parameter_template_id = m.get('parameterTemplateId')
329
+ if m.get('ovip') is not None:
330
+ self.ovip = m.get('ovip')
331
+ if m.get('entryPort') is not None:
332
+ self.entry_port = m.get('entryPort')
333
+ if m.get('replicationType') is not None:
334
+ self.replication_type = m.get('replicationType')
335
+ if m.get('resourceGroupId') is not None:
336
+ self.resource_group_id = m.get('resourceGroupId')
337
+ if m.get('initialDataReference') is not None:
338
+ self.initial_data_reference = InitialDataReference().from_dict(m.get('initialDataReference'))
339
+ if m.get('data') is not None:
340
+ self.data = [RecoveryToSourceInstanceModel().from_dict(i) for i in m.get('data')]
341
+ if m.get('leaderInstanceId') is not None:
342
+ self.leader_instance_id = m.get('leaderInstanceId')
343
+ if m.get('resourceType') is not None:
344
+ self.resource_type = m.get('resourceType')
345
+ return self
@@ -0,0 +1,69 @@
1
+ """
2
+ Request entity for CreateAPrimaryInstanceResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class CreateAPrimaryInstanceResponse(BceResponse):
9
+ """
10
+ CreateAPrimaryInstanceResponse
11
+ """
12
+
13
+ def __init__(self, instance_ids=None, order_id=None):
14
+ """
15
+ Initialize CreateAPrimaryInstanceResponse response.
16
+
17
+ :param instance_ids: 由InstanceId组成的数组
18
+ :type instance_ids: List[str] (optional)
19
+
20
+ :param order_id: 订单 ID
21
+ :type order_id: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.instance_ids = instance_ids
25
+ self.order_id = order_id
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the response instance to a dictionary representation.
30
+
31
+ Includes metadata from the parent BceResponse class.
32
+ Nested model objects are recursively converted to dictionaries.
33
+
34
+ :return: Dictionary representation of the response
35
+ :rtype: dict
36
+ """
37
+ _map = super().to_dict()
38
+ if _map is not None:
39
+ return _map
40
+ result = dict()
41
+ if self.metadata is not None:
42
+ result['metadata'] = dict(self.metadata)
43
+ if self.instance_ids is not None:
44
+ result['instanceIds'] = self.instance_ids
45
+ if self.order_id is not None:
46
+ result['orderId'] = self.order_id
47
+ return result
48
+
49
+ def from_dict(self, m):
50
+ """
51
+ Populate the response instance from a dictionary.
52
+
53
+ Nested dictionaries are recursively converted to model objects.
54
+
55
+ :param m: Dictionary containing response data
56
+ :type m: dict
57
+
58
+ :return: Self reference for method chaining
59
+ :rtype: CreateAPrimaryInstanceResponse
60
+
61
+ :raises TypeError: If input is not a dictionary or field type mismatch
62
+ :raises ValueError: If nested model conversion fails
63
+ """
64
+ m = m or dict()
65
+ if m.get('instanceIds') is not None:
66
+ self.instance_ids = m.get('instanceIds')
67
+ if m.get('orderId') is not None:
68
+ self.order_id = m.get('orderId')
69
+ return self