Skip to content

Commit 8052354

Browse files
author
BitsAdmin
committed
Merge branch 'organization-Python-2022-01-01-online-1302-2025_06_18_21_03_56' into 'integration_2025-06-19_956583143170'
feat: [development task] organization-1302-Python (1359845) See merge request iaasng/volcengine-python-sdk!667
2 parents 1a72914 + f67825e commit 8052354

File tree

7 files changed

+900
-0
lines changed

7 files changed

+900
-0
lines changed

volcenginesdkorganization/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
from volcenginesdkorganization.models.list_policies_for_target_response import ListPoliciesForTargetResponse
9090
from volcenginesdkorganization.models.list_service_control_policies_request import ListServiceControlPoliciesRequest
9191
from volcenginesdkorganization.models.list_service_control_policies_response import ListServiceControlPoliciesResponse
92+
from volcenginesdkorganization.models.list_tag_resources_request import ListTagResourcesRequest
93+
from volcenginesdkorganization.models.list_tag_resources_response import ListTagResourcesResponse
9294
from volcenginesdkorganization.models.list_targets_for_policy_request import ListTargetsForPolicyRequest
9395
from volcenginesdkorganization.models.list_targets_for_policy_response import ListTargetsForPolicyResponse
9496
from volcenginesdkorganization.models.move_account_request import MoveAccountRequest
@@ -108,11 +110,13 @@
108110
from volcenginesdkorganization.models.reject_quit_application_response import RejectQuitApplicationResponse
109111
from volcenginesdkorganization.models.remove_account_request import RemoveAccountRequest
110112
from volcenginesdkorganization.models.remove_account_response import RemoveAccountResponse
113+
from volcenginesdkorganization.models.resource_tag_for_list_tag_resources_output import ResourceTagForListTagResourcesOutput
111114
from volcenginesdkorganization.models.retry_change_account_secure_contact_info_request import RetryChangeAccountSecureContactInfoRequest
112115
from volcenginesdkorganization.models.retry_change_account_secure_contact_info_response import RetryChangeAccountSecureContactInfoResponse
113116
from volcenginesdkorganization.models.service_control_policy_for_list_service_control_policies_output import ServiceControlPolicyForListServiceControlPoliciesOutput
114117
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_for_parent_output import SubUnitListForListOrganizationalUnitsForParentOutput
115118
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_output import SubUnitListForListOrganizationalUnitsOutput
119+
from volcenginesdkorganization.models.tag_filter_for_list_tag_resources_input import TagFilterForListTagResourcesInput
116120
from volcenginesdkorganization.models.tag_for_list_accounts_output import TagForListAccountsOutput
117121
from volcenginesdkorganization.models.tag_for_tag_resources_input import TagForTagResourcesInput
118122
from volcenginesdkorganization.models.tag_resources_request import TagResourcesRequest

volcenginesdkorganization/api/organization_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3234,6 +3234,103 @@ def list_service_control_policies_with_http_info(self, body, **kwargs): # noqa:
32343234
_request_timeout=params.get('_request_timeout'),
32353235
collection_formats=collection_formats)
32363236

