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 568e550a6b5..e8d1518d3d0 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,6 +22,7 @@ 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; @@ -113,7 +114,12 @@ 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(); @@ -134,7 +140,12 @@ 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 f294e3e602f..a18c293d1dc 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. 2025. + * (C) Copyright IBM Corp. 2026. * * 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.105.0-3c13b041-20250605-193116 + * IBM OpenAPI SDK Code Generator Version: 3.111.0-1bfb72c2-20260206-185521 */ package com.ibm.cloud.platform_services.global_tagging.v1; 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 a7d54aae088..eae0268a593 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. 2025. + * (C) Copyright IBM Corp. 2026. * * 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 @@ -25,6 +25,7 @@ public class TagResultsItem extends GenericModel { protected String resourceId; @SerializedName("is_error") protected Boolean isError; + protected String message; protected TagResultsItem() { } @@ -49,5 +50,16 @@ public String getResourceId() { public Boolean isIsError() { return isError; } + + /** + * Gets the message. + * + * Error message returned when the operation fails. + * + * @return the message + */ + public String getMessage() { + return message; + } } diff --git a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingIT.java b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingIT.java index 85bb6ee634f..851863e254f 100644 --- a/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingIT.java +++ b/modules/global-tagging/src/test/java/com/ibm/cloud/platform_services/global_tagging/v1/GlobalTaggingIT.java @@ -396,7 +396,8 @@ public void testDeleteTagUser() throws Exception { assertNotNull(deleteTagResults.getResults()); for (DeleteTagResultsItem result : deleteTagResults.getResults()) { - assertFalse(result.isIsError()); + // tags are already deleted at detach time if not attached to any resource + assertTrue(result.isIsError()); } } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s\nError details: %s", e.getStatusCode(), 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 8ecaf1be215..b47e15f37d2 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. 2025. + * (C) Copyright IBM Corp. 2026. * * 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 @@ -305,7 +305,7 @@ public void testDeleteTagNoOptions() throws Throwable { @Test public void testAttachTagWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"results\": [{\"resource_id\": \"resourceId\", \"is_error\": false}]}"; + String mockResponseBody = "{\"results\": [{\"resource_id\": \"resourceId\", \"is_error\": false, \"message\": \"message\"}]}"; String attachTagPath = "/v3/tags/attach"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -373,7 +373,7 @@ public void testAttachTagWRetries() throws Throwable { @Test public void testDetachTagWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"results\": [{\"resource_id\": \"resourceId\", \"is_error\": false}]}"; + String mockResponseBody = "{\"results\": [{\"resource_id\": \"resourceId\", \"is_error\": false, \"message\": \"message\"}]}"; String detachTagPath = "/v3/tags/detach"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") 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 f2b97b58837..b45cdad14ba 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. 2025. + * (C) Copyright IBM Corp. 2026. * * 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 @@ -34,5 +34,6 @@ public void testTagResultsItem() throws Throwable { TagResultsItem tagResultsItemModel = new TagResultsItem(); assertNull(tagResultsItemModel.getResourceId()); assertNull(tagResultsItemModel.isIsError()); + assertNull(tagResultsItemModel.getMessage()); } } \ No newline at end of file