diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f036d827c46c..89c161f1cf6d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -524,7 +524,7 @@ com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-computebulkactions;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-artifactsigning;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-appnetwork;1.0.0-beta.1;1.0.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-servicegroups;1.0.0-beta.2;1.0.0-beta.3 +com.azure.resourcemanager:azure-resourcemanager-servicegroups;1.0.0-beta.2;1.0.0 com.azure.resourcemanager:azure-resourcemanager-horizondb;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-relationships;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-fileshares;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/CHANGELOG.md b/sdk/servicegroups/azure-resourcemanager-servicegroups/CHANGELOG.md index 3b33939d9558..411300fe99ba 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/CHANGELOG.md +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/CHANGELOG.md @@ -1,14 +1,40 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0 (2026-08-18) -### Features Added +- Azure Resource Manager Service Groups client library for Java. This package contains Microsoft Azure SDK for Service Groups Management SDK. Package api-version 2026-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ServiceGroupCollectionResponse` was removed + +#### `models.ServiceGroups` was modified + +* `listAncestorsWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `listAncestors(java.lang.String)` was removed + +### Features Added + +* `models.OperationDisplay` was added + +* `models.ActionType` was added + +* `models.Operation` was added + +* `models.Operations` was added + +* `models.Origin` was added + +* `models.ServiceGroupAttributes` was added + +#### `ServiceGroupsManager` was modified + +* `operations()` was added + +#### `models.ServiceGroupProperties` was modified -### Other Changes +* `withAttributes(models.ServiceGroupAttributes)` was added +* `attributes()` was added ## 1.0.0-beta.2 (2026-03-27) diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/README.md b/sdk/servicegroups/azure-resourcemanager-servicegroups/README.md index 95c8452f98ae..1163787cc698 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/README.md +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Service Groups client library for Java. -This package contains Microsoft Azure SDK for Service Groups Management SDK. The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those resources. Package api-version 2024-02-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Service Groups Management SDK. Package api-version 2026-08-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-servicegroups - 1.0.0-beta.2 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/SAMPLE.md b/sdk/servicegroups/azure-resourcemanager-servicegroups/SAMPLE.md index a6031d1a8fae..73bb2164b352 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/SAMPLE.md +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/SAMPLE.md @@ -1,6 +1,10 @@ # Code snippets and samples +## Operations + +- [List](#operations_list) + ## ResourceProvider - [CreateOrUpdateServiceGroup](#resourceprovider_createorupdateservicegroup) @@ -10,12 +14,33 @@ ## ServiceGroups - [Get](#servicegroups_get) -- [ListAncestors](#servicegroups_listancestors) +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-08-01/Operations_List.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to ServiceGroupsManager. + */ + public static void listOperations(com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + ### ResourceProvider_CreateOrUpdateServiceGroup ```java import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; /** @@ -23,7 +48,7 @@ import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; */ public final class ResourceProviderCreateOrUpdateServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Put.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Put.json */ /** * Sample code: PutServiceGroup. @@ -35,6 +60,7 @@ public final class ResourceProviderCreateOrUpdateServiceGroupSamples { .createOrUpdateServiceGroup("ServiceGroup1", new ServiceGroupInner() .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name") + .withAttributes(new ServiceGroupAttributes().withCriticality(2)) .withParent(new ParentServiceGroupProperties() .withResourceId("/providers/Microsoft.Management/serviceGroups/RootGroup"))), com.azure.core.util.Context.NONE); @@ -50,7 +76,7 @@ public final class ResourceProviderCreateOrUpdateServiceGroupSamples { */ public final class ResourceProviderDeleteServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Delete.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Delete.json */ /** * Sample code: DeleteServiceGroup. @@ -68,6 +94,7 @@ public final class ResourceProviderDeleteServiceGroupSamples { ```java import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import java.util.HashMap; import java.util.Map; @@ -77,7 +104,7 @@ import java.util.Map; */ public final class ResourceProviderUpdateServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Patch.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Patch.json */ /** * Sample code: PatchServiceGroup. @@ -88,7 +115,8 @@ public final class ResourceProviderUpdateServiceGroupSamples { manager.resourceProviders() .updateServiceGroup("ServiceGroup1", new ServiceGroupInner() - .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name")) + .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name") + .withAttributes(new ServiceGroupAttributes().withCriticality(2))) .withTags(mapOf("tag1", "value1", "tag2", "value2")), com.azure.core.util.Context.NONE); } @@ -115,7 +143,7 @@ public final class ResourceProviderUpdateServiceGroupSamples { */ public final class ServiceGroupsGetSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Get.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Get.json */ /** * Sample code: GetServiceGroup. @@ -129,25 +157,3 @@ public final class ServiceGroupsGetSamples { } ``` -### ServiceGroups_ListAncestors - -```java -/** - * Samples for ServiceGroups ListAncestors. - */ -public final class ServiceGroupsListAncestorsSamples { - /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_ListAncestors.json - */ - /** - * Sample code: ListServiceGroupAncestors. - * - * @param manager Entry point to ServiceGroupsManager. - */ - public static void listServiceGroupAncestors(com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager) { - manager.serviceGroups() - .listAncestorsWithResponse("20000000-0001-0000-0000-000000000000", com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/pom.xml b/sdk/servicegroups/azure-resourcemanager-servicegroups/pom.xml index 82b8aceee6c9..24ff3c5b649e 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/pom.xml +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-servicegroups - 1.0.0-beta.3 + 1.0.0 jar Microsoft Azure SDK for Service Groups Management - This package contains Microsoft Azure SDK for Service Groups Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those resources. Package api-version 2024-02-01-preview. + This package contains Microsoft Azure SDK for Service Groups Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-08-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - true + false diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java index d0c1cae668b4..c284bb9f12f5 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java @@ -25,9 +25,11 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsManagementClient; +import com.azure.resourcemanager.servicegroups.implementation.OperationsImpl; import com.azure.resourcemanager.servicegroups.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsImpl; import com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsManagementClientBuilder; +import com.azure.resourcemanager.servicegroups.models.Operations; import com.azure.resourcemanager.servicegroups.models.ResourceProviders; import com.azure.resourcemanager.servicegroups.models.ServiceGroups; import java.time.Duration; @@ -40,15 +42,14 @@ /** * Entry point to ServiceGroupsManager. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ public final class ServiceGroupsManager { private ResourceProviders resourceProviders; private ServiceGroups serviceGroups; + private Operations operations; + private final ServiceGroupsManagementClient clientObject; private ServiceGroupsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -287,6 +288,18 @@ public ServiceGroups serviceGroups() { return serviceGroups; } + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + /** * Gets wrapped service client ServiceGroupsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/OperationsClient.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/OperationsClient.java new file mode 100644 index 000000000000..181f39c857c0 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java index b6fc01584fa0..6c5fe6459e6a 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java @@ -8,7 +8,6 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; /** @@ -39,29 +38,4 @@ public interface ServiceGroupsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) ServiceGroupInner get(String serviceGroupName); - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAncestorsWithResponse(String serviceGroupName, Context context); - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceGroupCollectionResponseInner listAncestors(String serviceGroupName); } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java index 269959999716..b454b0bdae4e 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java @@ -52,4 +52,11 @@ public interface ServiceGroupsManagementClient { * @return the ServiceGroupsClient object. */ ServiceGroupsClient getServiceGroups(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/OperationInner.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/OperationInner.java new file mode 100644 index 000000000000..8d1bd143b08d --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicegroups.models.ActionType; +import com.azure.resourcemanager.servicegroups.models.OperationDisplay; +import com.azure.resourcemanager.servicegroups.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java index 2b6d36660b08..52da12e4b5d5 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java @@ -4,8 +4,5 @@ /** * Package containing the inner data models for ServiceGroupsManagementClient. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ package com.azure.resourcemanager.servicegroups.fluent.models; diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java index 67ccf2f18860..a89eb796c12c 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java @@ -4,8 +4,5 @@ /** * Package containing the service clients for ServiceGroupsManagementClient. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ package com.azure.resourcemanager.servicegroups.fluent; diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationImpl.java new file mode 100644 index 000000000000..9ad9f6499eec --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.implementation; + +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; +import com.azure.resourcemanager.servicegroups.models.ActionType; +import com.azure.resourcemanager.servicegroups.models.Operation; +import com.azure.resourcemanager.servicegroups.models.OperationDisplay; +import com.azure.resourcemanager.servicegroups.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsClientImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..7211ba3378b7 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.servicegroups.fluent.OperationsClient; +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; +import com.azure.resourcemanager.servicegroups.implementation.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final ServiceGroupsManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ServiceGroupsManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceGroupsManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ServiceGroupsManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsImpl.java new file mode 100644 index 000000000000..3076984aaed9 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicegroups.fluent.OperationsClient; +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; +import com.azure.resourcemanager.servicegroups.models.Operation; +import com.azure.resourcemanager.servicegroups.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupCollectionResponseImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupCollectionResponseImpl.java deleted file mode 100644 index f8c51b8db505..000000000000 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupCollectionResponseImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.servicegroups.implementation; - -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; -import com.azure.resourcemanager.servicegroups.models.ServiceGroup; -import com.azure.resourcemanager.servicegroups.models.ServiceGroupCollectionResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ServiceGroupCollectionResponseImpl implements ServiceGroupCollectionResponse { - private ServiceGroupCollectionResponseInner innerObject; - - private final com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager; - - ServiceGroupCollectionResponseImpl(ServiceGroupCollectionResponseInner innerObject, - com.azure.resourcemanager.servicegroups.ServiceGroupsManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ServiceGroupImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public ServiceGroupCollectionResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java index 21d385800672..cf1b77cc85a0 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -23,7 +22,6 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient; -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import reactor.core.publisher.Mono; @@ -74,22 +72,6 @@ Mono> get(@HostParam("endpoint") String endpoint, Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("serviceGroupName") String serviceGroupName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/listAncestors") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAncestors(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("serviceGroupName") String serviceGroupName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/serviceGroups/{serviceGroupName}/listAncestors") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listAncestorsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("serviceGroupName") String serviceGroupName, - @HeaderParam("Accept") String accept, Context context); } /** @@ -154,70 +136,4 @@ public Response getWithResponse(String serviceGroupName, Cont public ServiceGroupInner get(String serviceGroupName) { return getWithResponse(serviceGroupName, Context.NONE).getValue(); } - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAncestorsWithResponseAsync(String serviceGroupName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAncestors(this.client.getEndpoint(), this.client.getApiVersion(), - serviceGroupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAncestorsAsync(String serviceGroupName) { - return listAncestorsWithResponseAsync(serviceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAncestorsWithResponse(String serviceGroupName, - Context context) { - final String accept = "application/json"; - return service.listAncestorsSync(this.client.getEndpoint(), this.client.getApiVersion(), serviceGroupName, - accept, context); - } - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceGroupCollectionResponseInner listAncestors(String serviceGroupName) { - return listAncestorsWithResponse(serviceGroupName, Context.NONE).getValue(); - } } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java index 98590461f022..73525beaa262 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java @@ -9,10 +9,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient; -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ServiceGroup; -import com.azure.resourcemanager.servicegroups.models.ServiceGroupCollectionResponse; import com.azure.resourcemanager.servicegroups.models.ServiceGroups; public final class ServiceGroupsImpl implements ServiceGroups { @@ -43,23 +41,6 @@ public ServiceGroup get(String serviceGroupName) { } } - public Response listAncestorsWithResponse(String serviceGroupName, - Context context) { - Response inner - = this.serviceClient().listAncestorsWithResponse(serviceGroupName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceGroupCollectionResponseImpl(inner.getValue(), this.manager())); - } - - public ServiceGroupCollectionResponse listAncestors(String serviceGroupName) { - ServiceGroupCollectionResponseInner inner = this.serviceClient().listAncestors(serviceGroupName); - if (inner != null) { - return new ServiceGroupCollectionResponseImpl(inner, this.manager()); - } else { - return null; - } - } - private ServiceGroupsClient serviceClient() { return this.innerClient; } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java index 9d7c4205fe60..f66b8807e58f 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java @@ -26,6 +26,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.servicegroups.fluent.OperationsClient; import com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient; import com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient; import com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsManagementClient; @@ -141,6 +142,20 @@ public ServiceGroupsClient getServiceGroups() { return this.serviceGroups; } + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** * Initializes an instance of ServiceGroupsManagementClient client. * @@ -156,9 +171,10 @@ public ServiceGroupsClient getServiceGroups() { this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.apiVersion = "2024-02-01-preview"; + this.apiVersion = "2026-08-01"; this.resourceProviders = new ResourceProvidersClientImpl(this); this.serviceGroups = new ServiceGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); } /** diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupCollectionResponseInner.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/models/OperationListResult.java similarity index 55% rename from sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupCollectionResponseInner.java rename to sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/models/OperationListResult.java index 02eb7501f8ed..769afcc0faf3 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupCollectionResponseInner.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/models/OperationListResult.java @@ -2,26 +2,27 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.servicegroups.fluent.models; +package com.azure.resourcemanager.servicegroups.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; import java.io.IOException; import java.util.List; /** - * Response holding an array of service groups and a nextLink that supports pagination. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable -public final class ServiceGroupCollectionResponseInner - implements JsonSerializable { +public final class OperationListResult implements JsonSerializable { /* - * The ServiceGroup items on this page + * The Operation items on this page */ - private List value; + private List value; /* * The link to the next page of items @@ -29,17 +30,17 @@ public final class ServiceGroupCollectionResponseInner private String nextLink; /** - * Creates an instance of ServiceGroupCollectionResponseInner class. + * Creates an instance of OperationListResult class. */ - private ServiceGroupCollectionResponseInner() { + private OperationListResult() { } /** - * Get the value property: The ServiceGroup items on this page. + * Get the value property: The Operation items on this page. * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -64,33 +65,32 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ServiceGroupCollectionResponseInner from the JsonReader. + * Reads an instance of OperationListResult from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ServiceGroupCollectionResponseInner if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ServiceGroupCollectionResponseInner. + * @throws IOException If an error occurs while reading the OperationListResult. */ - public static ServiceGroupCollectionResponseInner fromJson(JsonReader jsonReader) throws IOException { + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ServiceGroupCollectionResponseInner deserializedServiceGroupCollectionResponseInner - = new ServiceGroupCollectionResponseInner(); + OperationListResult deserializedOperationListResult = new OperationListResult(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ServiceGroupInner.fromJson(reader1)); - deserializedServiceGroupCollectionResponseInner.value = value; + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedServiceGroupCollectionResponseInner.nextLink = reader.getString(); + deserializedOperationListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedServiceGroupCollectionResponseInner; + return deserializedOperationListResult; }); } } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java index a114d0465c8f..c00ef234858b 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java @@ -4,8 +4,5 @@ /** * Package containing the implementations for ServiceGroupsManagementClient. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ package com.azure.resourcemanager.servicegroups.implementation; diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ActionType.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ActionType.java new file mode 100644 index 000000000000..cf4b8d93baf3 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operation.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operation.java new file mode 100644 index 000000000000..ead6196b23fa --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.servicegroups.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/OperationDisplay.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/OperationDisplay.java new file mode 100644 index 000000000000..d55c6b6cf9c6 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operations.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operations.java new file mode 100644 index 000000000000..c3bddab88f6b --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all available REST API operations for the Microsoft.Management resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Origin.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Origin.java new file mode 100644 index 000000000000..91116ba007a6 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupAttributes.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupAttributes.java new file mode 100644 index 000000000000..b37596e97e24 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupAttributes.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The attributes of the serviceGroup. + */ +@Fluent +public final class ServiceGroupAttributes implements JsonSerializable { + /* + * The criticality designation of the service group. Valid values range from 0 through 4. + */ + private Integer criticality; + + /** + * Creates an instance of ServiceGroupAttributes class. + */ + public ServiceGroupAttributes() { + } + + /** + * Get the criticality property: The criticality designation of the service group. Valid values range from 0 through + * 4. + * + * @return the criticality value. + */ + public Integer criticality() { + return this.criticality; + } + + /** + * Set the criticality property: The criticality designation of the service group. Valid values range from 0 through + * 4. + * + * @param criticality the criticality value to set. + * @return the ServiceGroupAttributes object itself. + */ + public ServiceGroupAttributes withCriticality(Integer criticality) { + this.criticality = criticality; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("criticality", this.criticality); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceGroupAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceGroupAttributes if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceGroupAttributes. + */ + public static ServiceGroupAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceGroupAttributes deserializedServiceGroupAttributes = new ServiceGroupAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("criticality".equals(fieldName)) { + deserializedServiceGroupAttributes.criticality = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceGroupAttributes; + }); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupCollectionResponse.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupCollectionResponse.java deleted file mode 100644 index d92b1d9e9ed2..000000000000 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupCollectionResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.servicegroups.models; - -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of ServiceGroupCollectionResponse. - */ -public interface ServiceGroupCollectionResponse { - /** - * Gets the value property: The ServiceGroup items on this page. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner object. - * - * @return the inner object. - */ - ServiceGroupCollectionResponseInner innerModel(); -} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java index 54c26f120a14..f84fb1a88750 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java @@ -26,6 +26,11 @@ public final class ServiceGroupProperties implements JsonSerializable listAncestorsWithResponse(String serviceGroupName, Context context); - - /** - * Get the details of the serviceGroup's ancestors. - * - * @param serviceGroupName ServiceGroup Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of the serviceGroup's ancestors. - */ - ServiceGroupCollectionResponse listAncestors(String serviceGroupName); } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java index 917093e8b8ce..ce37b95a3d28 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java @@ -4,8 +4,5 @@ /** * Package containing the data models for ServiceGroupsManagementClient. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ package com.azure.resourcemanager.servicegroups.models; diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/package-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/package-info.java index 4c5d84f2c060..2f48f4ea34fe 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/package-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/com/azure/resourcemanager/servicegroups/package-info.java @@ -4,8 +4,5 @@ /** * Package containing the classes for ServiceGroupsManagementClient. - * The Groups RP provides Service Groups as a construct to group multiple resources, resource groups, subscriptions and - * other service groups into an organizational hierarchy and centrally manage access control, policies, alerting and - * reporting for those resources. */ package com.azure.resourcemanager.servicegroups; diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/module-info.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/module-info.java index 4becf1ace71b..f6390d75c382 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/module-info.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/java/module-info.java @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.servicegroups.fluent.models to com.azure.core; opens com.azure.resourcemanager.servicegroups.models to com.azure.core; + opens com.azure.resourcemanager.servicegroups.implementation.models to com.azure.core; } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/azure-resourcemanager-servicegroups_metadata.json b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/azure-resourcemanager-servicegroups_metadata.json index f99ffcf86307..6b39291b88f0 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/azure-resourcemanager-servicegroups_metadata.json +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/azure-resourcemanager-servicegroups_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Microsoft.Management":"2024-02-01-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient":"Microsoft.Management","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginCreateOrUpdateServiceGroup":"Microsoft.Management.ServiceGroups.createOrUpdateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginDeleteServiceGroup":"Microsoft.Management.ServiceGroups.deleteServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginUpdateServiceGroup":"Microsoft.Management.ServiceGroups.updateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.createOrUpdateServiceGroup":"Microsoft.Management.ServiceGroups.createOrUpdateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.deleteServiceGroup":"Microsoft.Management.ServiceGroups.deleteServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.updateServiceGroup":"Microsoft.Management.ServiceGroups.updateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient":"Microsoft.Management.ServiceGroups","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.get":"Microsoft.Management.ServiceGroups.get","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.getWithResponse":"Microsoft.Management.ServiceGroups.get","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.listAncestors":"Microsoft.Management.ServiceGroups.listAncestors","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.listAncestorsWithResponse":"Microsoft.Management.ServiceGroups.listAncestors","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsManagementClient":"Microsoft.Management","com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner":"Microsoft.Management.ServiceGroupCollectionResponse","com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner":"Microsoft.Management.ServiceGroup","com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsManagementClientBuilder":"Microsoft.Management","com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties":"Microsoft.Management.ParentServiceGroupProperties","com.azure.resourcemanager.servicegroups.models.ProvisioningState":"Microsoft.Management.ProvisioningState","com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties":"Microsoft.Management.ServiceGroupProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ResourceProvidersClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupCollectionResponseInner.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupInner.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceProvidersImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupCollectionResponseImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ParentServiceGroupProperties.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ResourceProviders.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroup.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupCollectionResponse.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroups.java","src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Microsoft.Management":"2026-08-01"},"crossLanguagePackageId":"Microsoft.Management","crossLanguageVersion":"3d238f7f7028","crossLanguageDefinitions":{"com.azure.resourcemanager.servicegroups.fluent.OperationsClient":"Microsoft.Management.Operations","com.azure.resourcemanager.servicegroups.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient":"Microsoft.Management","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginCreateOrUpdateServiceGroup":"Microsoft.Management.ServiceGroups.createOrUpdateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginDeleteServiceGroup":"Microsoft.Management.ServiceGroups.deleteServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.beginUpdateServiceGroup":"Microsoft.Management.ServiceGroups.updateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.createOrUpdateServiceGroup":"Microsoft.Management.ServiceGroups.createOrUpdateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.deleteServiceGroup":"Microsoft.Management.ServiceGroups.deleteServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ResourceProvidersClient.updateServiceGroup":"Microsoft.Management.ServiceGroups.updateServiceGroup","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient":"Microsoft.Management.ServiceGroups","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.get":"Microsoft.Management.ServiceGroups.get","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsClient.getWithResponse":"Microsoft.Management.ServiceGroups.get","com.azure.resourcemanager.servicegroups.fluent.ServiceGroupsManagementClient":"Microsoft.Management","com.azure.resourcemanager.servicegroups.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner":"Microsoft.Management.ServiceGroup","com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsManagementClientBuilder":"Microsoft.Management","com.azure.resourcemanager.servicegroups.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.servicegroups.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.servicegroups.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.servicegroups.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties":"Microsoft.Management.ParentServiceGroupProperties","com.azure.resourcemanager.servicegroups.models.ProvisioningState":"Microsoft.Management.ProvisioningState","com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes":"Microsoft.Management.ServiceGroupAttributes","com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties":"Microsoft.Management.ServiceGroupProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/servicegroups/ServiceGroupsManager.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ResourceProvidersClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/ServiceGroupsManagementClient.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/ServiceGroupInner.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/fluent/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ResourceProvidersImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/ServiceGroupsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/servicegroups/implementation/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ActionType.java","src/main/java/com/azure/resourcemanager/servicegroups/models/Operation.java","src/main/java/com/azure/resourcemanager/servicegroups/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/servicegroups/models/Operations.java","src/main/java/com/azure/resourcemanager/servicegroups/models/Origin.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ParentServiceGroupProperties.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ResourceProviders.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroup.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupAttributes.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroupProperties.java","src/main/java/com/azure/resourcemanager/servicegroups/models/ServiceGroups.java","src/main/java/com/azure/resourcemanager/servicegroups/models/package-info.java","src/main/java/com/azure/resourcemanager/servicegroups/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicegroups/proxy-config.json b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicegroups/proxy-config.json index 7cc5a85c7b3b..2c166f1dbe7b 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicegroups/proxy-config.json +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-servicegroups/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.servicegroups.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsClientImpl$ServiceGroupsService"]] \ No newline at end of file +[["com.azure.resourcemanager.servicegroups.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.servicegroups.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.servicegroups.implementation.ServiceGroupsClientImpl$ServiceGroupsService"]] \ No newline at end of file diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/OperationsListSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/OperationsListSamples.java new file mode 100644 index 000000000000..8f04a2351810 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-08-01/Operations_List.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to ServiceGroupsManager. + */ + public static void listOperations(com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderCreateOrUpdateServiceGroupSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderCreateOrUpdateServiceGroupSamples.java index 1f8254f888b1..6ef278097075 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderCreateOrUpdateServiceGroupSamples.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderCreateOrUpdateServiceGroupSamples.java @@ -6,6 +6,7 @@ import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; /** @@ -13,7 +14,7 @@ */ public final class ResourceProviderCreateOrUpdateServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Put.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Put.json */ /** * Sample code: PutServiceGroup. @@ -25,6 +26,7 @@ public static void putServiceGroup(com.azure.resourcemanager.servicegroups.Servi .createOrUpdateServiceGroup("ServiceGroup1", new ServiceGroupInner() .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name") + .withAttributes(new ServiceGroupAttributes().withCriticality(2)) .withParent(new ParentServiceGroupProperties() .withResourceId("/providers/Microsoft.Management/serviceGroups/RootGroup"))), com.azure.core.util.Context.NONE); diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderDeleteServiceGroupSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderDeleteServiceGroupSamples.java index 403dce531387..41ed6cee2a70 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderDeleteServiceGroupSamples.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderDeleteServiceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceProviderDeleteServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Delete.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Delete.json */ /** * Sample code: DeleteServiceGroup. diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderUpdateServiceGroupSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderUpdateServiceGroupSamples.java index 541303cc6240..8cd12fef6031 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderUpdateServiceGroupSamples.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ResourceProviderUpdateServiceGroupSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicegroups.generated; import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import java.util.HashMap; import java.util.Map; @@ -14,7 +15,7 @@ */ public final class ResourceProviderUpdateServiceGroupSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Patch.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Patch.json */ /** * Sample code: PatchServiceGroup. @@ -25,7 +26,8 @@ public static void patchServiceGroup(com.azure.resourcemanager.servicegroups.Ser manager.resourceProviders() .updateServiceGroup("ServiceGroup1", new ServiceGroupInner() - .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name")) + .withProperties(new ServiceGroupProperties().withDisplayName("ServiceGroup 1 Name") + .withAttributes(new ServiceGroupAttributes().withCriticality(2))) .withTags(mapOf("tag1", "value1", "tag2", "value2")), com.azure.core.util.Context.NONE); } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetSamples.java index e7c969d58534..621038efebd3 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetSamples.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ServiceGroupsGetSamples { /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_Get.json + * x-ms-original-file: 2026-08-01/ServiceGroup_Get.json */ /** * Sample code: GetServiceGroup. diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsSamples.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsSamples.java deleted file mode 100644 index 582c83bfabb2..000000000000 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/samples/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.servicegroups.generated; - -/** - * Samples for ServiceGroups ListAncestors. - */ -public final class ServiceGroupsListAncestorsSamples { - /* - * x-ms-original-file: 2024-02-01-preview/ServiceGroup_ListAncestors.json - */ - /** - * Sample code: ListServiceGroupAncestors. - * - * @param manager Entry point to ServiceGroupsManager. - */ - public static void listServiceGroupAncestors(com.azure.resourcemanager.servicegroups.ServiceGroupsManager manager) { - manager.serviceGroups() - .listAncestorsWithResponse("20000000-0001-0000-0000-000000000000", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationDisplayTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..09bdb42aca80 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicegroups.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"udccsnhsjc\",\"resource\":\"ejhkry\",\"operation\":\"napczwlokjy\",\"description\":\"kkvnipjox\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationInnerTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationInnerTests.java new file mode 100644 index 000000000000..9ed601665d63 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicegroups.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"pikxwczbyscnpqxu\",\"isDataAction\":false,\"display\":{\"provider\":\"n\",\"resource\":\"b\",\"operation\":\"rkxvdum\",\"description\":\"rtfw\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationListResultTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationListResultTests.java new file mode 100644 index 000000000000..7710d9f324be --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicegroups.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"rvktsi\",\"isDataAction\":false,\"display\":{\"provider\":\"ipa\",\"resource\":\"ajpsquc\",\"operation\":\"o\",\"description\":\"dkfo\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"ofjdde\",\"isDataAction\":false,\"display\":{\"provider\":\"upewnwreitjzy\",\"resource\":\"usarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"cdm\",\"isDataAction\":true,\"display\":{\"provider\":\"y\",\"resource\":\"nzwuxzd\",\"operation\":\"a\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"yrtih\",\"isDataAction\":true,\"display\":{\"provider\":\"bpzvgn\",\"resource\":\"symglzufcyz\",\"operation\":\"hdbihan\",\"description\":\"hfcbjysa\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"hab\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("hab", model.nextLink()); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationsListMockTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..2e628569e50f --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.servicegroups.ServiceGroupsManager; +import com.azure.resourcemanager.servicegroups.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"spwgcuertumkdosv\",\"isDataAction\":true,\"display\":{\"provider\":\"dgbb\",\"resource\":\"ddgmb\",\"operation\":\"ex\",\"description\":\"bhtqqrolfpfpsa\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ServiceGroupsManager manager = ServiceGroupsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ParentServiceGroupPropertiesTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ParentServiceGroupPropertiesTests.java index decea9677f0f..1f851bc73ed8 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ParentServiceGroupPropertiesTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ParentServiceGroupPropertiesTests.java @@ -12,14 +12,14 @@ public final class ParentServiceGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ParentServiceGroupProperties model - = BinaryData.fromString("{\"resourceId\":\"ajpsquc\"}").toObject(ParentServiceGroupProperties.class); - Assertions.assertEquals("ajpsquc", model.resourceId()); + = BinaryData.fromString("{\"resourceId\":\"f\"}").toObject(ParentServiceGroupProperties.class); + Assertions.assertEquals("f", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ParentServiceGroupProperties model = new ParentServiceGroupProperties().withResourceId("ajpsquc"); + ParentServiceGroupProperties model = new ParentServiceGroupProperties().withResourceId("f"); model = BinaryData.fromObject(model).toObject(ParentServiceGroupProperties.class); - Assertions.assertEquals("ajpsquc", model.resourceId()); + Assertions.assertEquals("f", model.resourceId()); } } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersCreateOrUpdateServiceGroupMockTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersCreateOrUpdateServiceGroupMockTests.java index 017e50184a9f..81b7da8b2063 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersCreateOrUpdateServiceGroupMockTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersCreateOrUpdateServiceGroupMockTests.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; import com.azure.resourcemanager.servicegroups.models.ServiceGroup; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -26,7 +27,7 @@ public final class ResourceProvidersCreateOrUpdateServiceGroupMockTests { @Test public void testCreateOrUpdateServiceGroup() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"yevc\",\"parent\":{\"resourceId\":\"ihnhun\"}},\"kind\":\"wjzrnfygxgisp\",\"tags\":{\"ofx\":\"tzfkufubl\"},\"id\":\"ofjaeqjhqjb\",\"name\":\"s\",\"type\":\"msmjqulngsntn\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"lluwfzitonpeq\",\"attributes\":{\"criticality\":813348790},\"parent\":{\"resourceId\":\"xofpdvhpfxxypi\"}},\"kind\":\"nmayhuybb\",\"tags\":{\"nuvamiheogna\":\"depoog\",\"usivye\":\"xzxtheo\",\"nfygxgispemvtz\":\"cciqihnhungbwjz\"},\"id\":\"ufubl\",\"name\":\"ofx\",\"type\":\"eofjaeqjh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,18 +37,21 @@ public void testCreateOrUpdateServiceGroup() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceGroup response = manager.resourceProviders() - .createOrUpdateServiceGroup("sy", + .createOrUpdateServiceGroup("jnchgej", new ServiceGroupInner() - .withProperties(new ServiceGroupProperties().withDisplayName("ojakhmsbzjhcrze") - .withParent(new ParentServiceGroupProperties().withResourceId("hlxaolthqtr"))) - .withKind("jbp") - .withTags(mapOf("n", "s", "wzo", "gvfcj", "np", "xjtfelluwfzit", "lxofpdvhpfxxypin", "qfpjk")), + .withProperties(new ServiceGroupProperties().withDisplayName("ailzydehojwyahu") + .withAttributes(new ServiceGroupAttributes().withCriticality(1511051439)) + .withParent(new ParentServiceGroupProperties().withResourceId("njaqwixjspro"))) + .withKind("cputegjvwmfdats") + .withTags(mapOf("kjozkrwfnd", "vpjhulsuuv", "vwryoqpso", "odjpslwejd", "yffdfdos", "cctazakljlahbc", + "hcrzevd", "gexpaojakhmsbz")), com.azure.core.util.Context.NONE); - Assertions.assertEquals("yevc", response.properties().displayName()); - Assertions.assertEquals("ihnhun", response.properties().parent().resourceId()); - Assertions.assertEquals("wjzrnfygxgisp", response.kind()); - Assertions.assertEquals("tzfkufubl", response.tags().get("ofx")); + Assertions.assertEquals("lluwfzitonpeq", response.properties().displayName()); + Assertions.assertEquals(813348790, response.properties().attributes().criticality()); + Assertions.assertEquals("xofpdvhpfxxypi", response.properties().parent().resourceId()); + Assertions.assertEquals("nmayhuybb", response.kind()); + Assertions.assertEquals("depoog", response.tags().get("nuvamiheogna")); } // Use "Map.of" if available diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersUpdateServiceGroupMockTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersUpdateServiceGroupMockTests.java index 3ab556c3f919..bb5acaa12f9c 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersUpdateServiceGroupMockTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ResourceProvidersUpdateServiceGroupMockTests.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; import com.azure.resourcemanager.servicegroups.models.ServiceGroup; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -26,7 +27,7 @@ public final class ResourceProvidersUpdateServiceGroupMockTests { @Test public void testUpdateServiceGroup() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"i\",\"parent\":{\"resourceId\":\"hxh\"}},\"kind\":\"okftyxolniwpwcuk\",\"tags\":{\"lryplwckbasyy\":\"giawx\",\"jkot\":\"nddhsgcbacph\",\"wyqkgfgibm\":\"nqgoulzndli\",\"qsrxybzqqed\":\"dgak\"},\"id\":\"tbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"mrldhu\",\"attributes\":{\"criticality\":700845418},\"parent\":{\"resourceId\":\"tqxhocdgeab\"}},\"kind\":\"phut\",\"tags\":{\"i\":\"dvkaozw\"},\"id\":\"yhxhu\",\"name\":\"okftyxolniwpwcuk\",\"type\":\"fkgiawxk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,19 +37,20 @@ public void testUpdateServiceGroup() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceGroup response = manager.resourceProviders() - .updateServiceGroup("ybkzgcwr", + .updateServiceGroup("jbasvmsmjqulngs", new ServiceGroupInner() - .withProperties(new ServiceGroupProperties().withDisplayName("wrljdouskc") - .withParent(new ParentServiceGroupProperties().withResourceId("ocrcjdk"))) - .withKind("nh") - .withTags(mapOf("qpjwnzlljfm", "jbiksqrglssai", "vmgxsab", "pee", "jczdzevndh", "yqduujit", - "feusnhut", "rwpdappdsbdkvwrw")), + .withProperties(new ServiceGroupProperties().withDisplayName("bkzgcwrwclx") + .withAttributes(new ServiceGroupAttributes().withCriticality(1729632043)) + .withParent(new ParentServiceGroupProperties().withResourceId("ouskcqvkocrc"))) + .withKind("kwt") + .withTags(mapOf("p", "bnjbiksqrglssain", "mgxsab", "wnzlljfmppeeb", "jczdzevndh", "yqduujit")), com.azure.core.util.Context.NONE); - Assertions.assertEquals("i", response.properties().displayName()); - Assertions.assertEquals("hxh", response.properties().parent().resourceId()); - Assertions.assertEquals("okftyxolniwpwcuk", response.kind()); - Assertions.assertEquals("giawx", response.tags().get("lryplwckbasyy")); + Assertions.assertEquals("mrldhu", response.properties().displayName()); + Assertions.assertEquals(700845418, response.properties().attributes().criticality()); + Assertions.assertEquals("tqxhocdgeab", response.properties().parent().resourceId()); + Assertions.assertEquals("phut", response.kind()); + Assertions.assertEquals("dvkaozw", response.tags().get("i")); } // Use "Map.of" if available diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupAttributesTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupAttributesTests.java new file mode 100644 index 000000000000..a76edd75cdb9 --- /dev/null +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupAttributesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicegroups.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; +import org.junit.jupiter.api.Assertions; + +public final class ServiceGroupAttributesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceGroupAttributes model + = BinaryData.fromString("{\"criticality\":1364266534}").toObject(ServiceGroupAttributes.class); + Assertions.assertEquals(1364266534, model.criticality()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceGroupAttributes model = new ServiceGroupAttributes().withCriticality(1364266534); + model = BinaryData.fromObject(model).toObject(ServiceGroupAttributes.class); + Assertions.assertEquals(1364266534, model.criticality()); + } +} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupCollectionResponseInnerTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupCollectionResponseInnerTests.java deleted file mode 100644 index e5766b4b18d7..000000000000 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupCollectionResponseInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.servicegroups.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupCollectionResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ServiceGroupCollectionResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceGroupCollectionResponseInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"kfo\",\"parent\":{\"resourceId\":\"ygjofjdd\"}},\"kind\":\"s\",\"tags\":{\"lusarh\":\"upewnwreitjzy\",\"urkdtmlx\":\"ofcqhsm\",\"kc\":\"ekuksjtx\",\"xzdxtayrlhmwh\":\"mparcryuanzw\"},\"id\":\"mrqobmtukknr\",\"name\":\"rtihfxtijbpz\",\"type\":\"gnwzsymglzufc\"},{\"properties\":{\"provisioningState\":\"NotStarted\",\"displayName\":\"dbihanufhfcbj\",\"parent\":{\"resourceId\":\"git\"}},\"kind\":\"qhabifpikxwcz\",\"tags\":{\"rkxvdum\":\"cnpqxuhivyqniwby\",\"xgaudccs\":\"grtfwvu\",\"jcny\":\"h\"},\"id\":\"hkryhtn\",\"name\":\"pczwlo\",\"type\":\"jye\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"ipjoxzjnchgejs\",\"parent\":{\"resourceId\":\"mailzydehojw\"}},\"kind\":\"huxinpmqnj\",\"tags\":{\"vwmf\":\"ixjsprozvcputeg\",\"pjhulsuuvmkj\":\"atscmd\",\"iodjp\":\"zkrwfn\"},\"id\":\"w\",\"name\":\"jdpvwryo\",\"type\":\"psoacctazakljl\"}],\"nextLink\":\"bcryffdfd\"}") - .toObject(ServiceGroupCollectionResponseInner.class); - Assertions.assertEquals("kfo", model.value().get(0).properties().displayName()); - Assertions.assertEquals("ygjofjdd", model.value().get(0).properties().parent().resourceId()); - Assertions.assertEquals("s", model.value().get(0).kind()); - Assertions.assertEquals("upewnwreitjzy", model.value().get(0).tags().get("lusarh")); - Assertions.assertEquals("bcryffdfd", model.nextLink()); - } -} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupInnerTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupInnerTests.java index ded594f02fec..97f23ab10067 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupInnerTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupInnerTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicegroups.fluent.models.ServiceGroupInner; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import java.util.HashMap; import java.util.Map; @@ -16,27 +17,29 @@ public final class ServiceGroupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceGroupInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"NotStarted\",\"displayName\":\"uv\",\"parent\":{\"resourceId\":\"pybczmehmtzopb\"}},\"kind\":\"h\",\"tags\":{\"hphoycm\":\"idgsybbe\",\"htbmuf\":\"xaobhdxbmtqioqjz\",\"rxybqsoq\":\"ownoizhw\",\"pdznrbtcqqjnqgl\":\"jgkdmbpazlobcu\"},\"id\":\"gnufoooj\",\"name\":\"wifsq\",\"type\":\"saagdf\"}") + "{\"properties\":{\"provisioningState\":\"NotStarted\",\"displayName\":\"uv\",\"attributes\":{\"criticality\":1513244275},\"parent\":{\"resourceId\":\"czmehmtzopbsp\"}},\"kind\":\"upi\",\"tags\":{\"ycm\":\"ybbejhph\",\"htbmuf\":\"xaobhdxbmtqioqjz\",\"rxybqsoq\":\"ownoizhw\"},\"id\":\"gkdmb\",\"name\":\"azlobcufpdznrbt\",\"type\":\"qqjnqgl\"}") .toObject(ServiceGroupInner.class); Assertions.assertEquals("uv", model.properties().displayName()); - Assertions.assertEquals("pybczmehmtzopb", model.properties().parent().resourceId()); - Assertions.assertEquals("h", model.kind()); - Assertions.assertEquals("idgsybbe", model.tags().get("hphoycm")); + Assertions.assertEquals(1513244275, model.properties().attributes().criticality()); + Assertions.assertEquals("czmehmtzopbsp", model.properties().parent().resourceId()); + Assertions.assertEquals("upi", model.kind()); + Assertions.assertEquals("ybbejhph", model.tags().get("ycm")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceGroupInner model = new ServiceGroupInner() .withProperties(new ServiceGroupProperties().withDisplayName("uv") - .withParent(new ParentServiceGroupProperties().withResourceId("pybczmehmtzopb"))) - .withKind("h") - .withTags(mapOf("hphoycm", "idgsybbe", "htbmuf", "xaobhdxbmtqioqjz", "rxybqsoq", "ownoizhw", - "pdznrbtcqqjnqgl", "jgkdmbpazlobcu")); + .withAttributes(new ServiceGroupAttributes().withCriticality(1513244275)) + .withParent(new ParentServiceGroupProperties().withResourceId("czmehmtzopbsp"))) + .withKind("upi") + .withTags(mapOf("ycm", "ybbejhph", "htbmuf", "xaobhdxbmtqioqjz", "rxybqsoq", "ownoizhw")); model = BinaryData.fromObject(model).toObject(ServiceGroupInner.class); Assertions.assertEquals("uv", model.properties().displayName()); - Assertions.assertEquals("pybczmehmtzopb", model.properties().parent().resourceId()); - Assertions.assertEquals("h", model.kind()); - Assertions.assertEquals("idgsybbe", model.tags().get("hphoycm")); + Assertions.assertEquals(1513244275, model.properties().attributes().criticality()); + Assertions.assertEquals("czmehmtzopbsp", model.properties().parent().resourceId()); + Assertions.assertEquals("upi", model.kind()); + Assertions.assertEquals("ybbejhph", model.tags().get("ycm")); } // Use "Map.of" if available diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupPropertiesTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupPropertiesTests.java index a6eacc360364..73dee8f0adbf 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupPropertiesTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupPropertiesTests.java @@ -6,6 +6,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicegroups.models.ParentServiceGroupProperties; +import com.azure.resourcemanager.servicegroups.models.ServiceGroupAttributes; import com.azure.resourcemanager.servicegroups.models.ServiceGroupProperties; import org.junit.jupiter.api.Assertions; @@ -13,18 +14,21 @@ public final class ServiceGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceGroupProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Running\",\"displayName\":\"lhjxr\",\"parent\":{\"resourceId\":\"wmrvktsizntocipa\"}}") + "{\"provisioningState\":\"Running\",\"displayName\":\"ufo\",\"attributes\":{\"criticality\":744579051},\"parent\":{\"resourceId\":\"fsqesaagdfmglzlh\"}}") .toObject(ServiceGroupProperties.class); - Assertions.assertEquals("lhjxr", model.displayName()); - Assertions.assertEquals("wmrvktsizntocipa", model.parent().resourceId()); + Assertions.assertEquals("ufo", model.displayName()); + Assertions.assertEquals(744579051, model.attributes().criticality()); + Assertions.assertEquals("fsqesaagdfmglzlh", model.parent().resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceGroupProperties model = new ServiceGroupProperties().withDisplayName("lhjxr") - .withParent(new ParentServiceGroupProperties().withResourceId("wmrvktsizntocipa")); + ServiceGroupProperties model = new ServiceGroupProperties().withDisplayName("ufo") + .withAttributes(new ServiceGroupAttributes().withCriticality(744579051)) + .withParent(new ParentServiceGroupProperties().withResourceId("fsqesaagdfmglzlh")); model = BinaryData.fromObject(model).toObject(ServiceGroupProperties.class); - Assertions.assertEquals("lhjxr", model.displayName()); - Assertions.assertEquals("wmrvktsizntocipa", model.parent().resourceId()); + Assertions.assertEquals("ufo", model.displayName()); + Assertions.assertEquals(744579051, model.attributes().criticality()); + Assertions.assertEquals("fsqesaagdfmglzlh", model.parent().resourceId()); } } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetWithResponseMockTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetWithResponseMockTests.java index 54ab72d3f341..dde3a16d4e50 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetWithResponseMockTests.java +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class ServiceGroupsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"ertumkdo\",\"parent\":{\"resourceId\":\"whbmd\"}},\"kind\":\"bjf\",\"tags\":{\"q\":\"mbmbexppbh\",\"algbquxigjyjg\":\"rolfpfp\",\"lnerkujysvleju\":\"jaoyfhrtx\"},\"id\":\"qawrlyxwj\",\"name\":\"cpr\",\"type\":\"nwbxgjvtbvpyssz\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"cbacphejkotynqg\",\"attributes\":{\"criticality\":2032457047},\"parent\":{\"resourceId\":\"likwyqkgfgib\"}},\"kind\":\"dgak\",\"tags\":{\"qedqytbciqfoufl\":\"rxybz\"},\"id\":\"nkzsmodmglou\",\"name\":\"pbkwtmu\",\"type\":\"duqkt\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,12 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceGroup response - = manager.serviceGroups().getWithResponse("mutduqktaps", com.azure.core.util.Context.NONE).getValue(); + = manager.serviceGroups().getWithResponse("ryplwckbasyypn", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("ertumkdo", response.properties().displayName()); - Assertions.assertEquals("whbmd", response.properties().parent().resourceId()); - Assertions.assertEquals("bjf", response.kind()); - Assertions.assertEquals("mbmbexppbh", response.tags().get("q")); + Assertions.assertEquals("cbacphejkotynqg", response.properties().displayName()); + Assertions.assertEquals(2032457047, response.properties().attributes().criticality()); + Assertions.assertEquals("likwyqkgfgib", response.properties().parent().resourceId()); + Assertions.assertEquals("dgak", response.kind()); + Assertions.assertEquals("rxybz", response.tags().get("qedqytbciqfoufl")); } } diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsWithResponseMockTests.java b/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsWithResponseMockTests.java deleted file mode 100644 index ae3bfb9c21e3..000000000000 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/src/test/java/com/azure/resourcemanager/servicegroups/generated/ServiceGroupsListAncestorsWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.servicegroups.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.servicegroups.ServiceGroupsManager; -import com.azure.resourcemanager.servicegroups.models.ServiceGroupCollectionResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServiceGroupsListAncestorsWithResponseMockTests { - @Test - public void testListAncestorsWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"ouqfprwz\",\"parent\":{\"resourceId\":\"g\"}},\"kind\":\"tnwu\",\"tags\":{\"x\":\"a\",\"hr\":\"fizuckyf\"},\"id\":\"dfvzwdzuhty\",\"name\":\"wisdkft\",\"type\":\"wxmnteiwao\"},{\"properties\":{\"provisioningState\":\"NotStarted\",\"displayName\":\"jcmmxdcufufsrp\",\"parent\":{\"resourceId\":\"idnsezcxtb\"}},\"kind\":\"gfycc\",\"tags\":{\"flnrosfqpteehzz\":\"wmdwzjeiachboo\",\"swjdkirso\":\"ypyqrimzinp\"},\"id\":\"qxhcrmn\",\"name\":\"hjtckwhd\",\"type\":\"oifiyipjxsqwpgr\"},{\"properties\":{\"provisioningState\":\"Failed\",\"displayName\":\"rcjxvsnbyxqabn\",\"parent\":{\"resourceId\":\"pcyshu\"}},\"kind\":\"afbljjgpbtoqcjmk\",\"tags\":{\"qajzyulpkudjkr\":\"vbqid\"},\"id\":\"hbzhfepg\",\"name\":\"gqexzlocxs\",\"type\":\"paierh\"}],\"nextLink\":\"csglum\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ServiceGroupsManager manager = ServiceGroupsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ServiceGroupCollectionResponse response - = manager.serviceGroups().listAncestorsWithResponse("nruj", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("ouqfprwz", response.value().get(0).properties().displayName()); - Assertions.assertEquals("g", response.value().get(0).properties().parent().resourceId()); - Assertions.assertEquals("tnwu", response.value().get(0).kind()); - Assertions.assertEquals("a", response.value().get(0).tags().get("x")); - Assertions.assertEquals("csglum", response.nextLink()); - } -} diff --git a/sdk/servicegroups/azure-resourcemanager-servicegroups/tsp-location.yaml b/sdk/servicegroups/azure-resourcemanager-servicegroups/tsp-location.yaml index 5d12b037cff6..a59587e28a14 100644 --- a/sdk/servicegroups/azure-resourcemanager-servicegroups/tsp-location.yaml +++ b/sdk/servicegroups/azure-resourcemanager-servicegroups/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/management/resource-manager/Microsoft.Management/ServiceGroups -commit: 37ddf2a815c7d15c52a7e8ddd5c1a1aa9689555c +commit: 4cd7e2ac392a5d75c6a29fee14e93d2146364e79 repo: Azure/azure-rest-api-specs additionalDirectories: