baiducloud-python-sdk-blb 0.0.1__tar.gz

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 (29) hide show
  1. baiducloud_python_sdk_blb-0.0.1/ChangeLog.md +2 -0
  2. baiducloud_python_sdk_blb-0.0.1/LICENSE +177 -0
  3. baiducloud_python_sdk_blb-0.0.1/MANIFEST.in +2 -0
  4. baiducloud_python_sdk_blb-0.0.1/PKG-INFO +85 -0
  5. baiducloud_python_sdk_blb-0.0.1/README-CN.md +38 -0
  6. baiducloud_python_sdk_blb-0.0.1/README.md +38 -0
  7. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/__init__.py +5 -0
  8. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/api/__init__.py +0 -0
  9. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/api/blb_client.py +257 -0
  10. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/__init__.py +0 -0
  11. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing.py +76 -0
  12. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing_change_cancel_to_post_blb_request.py +64 -0
  13. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing_change_post_to_pre_blb_request.py +90 -0
  14. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing_change_post_to_pre_blb_response.py +61 -0
  15. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing_change_pre_to_post_blb_request.py +92 -0
  16. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/billing_change_pre_to_post_blb_response.py +61 -0
  17. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/blb_inquiry_request.py +88 -0
  18. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/refund_blb_request.py +64 -0
  19. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/reservation.py +58 -0
  20. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/resize_blb_request.py +74 -0
  21. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/models/resize_blb_response.py +61 -0
  22. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb/setup.py +71 -0
  23. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb.egg-info/PKG-INFO +85 -0
  24. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb.egg-info/SOURCES.txt +28 -0
  25. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb.egg-info/dependency_links.txt +1 -0
  26. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb.egg-info/requires.txt +3 -0
  27. baiducloud_python_sdk_blb-0.0.1/baiducloud_python_sdk_blb.egg-info/top_level.txt +1 -0
  28. baiducloud_python_sdk_blb-0.0.1/setup.cfg +7 -0
  29. baiducloud_python_sdk_blb-0.0.1/setup.py +73 -0
