Skip to content

Commit 080aed9

Browse files
author
BitsAdmin
committed
Merge branch 'organization-Java-2022-01-01-online-1302-2025_06_18_21_03_56' into 'integration_2025-06-19_956533420802'
feat: [development task] organization-1302-Java (1359905) See merge request iaasng/volcengine-java-sdk!532
2 parents a57d5f4 + 63b71da commit 080aed9

File tree

5 files changed

+887
-0
lines changed

5 files changed

+887
-0
lines changed

volcengine-java-sdk-organization/src/main/java/com/volcengine/organization/OrganizationApi.java

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
import com.volcengine.organization.model.ListPoliciesForTargetResponse;
9494
import com.volcengine.organization.model.ListServiceControlPoliciesRequest;
9595
import com.volcengine.organization.model.ListServiceControlPoliciesResponse;
96+
import com.volcengine.organization.model.ListTagResourcesRequest;
97+
import com.volcengine.organization.model.ListTagResourcesResponse;
9698
import com.volcengine.organization.model.ListTargetsForPolicyRequest;
9799
import com.volcengine.organization.model.ListTargetsForPolicyResponse;
98100
import com.volcengine.organization.model.MoveAccountRequest;
@@ -4237,6 +4239,130 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
42374239
apiClient.executeAsync(call, localVarReturnType, callback);
42384240
return call;
42394241
}
4242+
/**
4243+
* Build call for listTagResources
4244+
* @param body (required)
4245+
* @param progressListener Progress listener
4246+
* @param progressRequestListener Progress request listener
4247+
* @return Call to execute
4248+
* @throws ApiException If fail to serialize the request body object
4249+
*/
4250+
public com.squareup.okhttp.Call listTagResourcesCall(ListTagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
4251+
Object localVarPostBody = body;
4252+
4253+
// create path and map variables
4254+
String localVarPath = "/ListTagResources/2022-01-01/organization/get/text_plain/";
4255+
4256+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
4257+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
4258+
4259+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
4260+
4261+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
4262+
4263+
final String[] localVarAccepts = {
4264+
"application/json"
4265+
};
4266+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
4267+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
4268+
4269+
final String[] localVarContentTypes = {
4270+
"text/plain"
4271+
};
4272+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
4273+
localVarHeaderParams.put("Content-Type", localVarContentType);
4274+
4275+
if(progressListener != null) {
4276+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
4277+
@Override
4278+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
4279+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
4280+
return originalResponse.newBuilder()
4281+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
4282+
.build();
4283+
}
4284+
});
4285+
}
4286+
4287+
String[] localVarAuthNames = new String[] { "volcengineSign" };
4288+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
4289+
}
4290+
4291+
@SuppressWarnings("rawtypes")
4292+
private com.squareup.okhttp.Call listTagResourcesValidateBeforeCall(ListTagResourcesRequest body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
4293+
// verify the required parameter 'body' is set
4294+
if (body == null) {
4295+
throw new ApiException("Missing the required parameter 'body' when calling listTagResources(Async)");
4296+
}
4297+
4298+
com.squareup.okhttp.Call call = listTagResourcesCall(body, progressListener, progressRequestListener);
4299+
return call;
4300+
4301+
4302+
4303+
4304+
4305+
}
4306+
4307+
/**
4308+
*
4309+
*
4310+
* @param body (required)
4311+
* @return ListTagResourcesResponse
4312+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4313+
*/
4314+
public ListTagResourcesResponse listTagResources(ListTagResourcesRequest body) throws ApiException {
4315+
ApiResponse<ListTagResourcesResponse> resp = listTagResourcesWithHttpInfo(body);
4316+
return resp.getData();
4317+
}
4318+
4319+
/**
4320+
*
4321+
*
4322+
* @param body (required)
4323+
* @return ApiResponse&lt;ListTagResourcesResponse&gt;
4324+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4325+
*/
4326+
public ApiResponse<ListTagResourcesResponse> listTagResourcesWithHttpInfo( @NotNull ListTagResourcesRequest body) throws ApiException {
4327+
com.squareup.okhttp.Call call = listTagResourcesValidateBeforeCall(body, null, null);
4328+
Type localVarReturnType = new TypeToken<ListTagResourcesResponse>(){}.getType();
4329+
return apiClient.execute(call, localVarReturnType);
4330+
}
4331+
4332+
/**
4333+
* (asynchronously)
4334+
*
4335+
* @param body (required)
4336+
* @param callback The callback to be executed when the API call finishes
4337+
* @return The request call
4338+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
4339+
*/
4340+
public com.squareup.okhttp.Call listTagResourcesAsync(ListTagResourcesRequest body, final ApiCallback<ListTagResourcesResponse> callback) throws ApiException {
4341+
4342+
ProgressResponseBody.ProgressListener progressListener = null;
4343+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
4344+
4345+
if (callback != null) {
4346+
progressListener = new ProgressResponseBody.ProgressListener() {
4347+
@Override
4348+
public void update(long bytesRead, long contentLength, boolean done) {
4349+
callback.onDownloadProgress(bytesRead, contentLength, done);
4350+
}
4351+
};
4352+
4353+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
4354+
@Override
4355+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
4356+
callback.onUploadProgress(bytesWritten, contentLength, done);
4357+
}
4358+
};
4359+
}
4360+
4361+
com.squareup.okhttp.Call call = listTagResourcesValidateBeforeCall(body, progressListener, progressRequestListener);
4362+
Type localVarReturnType = new TypeToken<ListTagResourcesResponse>(){}.getType();
4363+
apiClient.executeAsync(call, localVarReturnType, callback);
4364+
return call;
4365+
}
42404366
/**
42414367
* Build call for listTargetsForPolicy
42424368
* @param body (required)
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
/*
2+
* organization
3+
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4+
*
5+
* OpenAPI spec version: common-version
6+
*
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
package com.volcengine.organization.model;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import com.google.gson.TypeAdapter;
18+
import com.google.gson.annotations.JsonAdapter;
19+
import com.google.gson.annotations.SerializedName;
20+
import com.google.gson.stream.JsonReader;
21+
import com.google.gson.stream.JsonWriter;
22+
import com.volcengine.organization.model.TagFilterForListTagResourcesInput;
23+
import io.swagger.v3.oas.annotations.media.Schema;
24+
import java.io.IOException;
25+
import java.util.ArrayList;
26+
import java.util.List;
27+
import javax.validation.constraints.*;
28+
import javax.validation.Valid;
29+
/**
30+
* ListTagResourcesRequest
31+
*/
32+
33+
34+
35+
public class ListTagResourcesRequest {
36+
@SerializedName("PageNumber")
37+
private Integer pageNumber = null;
38+
39+
@SerializedName("PageSize")
40+
private Integer pageSize = null;
41+
42+
@SerializedName("ResourceIds")
43+
private List<String> resourceIds = null;
44+
45+
/**
46+
* Gets or Sets resourceType
47+
*/
48+
@JsonAdapter(ResourceTypeEnum.Adapter.class)
49+
public enum ResourceTypeEnum {
50+
@SerializedName("account")
51+
ACCOUNT("account"),
52+
@SerializedName("unit")
53+
UNIT("unit");
54+
55+
private String value;
56+
57+
ResourceTypeEnum(String value) {
58+
this.value = value;
59+
}
60+
public String getValue() {
61+
return value;
62+
}
63+
64+
@Override
65+
public String toString() {
66+
return String.valueOf(value);
67+
}
68+
public static ResourceTypeEnum fromValue(String input) {
69+
for (ResourceTypeEnum b : ResourceTypeEnum.values()) {
70+
if (b.value.equals(input)) {
71+
return b;
72+
}
73+
}
74+
return null;
75+
}
76+
public static class Adapter extends TypeAdapter<ResourceTypeEnum> {
77+
@Override
78+
public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException {
79+
jsonWriter.value(String.valueOf(enumeration.getValue()));
80+
}
81+
82+
@Override
83+
public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException {
84+
Object value = jsonReader.nextString();
85+
return ResourceTypeEnum.fromValue((String)(value));
86+
}
87+
}
88+
} @SerializedName("ResourceType")
89+
private ResourceTypeEnum resourceType = null;
90+
91+
@SerializedName("TagFilters")
92+
private List<TagFilterForListTagResourcesInput> tagFilters = null;
93+
94+
public ListTagResourcesRequest pageNumber(Integer pageNumber) {
95+
this.pageNumber = pageNumber;
96+
return this;
97+
}
98+
99+
/**
100+
* Get pageNumber
101+
* minimum: 1
102+
* @return pageNumber
103+
**/
104+
@Min(1) @Schema(description = "")
105+
public Integer getPageNumber() {
106+
return pageNumber;
107+
}
108+
109+
public void setPageNumber(Integer pageNumber) {
110+
this.pageNumber = pageNumber;
111+
}
112+
113+
public ListTagResourcesRequest pageSize(Integer pageSize) {
114+
this.pageSize = pageSize;
115+
return this;
116+
}
117+
118+
/**
119+
* Get pageSize
120+
* minimum: 1
121+
* maximum: 100
122+
* @return pageSize
123+
**/
124+
@Min(1) @Max(100) @Schema(description = "")
125+
public Integer getPageSize() {
126+
return pageSize;
127+
}
128+
129+
public void setPageSize(Integer pageSize) {
130+
this.pageSize = pageSize;
131+
}
132+
133+
public ListTagResourcesRequest resourceIds(List<String> resourceIds) {
134+
this.resourceIds = resourceIds;
135+
return this;
136+
}
137+
138+
public ListTagResourcesRequest addResourceIdsItem(String resourceIdsItem) {
139+
if (this.resourceIds == null) {
140+
this.resourceIds = new ArrayList<String>();
141+
}
142+
this.resourceIds.add(resourceIdsItem);
143+
return this;
144+
}
145+
146+
/**
147+
* Get resourceIds
148+
* @return resourceIds
149+
**/
150+
@Schema(description = "")
151+
public List<String> getResourceIds() {
152+
return resourceIds;
153+
}
154+
155+
public void setResourceIds(List<String> resourceIds) {
156+
this.resourceIds = resourceIds;
157+
}
158+
159+
public ListTagResourcesRequest resourceType(ResourceTypeEnum resourceType) {
160+
this.resourceType = resourceType;
161+
return this;
162+
}
163+
164+
/**
165+
* Get resourceType
166+
* @return resourceType
167+
**/
168+
@NotNull
169+
@Schema(required = true, description = "")
170+
public ResourceTypeEnum getResourceType() {
171+
return resourceType;
172+
}
173+
174+
public void setResourceType(ResourceTypeEnum resourceType) {
175+
this.resourceType = resourceType;
176+
}
177+
178+
public ListTagResourcesRequest tagFilters(List<TagFilterForListTagResourcesInput> tagFilters) {
179+
this.tagFilters = tagFilters;
180+
return this;
181+
}
182+
183+
public ListTagResourcesRequest addTagFiltersItem(TagFilterForListTagResourcesInput tagFiltersItem) {
184+
if (this.tagFilters == null) {
185+
this.tagFilters = new ArrayList<TagFilterForListTagResourcesInput>();
186+
}
187+
this.tagFilters.add(tagFiltersItem);
188+
return this;
189+
}
190+
191+
/**
192+
* Get tagFilters
193+
* @return tagFilters
194+
**/
195+
@Valid
196+
@Schema(description = "")
197+
public List<TagFilterForListTagResourcesInput> getTagFilters() {
198+
return tagFilters;
199+
}
200+
201+
public void setTagFilters(List<TagFilterForListTagResourcesInput> tagFilters) {
202+
this.tagFilters = tagFilters;
203+
}
204+
205+
206+
@Override
207+
public boolean equals(java.lang.Object o) {
208+
if (this == o) {
209+
return true;
210+
}
211+
if (o == null || getClass() != o.getClass()) {
212+
return false;
213+
}
214+
ListTagResourcesRequest listTagResourcesRequest = (ListTagResourcesRequest) o;
215+
return Objects.equals(this.pageNumber, listTagResourcesRequest.pageNumber) &&
216+
Objects.equals(this.pageSize, listTagResourcesRequest.pageSize) &&
217+
Objects.equals(this.resourceIds, listTagResourcesRequest.resourceIds) &&
218+
Objects.equals(this.resourceType, listTagResourcesRequest.resourceType) &&
219+
Objects.equals(this.tagFilters, listTagResourcesRequest.tagFilters);
220+
}
221+
222+
@Override
223+
public int hashCode() {
224+
return Objects.hash(pageNumber, pageSize, resourceIds, resourceType, tagFilters);
225+
}
226+
227+
228+
@Override
229+
public String toString() {
230+
StringBuilder sb = new StringBuilder();
231+
sb.append("class ListTagResourcesRequest {\n");
232+
233+
sb.append(" pageNumber: ").append(toIndentedString(pageNumber)).append("\n");
234+
sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n");
235+
sb.append(" resourceIds: ").append(toIndentedString(resourceIds)).append("\n");
236+
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
237+
sb.append(" tagFilters: ").append(toIndentedString(tagFilters)).append("\n");
238+
sb.append("}");
239+
return sb.toString();
240+
}
241+
242+
/**
243+
* Convert the given object to string with each line indented by 4 spaces
244+
* (except the first line).
245+
*/
246+
private String toIndentedString(java.lang.Object o) {
247+
if (o == null) {
248+
return "null";
249+
}
250+
return o.toString().replace("\n", "\n ");
251+
}
252+
253+
}

0 commit comments

Comments
 (0)