diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingExamples.java index 0b014476e3..568e550a6b 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingExamples.java @@ -22,7 +22,6 @@ import com.ibm.cloud.platform_services.global_tagging.v1.model.DeleteTagsResult; import com.ibm.cloud.platform_services.global_tagging.v1.model.DetachTagOptions; import com.ibm.cloud.platform_services.global_tagging.v1.model.ListTagsOptions; -import com.ibm.cloud.platform_services.global_tagging.v1.model.Resource; import com.ibm.cloud.platform_services.global_tagging.v1.model.TagList; import com.ibm.cloud.platform_services.global_tagging.v1.model.TagResults; import com.ibm.cloud.sdk.core.http.Response; @@ -114,9 +113,7 @@ public static void main(String[] args) throws Exception { // begin-attach_tag - Resource resourceModel = new Resource.Builder().resourceId(resourceCRN).build(); AttachTagOptions attachTagOptions = new AttachTagOptions.Builder() - .addResources(resourceModel) .addTagNames("tag_test_1") .addTagNames("tag_test_2") .build(); @@ -137,9 +134,7 @@ public static void main(String[] args) throws Exception { // begin-detach_tag - Resource resourceModel = new Resource.Builder().resourceId(resourceCRN).build(); DetachTagOptions detachTagOptions = new DetachTagOptions.Builder() - .addResources(resourceModel) .addTagNames("tag_test_1") .addTagNames("tag_test_2") .tagType("user") diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTagging.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTagging.java index 53691cfda9..f294e3e602 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTagging.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTagging.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027 + * IBM OpenAPI SDK Code Generator Version: 3.105.0-3c13b041-20250605-193116 */ package com.ibm.cloud.platform_services.global_tagging.v1; @@ -48,9 +48,9 @@ * two formats: `key:value` or `label`. The tagging API supports three types of tag: `user` `service`, and `access` * tags. `service` tags cannot be attached to IMS resources. `service` tags must be in the form * `service_prefix:tag_label` where `service_prefix` identifies the Service owning the tag. `access` tags cannot be - * attached to IMS and Cloud Foundry resources. They must be in the form `key:value`. You can replace all resource's - * tags using the `replace` query parameter in the attach operation. You can update the `value` of a resource's tag in - * the format `key:value`, using the `update` query parameter in the attach operation. + * attached to IMS resources. They must be in the form `key:value`. You can replace all resource's tags using the + * `replace` query parameter in the attach operation. You can update the `value` of a resource's tag in the format + * `key:value`, using the `update` query parameter in the attach operation. * * API Version: 1.2.0 */ @@ -338,19 +338,36 @@ public ServiceCall attachTag(AttachTagOptions attachTagOptions) { builder.query("update", String.valueOf(attachTagOptions.update())); } final JsonObject contentJson = new JsonObject(); - contentJson.add("resources", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(attachTagOptions.resources())); if (attachTagOptions.tagName() != null) { contentJson.addProperty("tag_name", attachTagOptions.tagName()); } if (attachTagOptions.tagNames() != null) { contentJson.add("tag_names", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(attachTagOptions.tagNames())); } + if (attachTagOptions.resources() != null) { + contentJson.add("resources", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(attachTagOptions.resources())); + } + if (attachTagOptions.query() != null) { + contentJson.add("query", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(attachTagOptions.query())); + } builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } + /** + * Attach tags. + * + * Attaches one or more tags to one or more resources. Each resource can have no more than 1000 tags per each 'user' + * and 'service' type, and no more than 250 'access' tags (which is the account limit). + * + * @return a {@link ServiceCall} with a result of type {@link TagResults} + */ + public ServiceCall attachTag() { + return attachTag(null); + } + /** * Detach tags. * @@ -381,17 +398,33 @@ public ServiceCall detachTag(DetachTagOptions detachTagOptions) { builder.query("tag_type", String.valueOf(detachTagOptions.tagType())); } final JsonObject contentJson = new JsonObject(); - contentJson.add("resources", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(detachTagOptions.resources())); if (detachTagOptions.tagName() != null) { contentJson.addProperty("tag_name", detachTagOptions.tagName()); } if (detachTagOptions.tagNames() != null) { contentJson.add("tag_names", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(detachTagOptions.tagNames())); } + if (detachTagOptions.resources() != null) { + contentJson.add("resources", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(detachTagOptions.resources())); + } + if (detachTagOptions.query() != null) { + contentJson.add("query", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(detachTagOptions.query())); + } builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } + /** + * Detach tags. + * + * Detaches one or more tags from one or more resources. + * + * @return a {@link ServiceCall} with a result of type {@link TagResults} + */ + public ServiceCall detachTag() { + return detachTag(null); + } + } diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptions.java index 63c642d804..cd80f130a6 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.ArrayList; @@ -35,9 +36,10 @@ public interface TagType { String ACCESS = "access"; } - protected List resources; protected String tagName; protected List tagNames; + protected List resources; + protected QueryString query; protected String xRequestId; protected String xCorrelationId; protected String accountId; @@ -49,9 +51,10 @@ public interface TagType { * Builder. */ public static class Builder { - private List resources; private String tagName; private List tagNames; + private List resources; + private QueryString query; private String xRequestId; private String xCorrelationId; private String accountId; @@ -65,9 +68,10 @@ public static class Builder { * @param attachTagOptions the instance to initialize the Builder with */ private Builder(AttachTagOptions attachTagOptions) { - this.resources = attachTagOptions.resources; this.tagName = attachTagOptions.tagName; this.tagNames = attachTagOptions.tagNames; + this.resources = attachTagOptions.resources; + this.query = attachTagOptions.query; this.xRequestId = attachTagOptions.xRequestId; this.xCorrelationId = attachTagOptions.xCorrelationId; this.accountId = attachTagOptions.accountId; @@ -82,15 +86,6 @@ private Builder(AttachTagOptions attachTagOptions) { public Builder() { } - /** - * Instantiates a new builder with required properties. - * - * @param resources the resources - */ - public Builder(List resources) { - this.resources = resources; - } - /** * Builds a AttachTagOptions. * @@ -100,22 +95,6 @@ public AttachTagOptions build() { return new AttachTagOptions(this); } - /** - * Adds a new element to resources. - * - * @param resources the new element to be added - * @return the AttachTagOptions builder - */ - public Builder addResources(Resource resources) { - com.ibm.cloud.sdk.core.util.Validator.notNull(resources, - "resources cannot be null"); - if (this.resources == null) { - this.resources = new ArrayList(); - } - this.resources.add(resources); - return this; - } - /** * Adds a new element to tagNames. * @@ -133,14 +112,18 @@ public Builder addTagNames(String tagNames) { } /** - * Set the resources. - * Existing resources will be replaced. + * Adds a new element to resources. * - * @param resources the resources + * @param resources the new element to be added * @return the AttachTagOptions builder */ - public Builder resources(List resources) { - this.resources = resources; + public Builder addResources(Resource resources) { + com.ibm.cloud.sdk.core.util.Validator.notNull(resources, + "resources cannot be null"); + if (this.resources == null) { + this.resources = new ArrayList(); + } + this.resources.add(resources); return this; } @@ -167,6 +150,29 @@ public Builder tagNames(List tagNames) { return this; } + /** + * Set the resources. + * Existing resources will be replaced. + * + * @param resources the resources + * @return the AttachTagOptions builder + */ + public Builder resources(List resources) { + this.resources = resources; + return this; + } + + /** + * Set the query. + * + * @param query the query + * @return the AttachTagOptions builder + */ + public Builder query(QueryString query) { + this.query = query; + return this; + } + /** * Set the xRequestId. * @@ -237,11 +243,10 @@ public Builder update(Boolean update) { protected AttachTagOptions() { } protected AttachTagOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resources, - "resources cannot be null"); - resources = builder.resources; tagName = builder.tagName; tagNames = builder.tagNames; + resources = builder.resources; + query = builder.query; xRequestId = builder.xRequestId; xCorrelationId = builder.xCorrelationId; accountId = builder.accountId; @@ -259,17 +264,6 @@ public Builder newBuilder() { return new Builder(this); } - /** - * Gets the resources. - * - * List of resources on which the tag or tags are attached. - * - * @return the resources - */ - public List resources() { - return resources; - } - /** * Gets the tagName. * @@ -292,6 +286,28 @@ public List tagNames() { return tagNames; } + /** + * Gets the resources. + * + * List of resources on which the tagging operation operates on. + * + * @return the resources + */ + public List resources() { + return resources; + } + + /** + * Gets the query. + * + * A valid Global Search string. + * + * @return the query + */ + public QueryString query() { + return query; + } + /** * Gets the xRequestId. * diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptions.java index 6f8bb514fb..0afc9ac8de 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.ArrayList; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResults.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResults.java index 916b626bef..442c840aee 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResults.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.List; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItem.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItem.java index bab9f19663..c709fccb0d 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItem.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptions.java index 4d8b183636..c68a96ab83 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptions.java index 9d61a8438c..2b534cab07 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.ArrayList; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResults.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResults.java index eef71cbc26..9906a810ca 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResults.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.List; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItem.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItem.java index 2862b69ded..1821f2566d 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItem.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.google.gson.annotations.SerializedName; @@ -18,6 +19,8 @@ /** * Result of a delete_tag request. + * + * This type supports additional properties of type Object. */ public class DeleteTagResultsItem extends DynamicModel { diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResult.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResult.java index b120a4a446..47fdc717d5 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResult.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.List; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItem.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItem.java index 906c8e4cdd..8d4eaa504d 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItem.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptions.java index 2bc7f99a9e..a0b7b80c15 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.ArrayList; @@ -35,9 +36,10 @@ public interface TagType { String ACCESS = "access"; } - protected List resources; protected String tagName; protected List tagNames; + protected List resources; + protected QueryString query; protected String xRequestId; protected String xCorrelationId; protected String accountId; @@ -47,9 +49,10 @@ public interface TagType { * Builder. */ public static class Builder { - private List resources; private String tagName; private List tagNames; + private List resources; + private QueryString query; private String xRequestId; private String xCorrelationId; private String accountId; @@ -61,9 +64,10 @@ public static class Builder { * @param detachTagOptions the instance to initialize the Builder with */ private Builder(DetachTagOptions detachTagOptions) { - this.resources = detachTagOptions.resources; this.tagName = detachTagOptions.tagName; this.tagNames = detachTagOptions.tagNames; + this.resources = detachTagOptions.resources; + this.query = detachTagOptions.query; this.xRequestId = detachTagOptions.xRequestId; this.xCorrelationId = detachTagOptions.xCorrelationId; this.accountId = detachTagOptions.accountId; @@ -76,15 +80,6 @@ private Builder(DetachTagOptions detachTagOptions) { public Builder() { } - /** - * Instantiates a new builder with required properties. - * - * @param resources the resources - */ - public Builder(List resources) { - this.resources = resources; - } - /** * Builds a DetachTagOptions. * @@ -94,22 +89,6 @@ public DetachTagOptions build() { return new DetachTagOptions(this); } - /** - * Adds a new element to resources. - * - * @param resources the new element to be added - * @return the DetachTagOptions builder - */ - public Builder addResources(Resource resources) { - com.ibm.cloud.sdk.core.util.Validator.notNull(resources, - "resources cannot be null"); - if (this.resources == null) { - this.resources = new ArrayList(); - } - this.resources.add(resources); - return this; - } - /** * Adds a new element to tagNames. * @@ -127,14 +106,18 @@ public Builder addTagNames(String tagNames) { } /** - * Set the resources. - * Existing resources will be replaced. + * Adds a new element to resources. * - * @param resources the resources + * @param resources the new element to be added * @return the DetachTagOptions builder */ - public Builder resources(List resources) { - this.resources = resources; + public Builder addResources(Resource resources) { + com.ibm.cloud.sdk.core.util.Validator.notNull(resources, + "resources cannot be null"); + if (this.resources == null) { + this.resources = new ArrayList(); + } + this.resources.add(resources); return this; } @@ -161,6 +144,29 @@ public Builder tagNames(List tagNames) { return this; } + /** + * Set the resources. + * Existing resources will be replaced. + * + * @param resources the resources + * @return the DetachTagOptions builder + */ + public Builder resources(List resources) { + this.resources = resources; + return this; + } + + /** + * Set the query. + * + * @param query the query + * @return the DetachTagOptions builder + */ + public Builder query(QueryString query) { + this.query = query; + return this; + } + /** * Set the xRequestId. * @@ -209,11 +215,10 @@ public Builder tagType(String tagType) { protected DetachTagOptions() { } protected DetachTagOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resources, - "resources cannot be null"); - resources = builder.resources; tagName = builder.tagName; tagNames = builder.tagNames; + resources = builder.resources; + query = builder.query; xRequestId = builder.xRequestId; xCorrelationId = builder.xCorrelationId; accountId = builder.accountId; @@ -229,17 +234,6 @@ public Builder newBuilder() { return new Builder(this); } - /** - * Gets the resources. - * - * List of resources on which the tag or tags are detached. - * - * @return the resources - */ - public List resources() { - return resources; - } - /** * Gets the tagName. * @@ -262,6 +256,28 @@ public List tagNames() { return tagNames; } + /** + * Gets the resources. + * + * List of resources on which the tagging operation operates on. + * + * @return the resources + */ + public List resources() { + return resources; + } + + /** + * Gets the query. + * + * A valid Global Search string. + * + * @return the query + */ + public QueryString query() { + return query; + } + /** * Gets the xRequestId. * diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptions.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptions.java index 5199e15ec1..d2fd91d9ab 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptions.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.ArrayList; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryString.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryString.java new file mode 100644 index 0000000000..9ba0251d91 --- /dev/null +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryString.java @@ -0,0 +1,106 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_tagging.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A valid Global Search string. + */ +public class QueryString extends GenericModel { + + @SerializedName("query_string") + protected String queryString; + + /** + * Builder. + */ + public static class Builder { + private String queryString; + + /** + * Instantiates a new Builder from an existing QueryString instance. + * + * @param queryString the instance to initialize the Builder with + */ + private Builder(QueryString queryString) { + this.queryString = queryString.queryString; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param queryString the queryString + */ + public Builder(String queryString) { + this.queryString = queryString; + } + + /** + * Builds a QueryString. + * + * @return the new QueryString instance + */ + public QueryString build() { + return new QueryString(this); + } + + /** + * Set the queryString. + * + * @param queryString the queryString + * @return the QueryString builder + */ + public Builder queryString(String queryString) { + this.queryString = queryString; + return this; + } + } + + protected QueryString() { } + + protected QueryString(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.queryString, + "queryString cannot be null"); + queryString = builder.queryString; + } + + /** + * New builder. + * + * @return a QueryString builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the queryString. + * + * The Lucene-formatted query string. + * + * @return the queryString + */ + public String queryString() { + return queryString; + } +} + diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Resource.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Resource.java index e565e0dff8..cd57c8157e 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Resource.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Resource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.google.gson.annotations.SerializedName; @@ -121,7 +122,10 @@ public String resourceId() { /** * Gets the resourceType. * - * The IMS resource type of the resource. + * The IMS resource type of the resource. It can be one of SoftLayer_Virtual_DedicatedHost, SoftLayer_Hardware, + * SoftLayer_Hardware_Server, SoftLayer_Network_Application_Delivery_Controller, SoftLayer_Network_Vlan, + * SoftLayer_Network_Vlan_Firewall, SoftLayer_Network_Component_Firewall, SoftLayer_Network_Firewall_Module_Context, + * SoftLayer_Virtual_Guest. * * @return the resourceType */ diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Tag.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Tag.java index cbfbce32ec..331ac64f5e 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Tag.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/Tag.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagList.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagList.java index 75d3ff598a..85df33ebea 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagList.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagList.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.List; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResults.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResults.java index 30d4406385..0e5ab7c536 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResults.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import java.util.List; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItem.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItem.java index ee520fc138..a7d54aae08 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItem.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/package-info.java b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/package-info.java index 1d00403a52..057350d5b9 100644 --- a/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/package-info.java +++ b/modules/global-tagging/src/main/java/com/ibm/cloud/platform_services/global_tagging/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + /** * Global Tagging v1. */ diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingTest.java index 31bd59dc83..8ecaf1be21 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1; import com.ibm.cloud.platform_services.global_tagging.v1.GlobalTagging; @@ -25,6 +26,7 @@ import com.ibm.cloud.platform_services.global_tagging.v1.model.DeleteTagsResultItem; import com.ibm.cloud.platform_services.global_tagging.v1.model.DetachTagOptions; import com.ibm.cloud.platform_services.global_tagging.v1.model.ListTagsOptions; +import com.ibm.cloud.platform_services.global_tagging.v1.model.QueryString; import com.ibm.cloud.platform_services.global_tagging.v1.model.Resource; import com.ibm.cloud.platform_services.global_tagging.v1.model.Tag; import com.ibm.cloud.platform_services.global_tagging.v1.model.TagList; @@ -316,11 +318,17 @@ public void testAttachTagWOptions() throws Throwable { .resourceType("testString") .build(); + // Construct an instance of the QueryString model + QueryString queryStringModel = new QueryString.Builder() + .queryString("testString") + .build(); + // Construct an instance of the AttachTagOptions model AttachTagOptions attachTagOptionsModel = new AttachTagOptions.Builder() - .resources(java.util.Arrays.asList(resourceModel)) .tagName("testString") .tagNames(java.util.Arrays.asList("testString")) + .resources(java.util.Arrays.asList(resourceModel)) + .query(queryStringModel) .xRequestId("testString") .xCorrelationId("testString") .accountId("testString") @@ -361,13 +369,6 @@ public void testAttachTagWRetries() throws Throwable { testAttachTagWOptions(); } - // Test the attachTag operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAttachTagNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - globalTaggingService.attachTag(null).execute(); - } - // Test the detachTag operation with a valid options model parameter @Test public void testDetachTagWOptions() throws Throwable { @@ -385,11 +386,17 @@ public void testDetachTagWOptions() throws Throwable { .resourceType("testString") .build(); + // Construct an instance of the QueryString model + QueryString queryStringModel = new QueryString.Builder() + .queryString("testString") + .build(); + // Construct an instance of the DetachTagOptions model DetachTagOptions detachTagOptionsModel = new DetachTagOptions.Builder() - .resources(java.util.Arrays.asList(resourceModel)) .tagName("testString") .tagNames(java.util.Arrays.asList("testString")) + .resources(java.util.Arrays.asList(resourceModel)) + .query(queryStringModel) .xRequestId("testString") .xCorrelationId("testString") .accountId("testString") @@ -426,13 +433,6 @@ public void testDetachTagWRetries() throws Throwable { testDetachTagWOptions(); } - // Test the detachTag operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDetachTagNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - globalTaggingService.detachTag(null).execute(); - } - // Perform setup needed before each test method @BeforeMethod public void beforeEachTest() { diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptionsTest.java index ceae456003..08e25e8817 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/AttachTagOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -14,6 +14,7 @@ package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.ibm.cloud.platform_services.global_tagging.v1.model.AttachTagOptions; +import com.ibm.cloud.platform_services.global_tagging.v1.model.QueryString; import com.ibm.cloud.platform_services.global_tagging.v1.model.Resource; import com.ibm.cloud.platform_services.global_tagging.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -39,10 +40,16 @@ public void testAttachTagOptions() throws Throwable { assertEquals(resourceModel.resourceId(), "testString"); assertEquals(resourceModel.resourceType(), "testString"); + QueryString queryStringModel = new QueryString.Builder() + .queryString("testString") + .build(); + assertEquals(queryStringModel.queryString(), "testString"); + AttachTagOptions attachTagOptionsModel = new AttachTagOptions.Builder() - .resources(java.util.Arrays.asList(resourceModel)) .tagName("testString") .tagNames(java.util.Arrays.asList("testString")) + .resources(java.util.Arrays.asList(resourceModel)) + .query(queryStringModel) .xRequestId("testString") .xCorrelationId("testString") .accountId("testString") @@ -50,9 +57,10 @@ public void testAttachTagOptions() throws Throwable { .replace(false) .update(false) .build(); - assertEquals(attachTagOptionsModel.resources(), java.util.Arrays.asList(resourceModel)); assertEquals(attachTagOptionsModel.tagName(), "testString"); assertEquals(attachTagOptionsModel.tagNames(), java.util.Arrays.asList("testString")); + assertEquals(attachTagOptionsModel.resources(), java.util.Arrays.asList(resourceModel)); + assertEquals(attachTagOptionsModel.query(), queryStringModel); assertEquals(attachTagOptionsModel.xRequestId(), "testString"); assertEquals(attachTagOptionsModel.xCorrelationId(), "testString"); assertEquals(attachTagOptionsModel.accountId(), "testString"); @@ -60,10 +68,4 @@ public void testAttachTagOptions() throws Throwable { assertEquals(attachTagOptionsModel.replace(), Boolean.valueOf(false)); assertEquals(attachTagOptionsModel.update(), Boolean.valueOf(false)); } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAttachTagOptionsError() throws Throwable { - new AttachTagOptions.Builder().build(); - } - } \ No newline at end of file diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptionsTest.java index b4177c3457..a2b95852ba 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItemTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItemTest.java index a81ef305eb..2cad363f32 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItemTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsResultsItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsTest.java index 835d2163e5..945f41f58a 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/CreateTagResultsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptionsTest.java index 515d60c0d2..baffd9cd70 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagAllOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptionsTest.java index 9bcc98fdbb..2797cf2e2f 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItemTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItemTest.java index b3b487d108..6b94dcb880 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItemTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsTest.java index d83a78fc6d..210263b799 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagResultsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItemTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItemTest.java index ab221b7369..fcc28ef8c7 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItemTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultTest.java index dea40e5f4d..37b01dca08 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DeleteTagsResultTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptionsTest.java index 24396bed47..81c7117718 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/DetachTagOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -14,6 +14,7 @@ package com.ibm.cloud.platform_services.global_tagging.v1.model; import com.ibm.cloud.platform_services.global_tagging.v1.model.DetachTagOptions; +import com.ibm.cloud.platform_services.global_tagging.v1.model.QueryString; import com.ibm.cloud.platform_services.global_tagging.v1.model.Resource; import com.ibm.cloud.platform_services.global_tagging.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -39,27 +40,28 @@ public void testDetachTagOptions() throws Throwable { assertEquals(resourceModel.resourceId(), "testString"); assertEquals(resourceModel.resourceType(), "testString"); + QueryString queryStringModel = new QueryString.Builder() + .queryString("testString") + .build(); + assertEquals(queryStringModel.queryString(), "testString"); + DetachTagOptions detachTagOptionsModel = new DetachTagOptions.Builder() - .resources(java.util.Arrays.asList(resourceModel)) .tagName("testString") .tagNames(java.util.Arrays.asList("testString")) + .resources(java.util.Arrays.asList(resourceModel)) + .query(queryStringModel) .xRequestId("testString") .xCorrelationId("testString") .accountId("testString") .tagType("user") .build(); - assertEquals(detachTagOptionsModel.resources(), java.util.Arrays.asList(resourceModel)); assertEquals(detachTagOptionsModel.tagName(), "testString"); assertEquals(detachTagOptionsModel.tagNames(), java.util.Arrays.asList("testString")); + assertEquals(detachTagOptionsModel.resources(), java.util.Arrays.asList(resourceModel)); + assertEquals(detachTagOptionsModel.query(), queryStringModel); assertEquals(detachTagOptionsModel.xRequestId(), "testString"); assertEquals(detachTagOptionsModel.xCorrelationId(), "testString"); assertEquals(detachTagOptionsModel.accountId(), "testString"); assertEquals(detachTagOptionsModel.tagType(), "user"); } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDetachTagOptionsError() throws Throwable { - new DetachTagOptions.Builder().build(); - } - } \ No newline at end of file diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptionsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptionsTest.java index fb0ece4e42..c37577cacd 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptionsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ListTagsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryStringTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryStringTest.java new file mode 100644 index 0000000000..6592ab4cd5 --- /dev/null +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/QueryStringTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_tagging.v1.model; + +import com.ibm.cloud.platform_services.global_tagging.v1.model.QueryString; +import com.ibm.cloud.platform_services.global_tagging.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the QueryString model. + */ +public class QueryStringTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testQueryString() throws Throwable { + QueryString queryStringModel = new QueryString.Builder() + .queryString("testString") + .build(); + assertEquals(queryStringModel.queryString(), "testString"); + + String json = TestUtilities.serialize(queryStringModel); + + QueryString queryStringModelNew = TestUtilities.deserialize(json, QueryString.class); + assertTrue(queryStringModelNew instanceof QueryString); + assertEquals(queryStringModelNew.queryString(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testQueryStringError() throws Throwable { + new QueryString.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ResourceTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ResourceTest.java index 9929fd0f6f..525b74c60e 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ResourceTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/ResourceTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagListTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagListTest.java index dd65dec29b..b538963260 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagListTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagListTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItemTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItemTest.java index 5c8034dd6a..f2b97b5883 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItemTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsTest.java index 8eb47ebc42..90d45e4436 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagResultsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagTest.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagTest.java index 50a95caf70..1ac2651b1a 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagTest.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/model/TagTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/utils/TestUtilities.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/utils/TestUtilities.java index ff7a211d9f..69e5c9cb9b 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/utils/TestUtilities.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2024. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,8 +10,10 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_tagging.v1.utils; +import java.util.Base64; import java.util.Map; import java.util.Set; import java.util.List; @@ -115,8 +117,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { diff --git a/pom.xml b/pom.xml index 38b9ab4d8a..53abfe22ea 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 7.11.0 4.12.0 3.1.2 - 0.8.10 + 0.8.11 3.1.1 1.6.13 3.1.0