@@ -0,0 +1,2 @@
1
+ 2026-03-20 Version: 0.0.1
2
+ - 【blb】python sdk自动生成
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,2 @@
1
+ include LICENSE
2
+ include *.md
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: baiducloud-python-sdk-blb
3
+ Version: 0.0.1
4
+ Summary: Baidu Cloud blbApi SDK Library for Python
5
+ Home-page: https://github.com/baidubce/baiducloud-python-sdk
6
+ Author: Baidu Cloud SDK
7
+ Author-email:
8
+ License: Apache License 2.0
9
+ Project-URL: Source, https://github.com/baidubce/baiducloud-python-sdk
10
+ Project-URL: Documentation, https://github.com/baidubce/baiducloud-python-sdk/tree/master/docs
11
+ Project-URL: Changelog, https://github.com/baidubce/baiducloud-python-sdk/blob/master/baiducloud-python-sdk-blb/ChangeLog.md
12
+ Keywords: baiducloud,blb
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 2
18
+ Classifier: Programming Language :: Python :: 2.7
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.3
21
+ Classifier: Programming Language :: Python :: 3.4
22
+ Classifier: Programming Language :: Python :: 3.5
23
+ Classifier: Programming Language :: Python :: 3.6
24
+ Classifier: Programming Language :: Python :: 3.7
25
+ Classifier: Programming Language :: Python :: 3.8
26
+ Classifier: Programming Language :: Python :: 3.9
27
+ Classifier: Programming Language :: Python :: 3.10
28
+ Classifier: Programming Language :: Python :: 3.11
29
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: pycryptodome>=3.8.0
33
+ Requires-Dist: future>=0.6.0
34
+ Requires-Dist: six>=1.4.0
35
+ Dynamic: author
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: project-url
44
+ Dynamic: requires-dist
45
+ Dynamic: requires-python
46
+ Dynamic: summary
47
+
48
+ English | [简体中文](README-CN.md)
49
+
50
+ ## Baidu Cloud blbApi SDK for Python
51
+
52
+ ## Requirements
53
+
54
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
55
+
56
+ ## Installation
57
+
58
+ - **Install with pip**
59
+
60
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
61
+
62
+ ```bash
63
+ # Install the baiducloud_python_sdk_blb
64
+ pip install baiducloud_python_sdk_blb
65
+ ```
66
+
67
+ ## Issues
68
+
69
+ [Opening an Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
70
+
71
+ ## Usage
72
+
73
+ [Quick Examples](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-EN.md)
74
+
75
+ ## Changelog
76
+
77
+ Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
78
+
79
+ ## References
80
+
81
+ - [Latest Release](https://github.com/baidubce/baiducloud-python-sdk)
82
+
83
+ ## License
84
+
85
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,38 @@
1
+ [English](README.md) | 简体中文
2
+
3
+ ## Baidu Cloud blbApi SDK for Python
4
+
5
+ ## 要求
6
+
7
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
8
+
9
+ ## 安装
10
+
11
+ - **使用 pip 安装(推荐)**
12
+
13
+ 如未安装 `pip`, 请先至pip官网 [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") 安装pip .
14
+
15
+ ```bash
16
+ # 安装 baiducloud_python_sdk_blb
17
+ pip install baiducloud_python_sdk_blb
18
+ ```
19
+
20
+ ## 问题
21
+
22
+ [提交 Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new),不符合指南的问题可能会立即关闭。
23
+
24
+ ## 使用说明
25
+
26
+ [快速使用](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-CN.md)
27
+
28
+ ## 发行说明
29
+
30
+ 每个版本的详细更改记录在[发行说明](./ChangeLog.md)中。
31
+
32
+ ## 相关
33
+
34
+ - [最新源码](https://github.com/baidubce/baiducloud-python-sdk)
35
+
36
+ ## 许可证
37
+
38
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,38 @@
1
+ English | [简体中文](README-CN.md)
2
+
3
+ ## Baidu Cloud blbApi SDK for Python
4
+
5
+ ## Requirements
6
+
7
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
8
+
9
+ ## Installation
10
+
11
+ - **Install with pip**
12
+
13
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
14
+
15
+ ```bash
16
+ # Install the baiducloud_python_sdk_blb
17
+ pip install baiducloud_python_sdk_blb
18
+ ```
19
+
20
+ ## Issues
21
+
22
+ [Opening an Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
23
+
24
+ ## Usage
25
+
26
+ [Quick Examples](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-EN.md)
27
+
28
+ ## Changelog
29
+
30
+ Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
31
+
32
+ ## References
33
+
34
+ - [Latest Release](https://github.com/baidubce/baiducloud-python-sdk)
35
+
36
+ ## License
37
+
38
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,5 @@
1
+ """
2
+ This module defines some common string constants.
3
+ """
4
+
5
+ SDK_VERSION = b'0.0.1'
@@ -0,0 +1,257 @@
1
+ """
2
+ Example for blb 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_blb.models.billing_change_post_to_pre_blb_response import BillingChangePostToPreBlbResponse
15
+ from baiducloud_python_sdk_blb.models.billing_change_pre_to_post_blb_response import BillingChangePreToPostBlbResponse
16
+ from baiducloud_python_sdk_blb.models.resize_blb_response import ResizeBlbResponse
17
+
18
+ _logger = logging.getLogger(__name__)
19
+
20
+
21
+ class BlbClient(BceBaseClient):
22
+ """
23
+ blb base sdk client
24
+ """
25
+
26
+ VERSION_V1 = b'/v1'
27
+
28
+ CONSTANT_BLB = b'blb'
29
+
30
+ CONSTANT_CHARGE = b'charge'
31
+
32
+ CONSTANT_PRICE = b'price'
33
+
34
+ CONSTANT_REFUND = b'refund'
35
+
36
+ def __init__(self, config=None):
37
+ """
38
+ Initialize the blb client.
39
+
40
+ :param config: Client configuration
41
+ :type config: baidubce.BceClientConfiguration
42
+ """
43
+ bce_base_client.BceBaseClient.__init__(self, config)
44
+
45
+ def billing_change_cancel_to_post_blb(self, request, config=None):
46
+ """
47
+ billing_change_cancel_to_post_blb
48
+
49
+ :param request: Request entity containing all parameters
50
+ :type request: BlbClientRequest
51
+ :param config: Optional request configuration override
52
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
53
+
54
+ :return: API response
55
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
56
+
57
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
58
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
59
+ """
60
+ path = utils.append_uri(
61
+ BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, request.blb_id, BlbClient.CONSTANT_CHARGE
62
+ )
63
+ params = {}
64
+ params['action'] = 'CANCEL_TO_POSTPAY'
65
+ if request.client_token is not None:
66
+ params['clientToken'] = request.client_token
67
+ return self._send_request(http_methods.POST, path=path, params=params, config=config)
68
+
69
+ def billing_change_post_to_pre_blb(self, request, config=None):
70
+ """
71
+ billing_change_post_to_pre_blb
72
+
73
+ :param request: Request entity containing all parameters
74
+ :type request: BlbClientRequest
75
+ :param config: Optional request configuration override
76
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
77
+
78
+ :return: API response containing BillingChangePostToPreBlbResponse data
79
+ :rtype: BillingChangePostToPreBlbResponse
80
+
81
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
82
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
83
+ """
84
+ path = utils.append_uri(
85
+ BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, request.blb_id, BlbClient.CONSTANT_CHARGE
86
+ )
87
+ params = {}
88
+ params['action'] = 'TO_PREPAY'
89
+ if request.client_token is not None:
90
+ params['clientToken'] = request.client_token
91
+ return self._send_request(
92
+ http_methods.POST,
93
+ path=path,
94
+ body=request.to_json_string(),
95
+ params=params,
96
+ config=config,
97
+ model=BillingChangePostToPreBlbResponse,
98
+ )
99
+
100
+ def billing_change_pre_to_post_blb(self, request, config=None):
101
+ """
102
+ billing_change_pre_to_post_blb
103
+
104
+ :param request: Request entity containing all parameters
105
+ :type request: BlbClientRequest
106
+ :param config: Optional request configuration override
107
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
108
+
109
+ :return: API response containing BillingChangePreToPostBlbResponse data
110
+ :rtype: BillingChangePreToPostBlbResponse
111
+
112
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
113
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
114
+ """
115
+ path = utils.append_uri(
116
+ BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, request.blb_id, BlbClient.CONSTANT_CHARGE
117
+ )
118
+ params = {}
119
+ params['action'] = 'TO_POSTPAY'
120
+ if request.client_token is not None:
121
+ params['clientToken'] = request.client_token
122
+ return self._send_request(
123
+ http_methods.POST,
124
+ path=path,
125
+ body=request.to_json_string(),
126
+ params=params,
127
+ config=config,
128
+ model=BillingChangePreToPostBlbResponse,
129
+ )
130
+
131
+ def blb_inquiry(self, request, config=None):
132
+ """
133
+ blb_inquiry
134
+
135
+ :param request: Request entity containing all parameters
136
+ :type request: BlbClientRequest
137
+ :param config: Optional request configuration override
138
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
139
+
140
+ :return: API response
141
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
142
+
143
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
144
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
145
+ """
146
+ path = utils.append_uri(BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, BlbClient.CONSTANT_PRICE)
147
+ return self._send_request(http_methods.POST, path=path, body=request.to_json_string(), config=config)
148
+
149
+ def refund_blb(self, request, config=None):
150
+ """
151
+ refund_blb
152
+
153
+ :param request: Request entity containing all parameters
154
+ :type request: BlbClientRequest
155
+ :param config: Optional request configuration override
156
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
157
+
158
+ :return: API response
159
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
160
+
161
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
162
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
163
+ """
164
+ path = utils.append_uri(
165
+ BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, BlbClient.CONSTANT_REFUND, request.blb_id
166
+ )
167
+ params = {}
168
+ if request.client_token is not None:
169
+ params['clientToken'] = request.client_token
170
+ return self._send_request(http_methods.PUT, path=path, params=params, config=config)
171
+
172
+ def resize_blb(self, request, config=None):
173
+ """
174
+ resize_blb
175
+
176
+ :param request: Request entity containing all parameters
177
+ :type request: BlbClientRequest
178
+ :param config: Optional request configuration override
179
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
180
+
181
+ :return: API response containing ResizeBlbResponse data
182
+ :rtype: ResizeBlbResponse
183
+
184
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
185
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
186
+ """
187
+ path = utils.append_uri(BlbClient.VERSION_V1, BlbClient.CONSTANT_BLB, request.blb_id)
188
+ params = {}
189
+ params['action'] = 'RESIZE'
190
+ if request.client_token is not None:
191
+ params['clientToken'] = request.client_token
192
+ return self._send_request(
193
+ http_methods.POST,
194
+ path=path,
195
+ body=request.to_json_string(),
196
+ params=params,
197
+ config=config,
198
+ model=ResizeBlbResponse,
199
+ )
200
+
201
+ def _merge_config(self, config=None):
202
+ """
203
+ :param config:
204
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
205
+ """
206
+ if config is None:
207
+ return self.config
208
+ else:
209
+ new_config = copy.copy(self.config)
210
+ new_config.merge_non_none_values(config)
211
+ return new_config
212
+
213
+ def _send_request(
214
+ self, http_method, path, body=None, headers=None, params=None, config=None, body_parser=None, model=None
215
+ ):
216
+ """
217
+ Send an HTTP request to the service endpoint.
218
+
219
+ :param http_method: HTTP method (GET, POST, PUT, DELETE, etc.)
220
+ :type http_method: bytes
221
+ :param path: Request path
222
+ :type path: bytes
223
+ :param body: Optional request body
224
+ :type body: str or bytes
225
+ :param headers: Optional HTTP headers
226
+ :type headers: dict
227
+ :param params: Optional query parameters
228
+ :type params: dict
229
+ :param config: Optional request configuration override
230
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
231
+ :param body_parser: Optional custom body parser function
232
+ :type body_parser: callable
233
+ :param model: Optional response model class for deserialization
234
+ :type model: class
235
+
236
+ :return: API response
237
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
238
+
239
+ :raises BceClientError: Client error (network connection failure, SSL errors, etc.)
240
+ :raises BceServerError: Server returned error response
241
+ """
242
+ config = self._merge_config(config)
243
+ if body_parser is None:
244
+ body_parser = handler.parse_json
245
+ if headers is None:
246
+ headers = {b'Accept': b'*/*', b'Content-Type': b'application/json;charset=utf-8'}
247
+ return bce_http_client.send_request(
248
+ config,
249
+ bce_v1_signer.sign,
250
+ [handler.parse_error, body_parser],
251
+ http_method,
252
+ path,
253
+ body,
254
+ headers,
255
+ params,
256
+ model=model,
257
+ )