3237+
def list_tag_resources(self, body, **kwargs): # noqa: E501
3238+
"""list_tag_resources # noqa: E501
3239+
3240+
This method makes a synchronous HTTP request by default. To make an
3241+
asynchronous HTTP request, please pass async_req=True
3242+
>>> thread = api.list_tag_resources(body, async_req=True)
3243+
>>> result = thread.get()
3244+
3245+
:param async_req bool
3246+
:param ListTagResourcesRequest body: (required)
3247+
:return: ListTagResourcesResponse
3248+
If the method is called asynchronously,
3249+
returns the request thread.
3250+
"""
3251+
kwargs['_return_http_data_only'] = True
3252+
if kwargs.get('async_req'):
3253+
return self.list_tag_resources_with_http_info(body, **kwargs) # noqa: E501
3254+
else:
3255+
(data) = self.list_tag_resources_with_http_info(body, **kwargs) # noqa: E501
3256+
return data
3257+
3258+
def list_tag_resources_with_http_info(self, body, **kwargs): # noqa: E501
3259+
"""list_tag_resources # noqa: E501
3260+
3261+
This method makes a synchronous HTTP request by default. To make an
3262+
asynchronous HTTP request, please pass async_req=True
3263+
>>> thread = api.list_tag_resources_with_http_info(body, async_req=True)
3264+
>>> result = thread.get()
3265+
3266+
:param async_req bool
3267+
:param ListTagResourcesRequest body: (required)
3268+
:return: ListTagResourcesResponse
3269+
If the method is called asynchronously,
3270+
returns the request thread.
3271+
"""
3272+
3273+
all_params = ['body'] # noqa: E501
3274+
all_params.append('async_req')
3275+
all_params.append('_return_http_data_only')
3276+
all_params.append('_preload_content')
3277+
all_params.append('_request_timeout')
3278+
3279+
params = locals()
3280+
for key, val in six.iteritems(params['kwargs']):
3281+
if key not in all_params:
3282+
raise TypeError(
3283+
"Got an unexpected keyword argument '%s'"
3284+
" to method list_tag_resources" % key
3285+
)
3286+
params[key] = val
3287+
del params['kwargs']
3288+
# verify the required parameter 'body' is set
3289+
if self.api_client.client_side_validation and ('body' not in params or
3290+
params['body'] is None): # noqa: E501
3291+
raise ValueError("Missing the required parameter `body` when calling `list_tag_resources`") # noqa: E501
3292+
3293+
collection_formats = {}
3294+
3295+
path_params = {}
3296+
3297+
query_params = []
3298+
3299+
header_params = {}
3300+
3301+
form_params = []
3302+
local_var_files = {}
3303+
3304+
body_params = None
3305+
if 'body' in params:
3306+
body_params = params['body']
3307+
# HTTP header `Accept`
3308+
header_params['Accept'] = self.api_client.select_header_accept(
3309+
['application/json']) # noqa: E501
3310+
3311+
# HTTP header `Content-Type`
3312+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
3313+
['text/plain']) # noqa: E501
3314+
3315+
# Authentication setting
3316+
auth_settings = ['volcengineSign'] # noqa: E501
3317+
3318+
return self.api_client.call_api(
3319+
'/ListTagResources/2022-01-01/organization/get/text_plain/', 'GET',
3320+
path_params,
3321+
query_params,
3322+
header_params,
3323+
body=body_params,
3324+
post_params=form_params,
3325+
files=local_var_files,
3326+
response_type='ListTagResourcesResponse', # noqa: E501
3327+
auth_settings=auth_settings,
3328+
async_req=params.get('async_req'),
3329+
_return_http_data_only=params.get('_return_http_data_only'),
3330+
_preload_content=params.get('_preload_content', True),
3331+
_request_timeout=params.get('_request_timeout'),
3332+
collection_formats=collection_formats)
3333+
32373334
def list_targets_for_policy(self, body, **kwargs): # noqa: E501
32383335
"""list_targets_for_policy # noqa: E501
32393336

volcenginesdkorganization/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
from volcenginesdkorganization.models.list_policies_for_target_response import ListPoliciesForTargetResponse
8686
from volcenginesdkorganization.models.list_service_control_policies_request import ListServiceControlPoliciesRequest
8787
from volcenginesdkorganization.models.list_service_control_policies_response import ListServiceControlPoliciesResponse
88+
from volcenginesdkorganization.models.list_tag_resources_request import ListTagResourcesRequest
89+
from volcenginesdkorganization.models.list_tag_resources_response import ListTagResourcesResponse
8890
from volcenginesdkorganization.models.list_targets_for_policy_request import ListTargetsForPolicyRequest
8991
from volcenginesdkorganization.models.list_targets_for_policy_response import ListTargetsForPolicyResponse
9092
from volcenginesdkorganization.models.move_account_request import MoveAccountRequest
@@ -104,11 +106,13 @@
104106
from volcenginesdkorganization.models.reject_quit_application_response import RejectQuitApplicationResponse
105107
from volcenginesdkorganization.models.remove_account_request import RemoveAccountRequest
106108
from volcenginesdkorganization.models.remove_account_response import RemoveAccountResponse
109+
from volcenginesdkorganization.models.resource_tag_for_list_tag_resources_output import ResourceTagForListTagResourcesOutput
107110
from volcenginesdkorganization.models.retry_change_account_secure_contact_info_request import RetryChangeAccountSecureContactInfoRequest
108111
from volcenginesdkorganization.models.retry_change_account_secure_contact_info_response import RetryChangeAccountSecureContactInfoResponse
109112
from volcenginesdkorganization.models.service_control_policy_for_list_service_control_policies_output import ServiceControlPolicyForListServiceControlPoliciesOutput
110113
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_for_parent_output import SubUnitListForListOrganizationalUnitsForParentOutput
111114
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_output import SubUnitListForListOrganizationalUnitsOutput
115+
from volcenginesdkorganization.models.tag_filter_for_list_tag_resources_input import TagFilterForListTagResourcesInput
112116
from volcenginesdkorganization.models.tag_for_list_accounts_output import TagForListAccountsOutput
113117
from volcenginesdkorganization.models.tag_for_tag_resources_input import TagForTagResourcesInput
114118
from volcenginesdkorganization.models.tag_resources_request import TagResourcesRequest
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
# coding: utf-8
2+
3+
"""
4+
organization
5+
6+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7+
8+
OpenAPI spec version: common-version
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
from volcenginesdkcore.configuration import Configuration
20+
21+
22+
class ListTagResourcesRequest(object):
23+
"""NOTE: This class is auto generated by the swagger code generator program.
24+
25+
Do not edit the class manually.
26+
"""
27+
28+
"""
29+
Attributes:
30+
swagger_types (dict): The key is attribute name
31+
and the value is attribute type.
32+
attribute_map (dict): The key is attribute name
33+
and the value is json key in definition.
34+
"""
35+
swagger_types = {
36+
'page_number': 'int',
37+
'page_size': 'int',
38+
'resource_ids': 'list[str]',
39+
'resource_type': 'str',
40+
'tag_filters': 'list[TagFilterForListTagResourcesInput]'
41+
}
42+
43+
attribute_map = {
44+
'page_number': 'PageNumber',
45+
'page_size': 'PageSize',
46+
'resource_ids': 'ResourceIds',
47+
'resource_type': 'ResourceType',
48+
'tag_filters': 'TagFilters'
49+
}
50+
51+
def __init__(self, page_number=None, page_size=None, resource_ids=None, resource_type=None, tag_filters=None, _configuration=None): # noqa: E501
52+
"""ListTagResourcesRequest - a model defined in Swagger""" # noqa: E501
53+
if _configuration is None:
54+
_configuration = Configuration()
55+
self._configuration = _configuration
56+
57+
self._page_number = None
58+
self._page_size = None
59+
self._resource_ids = None
60+
self._resource_type = None
61+
self._tag_filters = None
62+
self.discriminator = None
63+
64+
if page_number is not None:
65+
self.page_number = page_number
66+
if page_size is not None:
67+
self.page_size = page_size
68+
if resource_ids is not None:
69+
self.resource_ids = resource_ids
70+
self.resource_type = resource_type
71+
if tag_filters is not None:
72+
self.tag_filters = tag_filters
73+
74+
@property
75+
def page_number(self):
76+
"""Gets the page_number of this ListTagResourcesRequest. # noqa: E501
77+
78+
79+
:return: The page_number of this ListTagResourcesRequest. # noqa: E501
80+
:rtype: int
81+
"""
82+
return self._page_number
83+
84+
@page_number.setter
85+
def page_number(self, page_number):
86+
"""Sets the page_number of this ListTagResourcesRequest.
87+
88+
89+
:param page_number: The page_number of this ListTagResourcesRequest. # noqa: E501
90+
:type: int
91+
"""
92+
if (self._configuration.client_side_validation and
93+
page_number is not None and page_number < 1): # noqa: E501
94+
raise ValueError("Invalid value for `page_number`, must be a value greater than or equal to `1`") # noqa: E501
95+
96+
self._page_number = page_number
97+
98+
@property
99+
def page_size(self):
100+
"""Gets the page_size of this ListTagResourcesRequest. # noqa: E501
101+
102+
103+
:return: The page_size of this ListTagResourcesRequest. # noqa: E501
104+
:rtype: int
105+
"""
106+
return self._page_size
107+
108+
@page_size.setter
109+
def page_size(self, page_size):
110+
"""Sets the page_size of this ListTagResourcesRequest.
111+
112+
113+
:param page_size: The page_size of this ListTagResourcesRequest. # noqa: E501
114+
:type: int
115+
"""
116+
if (self._configuration.client_side_validation and
117+
page_size is not None and page_size > 100): # noqa: E501
118+
raise ValueError("Invalid value for `page_size`, must be a value less than or equal to `100`") # noqa: E501
119+
if (self._configuration.client_side_validation and
120+
page_size is not None and page_size < 1): # noqa: E501
121+
raise ValueError("Invalid value for `page_size`, must be a value greater than or equal to `1`") # noqa: E501
122+
123+
self._page_size = page_size
124+
125+
@property
126+
def resource_ids(self):
127+
"""Gets the resource_ids of this ListTagResourcesRequest. # noqa: E501
128+
129+
130+
:return: The resource_ids of this ListTagResourcesRequest. # noqa: E501
131+
:rtype: list[str]
132+
"""
133+
return self._resource_ids
134+
135+
@resource_ids.setter
136+
def resource_ids(self, resource_ids):
137+
"""Sets the resource_ids of this ListTagResourcesRequest.
138+
139+
140+
:param resource_ids: The resource_ids of this ListTagResourcesRequest. # noqa: E501
141+
:type: list[str]
142+
"""
143+
144+
self._resource_ids = resource_ids
145+
146+
@property
147+
def resource_type(self):
148+
"""Gets the resource_type of this ListTagResourcesRequest. # noqa: E501
149+
150+
151+
:return: The resource_type of this ListTagResourcesRequest. # noqa: E501
152+
:rtype: str
153+
"""
154+
return self._resource_type
155+
156+
@resource_type.setter
157+
def resource_type(self, resource_type):
158+
"""Sets the resource_type of this ListTagResourcesRequest.
159+
160+
161+
:param resource_type: The resource_type of this ListTagResourcesRequest. # noqa: E501
162+
:type: str
163+
"""
164+
if self._configuration.client_side_validation and resource_type is None:
165+
raise ValueError("Invalid value for `resource_type`, must not be `None`") # noqa: E501
166+
allowed_values = ["account", "unit"] # noqa: E501
167+
if (self._configuration.client_side_validation and
168+
resource_type not in allowed_values):
169+
raise ValueError(
170+
"Invalid value for `resource_type` ({0}), must be one of {1}" # noqa: E501
171+
.format(resource_type, allowed_values)
172+
)
173+
174+
self._resource_type = resource_type
175+
176+
@property
177+
def tag_filters(self):
178+
"""Gets the tag_filters of this ListTagResourcesRequest. # noqa: E501
179+
180+
181+
:return: The tag_filters of this ListTagResourcesRequest. # noqa: E501
182+
:rtype: list[TagFilterForListTagResourcesInput]
183+
"""
184+
return self._tag_filters
185+
186+
@tag_filters.setter
187+
def tag_filters(self, tag_filters):
188+
"""Sets the tag_filters of this ListTagResourcesRequest.
189+
190+
191+
:param tag_filters: The tag_filters of this ListTagResourcesRequest. # noqa: E501
192+
:type: list[TagFilterForListTagResourcesInput]
193+
"""
194+
195+
self._tag_filters = tag_filters
196+
197+
def to_dict(self):
198+
"""Returns the model properties as a dict"""
199+
result = {}
200+
201+
for attr, _ in six.iteritems(self.swagger_types):
202+
value = getattr(self, attr)
203+
if isinstance(value, list):
204+
result[attr] = list(map(
205+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
206+
value
207+
))
208+
elif hasattr(value, "to_dict"):
209+
result[attr] = value.to_dict()
210+
elif isinstance(value, dict):
211+
result[attr] = dict(map(
212+
lambda item: (item[0], item[1].to_dict())
213+
if hasattr(item[1], "to_dict") else item,
214+
value.items()
215+
))
216+
else:
217+
result[attr] = value
218+
if issubclass(ListTagResourcesRequest, dict):
219+
for key, value in self.items():
220+
result[key] = value
221+
222+
return result
223+
224+
def to_str(self):
225+
"""Returns the string representation of the model"""
226+
return pprint.pformat(self.to_dict())
227+
228+
def __repr__(self):
229+
"""For `print` and `pprint`"""
230+
return self.to_str()
231+
232+
def __eq__(self, other):
233+
"""Returns true if both objects are equal"""
234+
if not isinstance(other, ListTagResourcesRequest):
235+
return False
236+
237+
return self.to_dict() == other.to_dict()
238+
239+
def __ne__(self, other):
240+
"""Returns true if both objects are not equal"""
241+
if not isinstance(other, ListTagResourcesRequest):
242+
return True
243+
244+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)