diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/CHANGELOG.md b/sdk/edgezones/azure-resourcemanager-edgezones/CHANGELOG.md index dc1272cd3170..baa79074fe5c 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/CHANGELOG.md +++ b/sdk/edgezones/azure-resourcemanager-edgezones/CHANGELOG.md @@ -1,14 +1,24 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2025-04-15) -### Features Added +- Azure Resource Manager Edge Zones client library for Java. This package contains Microsoft Azure SDK for Edge Zones Management SDK. 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.ExtendedZoneListResult` was removed + +#### `models.OperationListResult` was removed + +#### `EdgeZonesManager` was modified + +* `fluent.MicrosoftEdgeZones serviceClient()` -> `fluent.EdgeZonesClient serviceClient()` + +### Features Added + +* `implementation.models.OperationListResult` was added -### Other Changes +* `implementation.models.ExtendedZoneListResult` was added ## 1.0.0-beta.2 (2024-12-04) diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/README.md b/sdk/edgezones/azure-resourcemanager-edgezones/README.md index 2176b4376ca6..fbea6262b5ca 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/README.md +++ b/sdk/edgezones/azure-resourcemanager-edgezones/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Edge Zones client library for Java. -This package contains Microsoft Azure SDK for Edge Zones Management SDK. Package tag package-2024-04-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 Edge Zones Management SDK. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ EdgeZonesManager manager = EdgeZonesManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/SAMPLE.md b/sdk/edgezones/azure-resourcemanager-edgezones/SAMPLE.md index 769eb776ab1f..2fcf9fcc54bd 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/SAMPLE.md +++ b/sdk/edgezones/azure-resourcemanager-edgezones/SAMPLE.md @@ -13,38 +13,13 @@ - [List](#operations_list) ### ExtendedZones_Get -```java -/** - * Samples for ExtendedZones Get. - */ -public final class ExtendedZonesGetSamples { - /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Get.json - */ - /** - * Sample code: GetExtendedZone. - * - * @param manager Entry point to EdgeZonesManager. - */ - public static void getExtendedZone(com.azure.resourcemanager.edgezones.EdgeZonesManager manager) { - manager.extendedZones().getWithResponse("losangeles", com.azure.core.util.Context.NONE); - } -} -``` - -### ExtendedZones_List - ```java /** * Samples for ExtendedZones List. */ public final class ExtendedZonesListSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_ListBySubscription.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_ListBySubscription.json */ /** * Sample code: ListExtendedZones. @@ -57,7 +32,7 @@ public final class ExtendedZonesListSamples { } ``` -### ExtendedZones_Register +### ExtendedZones_List ```java /** @@ -65,9 +40,7 @@ public final class ExtendedZonesListSamples { */ public final class ExtendedZonesRegisterSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Register.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Register.json */ /** * Sample code: RegisterExtendedZone. @@ -80,7 +53,7 @@ public final class ExtendedZonesRegisterSamples { } ``` -### ExtendedZones_Unregister +### ExtendedZones_Register ```java /** @@ -88,9 +61,7 @@ public final class ExtendedZonesRegisterSamples { */ public final class ExtendedZonesUnregisterSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Unregister.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Unregister.json */ /** * Sample code: UnregisterExtendedZone. @@ -103,7 +74,7 @@ public final class ExtendedZonesUnregisterSamples { } ``` -### Operations_List +### ExtendedZones_Unregister ```java /** @@ -111,9 +82,7 @@ public final class ExtendedZonesUnregisterSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/Operations_List. - * json + * x-ms-original-file: 2024-04-01-preview/Operations_List.json */ /** * Sample code: ListOperations. @@ -126,3 +95,24 @@ public final class OperationsListSamples { } ``` +### Operations_List + +```java +/** + * Samples for ExtendedZones Get. + */ +public final class ExtendedZonesGetSamples { + /* + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Get.json + */ + /** + * Sample code: GetExtendedZone. + * + * @param manager Entry point to EdgeZonesManager. + */ + public static void getExtendedZone(com.azure.resourcemanager.edgezones.EdgeZonesManager manager) { + manager.extendedZones().getWithResponse("losangeles", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml b/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml index eeb1537b9011..9d9cbceb3aa9 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml +++ b/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Edge Zones Management - This package contains Microsoft Azure SDK for Edge Zones Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04-01-preview. + This package contains Microsoft Azure SDK for Edge Zones Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/EdgeZonesManager.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/EdgeZonesManager.java index ab25b17f61d8..2e312ac25ca9 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/EdgeZonesManager.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/EdgeZonesManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones; @@ -22,10 +22,11 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.edgezones.fluent.MicrosoftEdgeZones; +import com.azure.resourcemanager.edgezones.fluent.EdgeZonesClient; +import com.azure.resourcemanager.edgezones.implementation.EdgeZonesClientBuilder; import com.azure.resourcemanager.edgezones.implementation.ExtendedZonesImpl; -import com.azure.resourcemanager.edgezones.implementation.MicrosoftEdgeZonesBuilder; import com.azure.resourcemanager.edgezones.implementation.OperationsImpl; import com.azure.resourcemanager.edgezones.models.ExtendedZones; import com.azure.resourcemanager.edgezones.models.Operations; @@ -33,6 +34,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -44,12 +46,12 @@ public final class EdgeZonesManager { private ExtendedZones extendedZones; - private final MicrosoftEdgeZones clientObject; + private final EdgeZonesClient clientObject; private EdgeZonesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new MicrosoftEdgeZonesBuilder().pipeline(httpPipeline) + this.clientObject = new EdgeZonesClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -96,6 +98,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-edgezones.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -203,12 +208,14 @@ public EdgeZonesManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.edgezones") .append("/") - .append("1.0.0-beta.2"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -279,12 +286,12 @@ public ExtendedZones extendedZones() { } /** - * Gets wrapped service client MicrosoftEdgeZones providing direct access to the underlying auto-generated API + * Gets wrapped service client EdgeZonesClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. * - * @return Wrapped service client MicrosoftEdgeZones. + * @return Wrapped service client EdgeZonesClient. */ - public MicrosoftEdgeZones serviceClient() { + public EdgeZonesClient serviceClient() { return this.clientObject; } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/MicrosoftEdgeZones.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/EdgeZonesClient.java similarity index 86% rename from sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/MicrosoftEdgeZones.java rename to sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/EdgeZonesClient.java index d90639b05524..fc9d82ad6a61 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/MicrosoftEdgeZones.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/EdgeZonesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for MicrosoftEdgeZones class. + * The interface for EdgeZonesClient class. */ -public interface MicrosoftEdgeZones { +public interface EdgeZonesClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/ExtendedZonesClient.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/ExtendedZonesClient.java index 390c1d7fe8ac..90bfeadf261f 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/ExtendedZonesClient.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/ExtendedZonesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.fluent; @@ -16,51 +16,51 @@ */ public interface ExtendedZonesClient { /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * + * @param extendedZoneName The name of the ExtendedZone. + * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + * @return an Azure Extended Zone for a subscription along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String extendedZoneName, Context context); /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * - * @param context The context to associate with this operation. + * @param extendedZoneName The name of the ExtendedZone. * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + * @return an Azure Extended Zone for a subscription. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedZoneInner get(String extendedZoneName); /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. - * @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 an Azure Extended Zone for a subscription along with {@link Response}. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String extendedZoneName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. + * @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 an Azure Extended Zone for a subscription. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExtendedZoneInner get(String extendedZoneName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Registers a subscription for an Extended Zone. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/OperationsClient.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/OperationsClient.java index 7e04caf5afdd..4fc5685c51bf 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/OperationsClient.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.fluent; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/ExtendedZoneInner.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/ExtendedZoneInner.java index 62b9d0bbc56a..b63ff5ae94d9 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/ExtendedZoneInner.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/ExtendedZoneInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * Resource that represents an Azure Extended Zone available to a subscription for registering and unregistering. */ -@Fluent +@Immutable public final class ExtendedZoneInner extends ProxyResource { /* * The resource-specific properties for this resource. @@ -46,7 +46,7 @@ public final class ExtendedZoneInner extends ProxyResource { /** * Creates an instance of ExtendedZoneInner class. */ - public ExtendedZoneInner() { + private ExtendedZoneInner() { } /** @@ -58,17 +58,6 @@ public ExtendedZoneProperties properties() { return this.properties; } - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the ExtendedZoneInner object itself. - */ - public ExtendedZoneInner withProperties(ExtendedZoneProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/OperationInner.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/OperationInner.java index d4625ad7020b..429ad06b6f45 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/OperationInner.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/OperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,11 +15,9 @@ import java.io.IOException; /** - * REST API Operation - * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +26,8 @@ public final class OperationInner implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * 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; @@ -45,14 +43,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * 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. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +65,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +82,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * 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". @@ -106,8 +93,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/package-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/package-info.java index 0e9075824996..f5c6d5a6aac8 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/package-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/models/package-info.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for MicrosoftEdgeZones. - * null. + * Package containing the inner data models for EdgeZones. */ package com.azure.resourcemanager.edgezones.fluent.models; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/package-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/package-info.java index bb33ab431648..01d2f26693cb 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/package-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/fluent/package-info.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for MicrosoftEdgeZones. - * null. + * Package containing the service clients for EdgeZones. */ package com.azure.resourcemanager.edgezones.fluent; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesBuilder.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientBuilder.java similarity index 68% rename from sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesBuilder.java rename to sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientBuilder.java index af1e83f7c55e..9d5d22d59af6 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesBuilder.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the MicrosoftEdgeZonesImpl type. + * A builder for creating a new instance of the EdgeZonesClientImpl type. */ -@ServiceClientBuilder(serviceClients = { MicrosoftEdgeZonesImpl.class }) -public final class MicrosoftEdgeZonesBuilder { +@ServiceClientBuilder(serviceClients = { EdgeZonesClientImpl.class }) +public final class EdgeZonesClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the MicrosoftEdgeZonesBuilder. + * @param endpoint the endpoint value. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public EdgeZonesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the MicrosoftEdgeZonesBuilder. + * @param subscriptionId the subscriptionId value. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public EdgeZonesClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public MicrosoftEdgeZonesBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the MicrosoftEdgeZonesBuilder. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder environment(AzureEnvironment environment) { + public EdgeZonesClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public MicrosoftEdgeZonesBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the MicrosoftEdgeZonesBuilder. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder pipeline(HttpPipeline pipeline) { + public EdgeZonesClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public MicrosoftEdgeZonesBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the MicrosoftEdgeZonesBuilder. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder defaultPollInterval(Duration defaultPollInterval) { + public EdgeZonesClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public MicrosoftEdgeZonesBuilder defaultPollInterval(Duration defaultPollInterva * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the MicrosoftEdgeZonesBuilder. + * @return the EdgeZonesClientBuilder. */ - public MicrosoftEdgeZonesBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public EdgeZonesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of MicrosoftEdgeZonesImpl with the provided parameters. + * Builds an instance of EdgeZonesClientImpl with the provided parameters. * - * @return an instance of MicrosoftEdgeZonesImpl. + * @return an instance of EdgeZonesClientImpl. */ - public MicrosoftEdgeZonesImpl buildClient() { + public EdgeZonesClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public MicrosoftEdgeZonesImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - MicrosoftEdgeZonesImpl client = new MicrosoftEdgeZonesImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + EdgeZonesClientImpl client = new EdgeZonesClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientImpl.java similarity index 92% rename from sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesImpl.java rename to sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientImpl.java index e13ddd075623..04e199303f4a 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/MicrosoftEdgeZonesImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/EdgeZonesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; @@ -23,8 +23,8 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.edgezones.fluent.EdgeZonesClient; import com.azure.resourcemanager.edgezones.fluent.ExtendedZonesClient; -import com.azure.resourcemanager.edgezones.fluent.MicrosoftEdgeZones; import com.azure.resourcemanager.edgezones.fluent.OperationsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -36,31 +36,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the MicrosoftEdgeZonesImpl type. + * Initializes a new instance of the EdgeZonesClientImpl type. */ -@ServiceClient(builder = MicrosoftEdgeZonesBuilder.class) -public final class MicrosoftEdgeZonesImpl implements MicrosoftEdgeZones { +@ServiceClient(builder = EdgeZonesClientBuilder.class) +public final class EdgeZonesClientImpl implements EdgeZonesClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -69,12 +55,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -82,6 +68,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -153,22 +153,22 @@ public ExtendedZonesClient getExtendedZones() { } /** - * Initializes an instance of MicrosoftEdgeZones client. + * Initializes an instance of EdgeZonesClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - MicrosoftEdgeZonesImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + EdgeZonesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2024-04-01-preview"; this.operations = new OperationsClientImpl(this); this.extendedZones = new ExtendedZonesClientImpl(this); @@ -300,5 +300,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(MicrosoftEdgeZonesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(EdgeZonesClientImpl.class); } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZoneImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZoneImpl.java index 355ab41252cf..0b61e3f8f5a8 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZoneImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZoneImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesClientImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesClientImpl.java index 644a081abe43..e546bcd3d00c 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesClientImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; @@ -28,7 +28,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.edgezones.fluent.ExtendedZonesClient; import com.azure.resourcemanager.edgezones.fluent.models.ExtendedZoneInner; -import com.azure.resourcemanager.edgezones.models.ExtendedZoneListResult; +import com.azure.resourcemanager.edgezones.implementation.models.ExtendedZoneListResult; import reactor.core.publisher.Mono; /** @@ -43,48 +43,48 @@ public final class ExtendedZonesClientImpl implements ExtendedZonesClient { /** * The service client containing this operation class. */ - private final MicrosoftEdgeZonesImpl client; + private final EdgeZonesClientImpl client; /** * Initializes an instance of ExtendedZonesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ExtendedZonesClientImpl(MicrosoftEdgeZonesImpl client) { + ExtendedZonesClientImpl(EdgeZonesClientImpl client) { this.service = RestProxy.create(ExtendedZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftEdgeZonesExtendedZones to be used by the proxy service to + * The interface defining all the services for EdgeZonesClientExtendedZones to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftEdgeZonesEx") + @Host("{endpoint}") + @ServiceInterface(name = "EdgeZonesClientExten") public interface ExtendedZonesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones/{extendedZoneName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("extendedZoneName") String extendedZoneName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones/{extendedZoneName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("extendedZoneName") String extendedZoneName, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones/{extendedZoneName}/register") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register(@HostParam("$host") String endpoint, + Mono> register(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("extendedZoneName") String extendedZoneName, @HeaderParam("Accept") String accept, Context context); @@ -93,7 +93,7 @@ Mono> register(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/providers/Microsoft.EdgeZones/extendedZones/{extendedZoneName}/unregister") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unregister(@HostParam("$host") String endpoint, + Mono> unregister(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("extendedZoneName") String extendedZoneName, @HeaderParam("Accept") String accept, Context context); @@ -103,20 +103,22 @@ Mono> unregister(@HostParam("$host") String endpoint @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * + * @param extendedZoneName The name of the ExtendedZone. + * @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 response of a ExtendedZone list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return an Azure Extended Zone for a subscription along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> getWithResponseAsync(String extendedZoneName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -125,27 +127,30 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (extendedZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extendedZoneName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), extendedZoneName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * + * @param extendedZoneName The name of the ExtendedZone. * @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 response of a ExtendedZone list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return an Azure Extended Zone for a subscription along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> getWithResponseAsync(String extendedZoneName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -154,81 +159,69 @@ private Mono> listSinglePageAsync(Context conte return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (extendedZoneName == null) { + return Mono + .error(new IllegalArgumentException("Parameter extendedZoneName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + extendedZoneName, accept, context); } /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * + * @param extendedZoneName The name of the ExtendedZone. + * @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 response of a ExtendedZone list operation as paginated response with {@link PagedFlux}. + * @return an Azure Extended Zone for a subscription on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String extendedZoneName) { + return getWithResponseAsync(extendedZoneName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * + * @param extendedZoneName The name of the ExtendedZone. * @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 response of a ExtendedZone list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the Azure Extended Zones available to a subscription. - * - * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + * @return an Azure Extended Zone for a subscription along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String extendedZoneName, Context context) { + return getWithResponseAsync(extendedZoneName, context).block(); } /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * - * @param context The context to associate with this operation. + * @param extendedZoneName The name of the ExtendedZone. * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + * @return an Azure Extended Zone for a subscription. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedZoneInner get(String extendedZoneName) { + return getWithResponse(extendedZoneName, Context.NONE).getValue(); } /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. - * @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 an Azure Extended Zone for a subscription along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a ExtendedZone list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String extendedZoneName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -237,30 +230,27 @@ private Mono> getWithResponseAsync(String extendedZo return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (extendedZoneName == null) { - return Mono - .error(new IllegalArgumentException("Parameter extendedZoneName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), extendedZoneName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. * @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 an Azure Extended Zone for a subscription along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a ExtendedZone list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String extendedZoneName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -269,57 +259,67 @@ private Mono> getWithResponseAsync(String extendedZo return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (extendedZoneName == null) { - return Mono - .error(new IllegalArgumentException("Parameter extendedZoneName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - extendedZoneName, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. - * @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 an Azure Extended Zone for a subscription on successful completion of {@link Mono}. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String extendedZoneName) { - return getWithResponseAsync(extendedZoneName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. * @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 an Azure Extended Zone for a subscription along with {@link Response}. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String extendedZoneName, Context context) { - return getWithResponseAsync(extendedZoneName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. + * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the Azure Extended Zones available to a subscription. + * + * @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 an Azure Extended Zone for a subscription. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExtendedZoneInner get(String extendedZoneName) { - return getWithResponse(extendedZoneName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesImpl.java index f10ced118019..2c9666ef3dc1 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ExtendedZonesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; @@ -27,16 +27,6 @@ public ExtendedZonesImpl(ExtendedZonesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtendedZoneImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtendedZoneImpl(inner1, this.manager())); - } - public Response getWithResponse(String extendedZoneName, Context context) { Response inner = this.serviceClient().getWithResponse(extendedZoneName, context); if (inner != null) { @@ -56,6 +46,16 @@ public ExtendedZone get(String extendedZoneName) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtendedZoneImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExtendedZoneImpl(inner1, this.manager())); + } + public Response registerWithResponse(String extendedZoneName, Context context) { Response inner = this.serviceClient().registerWithResponse(extendedZoneName, context); if (inner != null) { diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationImpl.java index a2822452ed9b..cc4ab797ed1a 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsClientImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsClientImpl.java index 7a09ef3bcbee..1330a661f73d 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsClientImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.edgezones.fluent.OperationsClient; import com.azure.resourcemanager.edgezones.fluent.models.OperationInner; -import com.azure.resourcemanager.edgezones.models.OperationListResult; +import com.azure.resourcemanager.edgezones.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +42,31 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final MicrosoftEdgeZonesImpl client; + private final EdgeZonesClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(MicrosoftEdgeZonesImpl client) { + OperationsClientImpl(EdgeZonesClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftEdgeZonesOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for EdgeZonesClientOperations to be used by the proxy service to perform + * REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftEdgeZonesOp") + @Host("{endpoint}") + @ServiceInterface(name = "EdgeZonesClientOpera") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.EdgeZones/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +74,7 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsImpl.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsImpl.java index 181c1a7cafd8..b14961073959 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsImpl.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ResourceManagerUtils.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ResourceManagerUtils.java index b35b573a9e78..4245db2f0d3c 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ResourceManagerUtils.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.implementation; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneListResult.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/ExtendedZoneListResult.java similarity index 80% rename from sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneListResult.java rename to sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/ExtendedZoneListResult.java index 3aedf9be117d..bc6802131165 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneListResult.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/ExtendedZoneListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.edgezones.models; +package com.azure.resourcemanager.edgezones.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The response of a ExtendedZone list operation. */ -@Fluent +@Immutable public final class ExtendedZoneListResult implements JsonSerializable { /* * The ExtendedZone items on this page @@ -32,7 +32,7 @@ public final class ExtendedZoneListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The ExtendedZone items on this page. - * - * @param value the value value to set. - * @return the ExtendedZoneListResult object itself. - */ - public ExtendedZoneListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to the next page of items. * @@ -64,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ExtendedZoneListResult object itself. - */ - public ExtendedZoneListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationListResult.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/OperationListResult.java similarity index 74% rename from sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationListResult.java rename to sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/OperationListResult.java index 63072c6587f1..9fcfac93f08a 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationListResult.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.edgezones.models; +package com.azure.resourcemanager.edgezones.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,23 +21,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -59,17 +60,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @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 OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/package-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/package-info.java index 2941470a4fd4..c317d7e347ab 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/package-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/implementation/package-info.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for MicrosoftEdgeZones. - * null. + * Package containing the implementations for EdgeZones. */ package com.azure.resourcemanager.edgezones.implementation; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ActionType.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ActionType.java index 92107c988138..e3ab2ffefae7 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ActionType.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZone.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZone.java index 8ebc9eb0a83b..b6f09c368aeb 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZone.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZone.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneProperties.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneProperties.java index 56274192b0b9..240d67f37e16 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneProperties.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ExtendedZoneProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -74,7 +74,7 @@ public final class ExtendedZoneProperties implements JsonSerializable list(); + Response getWithResponse(String extendedZoneName, Context context); /** - * Lists the Azure Extended Zones available to a subscription. + * Gets an Azure Extended Zone for a subscription. * - * @param context The context to associate with this operation. + * @param extendedZoneName The name of the ExtendedZone. * @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 response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. + * @return an Azure Extended Zone for a subscription. */ - PagedIterable list(Context context); + ExtendedZone get(String extendedZoneName); /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. - * @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 an Azure Extended Zone for a subscription along with {@link Response}. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String extendedZoneName, Context context); + PagedIterable list(); /** - * Gets an Azure Extended Zone for a subscription. + * Lists the Azure Extended Zones available to a subscription. * - * @param extendedZoneName The name of the ExtendedZone. + * @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 an Azure Extended Zone for a subscription. + * @return the response of a ExtendedZone list operation as paginated response with {@link PagedIterable}. */ - ExtendedZone get(String extendedZoneName); + PagedIterable list(Context context); /** * Registers a subscription for an Extended Zone. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/Operation.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/Operation.java index 3839f474c867..0e867cbe8415 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/Operation.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationDisplay.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationDisplay.java index 3abfe7566b81..0a07db6529ef 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationDisplay.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for and operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ProvisioningState.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ProvisioningState.java index 05b386e304d1..01056ce9243d 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ProvisioningState.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -12,37 +12,37 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for ProvisioningState. + * Resource has been created. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ProvisioningState. + * Resource creation failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Resource creation was canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Provisioning for ProvisioningState. + * Provisioning State. */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); /** - * Static value Updating for ProvisioningState. + * Updating State. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for ProvisioningState. + * Deleting State. */ public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Static value Accepted for ProvisioningState. + * Accepted State. */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/RegistrationState.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/RegistrationState.java index 54c22fc1df3d..23ea3664aa90 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/RegistrationState.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/RegistrationState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.models; @@ -12,22 +12,22 @@ */ public final class RegistrationState extends ExpandableStringEnum { /** - * Static value NotRegistered for RegistrationState. + * Subscription not registered for the Azure Extended Zone. */ public static final RegistrationState NOT_REGISTERED = fromString("NotRegistered"); /** - * Static value PendingRegister for RegistrationState. + * Subscription pending registration for the Azure Extended Zone. */ public static final RegistrationState PENDING_REGISTER = fromString("PendingRegister"); /** - * Static value Registered for RegistrationState. + * Subscription is registered for the Azure Extended Zone. */ public static final RegistrationState REGISTERED = fromString("Registered"); /** - * Static value PendingUnregister for RegistrationState. + * Subscription is pending unregistering for the Azure Extended Zone. */ public static final RegistrationState PENDING_UNREGISTER = fromString("PendingUnregister"); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/package-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/package-info.java index 19d29ca38e33..3df35aaca0fb 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/package-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/models/package-info.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for MicrosoftEdgeZones. - * null. + * Package containing the data models for EdgeZones. */ package com.azure.resourcemanager.edgezones.models; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/package-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/package-info.java index 3b7a3e9bb0e0..8befcfaaffe3 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/package-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/com/azure/resourcemanager/edgezones/package-info.java @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for MicrosoftEdgeZones. - * null. + * Package containing the classes for EdgeZones. */ package com.azure.resourcemanager.edgezones; diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/module-info.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/module-info.java index 3dc1436d3355..fd66222ee460 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/module-info.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.edgezones { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.edgezones.fluent.models to com.azure.core; opens com.azure.resourcemanager.edgezones.models to com.azure.core; + opens com.azure.resourcemanager.edgezones.implementation.models to com.azure.core; } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/main/resources/azure-resourcemanager-edgezones.properties b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/resources/azure-resourcemanager-edgezones.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/main/resources/azure-resourcemanager-edgezones.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetSamples.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetSamples.java index 778be321ecc1..543f731962d2 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetSamples.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -9,9 +9,7 @@ */ public final class ExtendedZonesGetSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Get.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Get.json */ /** * Sample code: GetExtendedZone. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListSamples.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListSamples.java index 4e24a283acf5..50bda82eee5c 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListSamples.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -9,9 +9,7 @@ */ public final class ExtendedZonesListSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_ListBySubscription.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_ListBySubscription.json */ /** * Sample code: ListExtendedZones. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterSamples.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterSamples.java index 64a99bfdf410..354233af3a81 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterSamples.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -9,9 +9,7 @@ */ public final class ExtendedZonesRegisterSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Register.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Register.json */ /** * Sample code: RegisterExtendedZone. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterSamples.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterSamples.java index 209fc782998d..2685cc4d2df6 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterSamples.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -9,9 +9,7 @@ */ public final class ExtendedZonesUnregisterSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/ - * ExtendedZones_Unregister.json + * x-ms-original-file: 2024-04-01-preview/ExtendedZones_Unregister.json */ /** * Sample code: UnregisterExtendedZone. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/OperationsListSamples.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/OperationsListSamples.java index 5e2f50d603fa..c6c85c4f219c 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/OperationsListSamples.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/samples/java/com/azure/resourcemanager/edgezones/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/edgezones/resource-manager/Microsoft.EdgeZones/preview/2024-04-01-preview/examples/Operations_List. - * json + * x-ms-original-file: 2024-04-01-preview/Operations_List.json */ /** * Sample code: ListOperations. diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneInnerTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneInnerTests.java index 697bf07231d8..80ab8c24c999 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneInnerTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.edgezones.fluent.models.ExtendedZoneInner; -import com.azure.resourcemanager.edgezones.models.ExtendedZoneProperties; public final class ExtendedZoneInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExtendedZoneInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"registrationState\":\"NotRegistered\",\"displayName\":\"wmfdatscmdvpjhul\",\"regionalDisplayName\":\"uuvmkjozkrwfnd\",\"regionType\":\"odjpslwejd\",\"regionCategory\":\"vwryoqpso\",\"geography\":\"cctazakljlahbc\",\"geographyGroup\":\"yffdfdos\",\"longitude\":\"gexpaojakhmsbz\",\"latitude\":\"hcrzevd\",\"homeLocation\":\"hlxaolthqtr\"},\"id\":\"jbp\",\"name\":\"zfsinzgvf\",\"type\":\"jrwzox\"}") + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"zvgnwzs\",\"regionalDisplayName\":\"mglzufcy\",\"regionType\":\"kohdbiha\",\"regionCategory\":\"ufhfcbjysa\",\"geography\":\"ithxqhabifpi\",\"geographyGroup\":\"xwczbyscnp\",\"longitude\":\"x\",\"latitude\":\"hiv\",\"homeLocation\":\"qniwbybrkxvdumj\"},\"id\":\"tfwvukxgaudc\",\"name\":\"snhsjcnyejhkryh\",\"type\":\"napczwlokjy\"}") .toObject(ExtendedZoneInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedZoneInner model = new ExtendedZoneInner().withProperties(new ExtendedZoneProperties()); - model = BinaryData.fromObject(model).toObject(ExtendedZoneInner.class); - } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneListResultTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneListResultTests.java index e828b099f4c1..c6ba61b9d379 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneListResultTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZoneListResultTests.java @@ -1,31 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgezones.fluent.models.ExtendedZoneInner; -import com.azure.resourcemanager.edgezones.models.ExtendedZoneListResult; -import com.azure.resourcemanager.edgezones.models.ExtendedZoneProperties; -import java.util.Arrays; +import com.azure.resourcemanager.edgezones.implementation.models.ExtendedZoneListResult; import org.junit.jupiter.api.Assertions; public final class ExtendedZoneListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExtendedZoneListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"registrationState\":\"NotRegistered\",\"displayName\":\"xqhabi\",\"regionalDisplayName\":\"pikxwczbyscnpqxu\",\"regionType\":\"ivyqniwbybrkxvd\",\"regionCategory\":\"mjgr\",\"geography\":\"fwvuk\",\"geographyGroup\":\"gaudcc\",\"longitude\":\"nhsjcnyej\",\"latitude\":\"kryhtnapczwlokj\",\"homeLocation\":\"emkkvnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}],\"nextLink\":\"wixjsprozvcp\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"dio\",\"regionalDisplayName\":\"jpslwejd\",\"regionType\":\"vwryoqpso\",\"regionCategory\":\"cctazakljlahbc\",\"geography\":\"yffdfdos\",\"geographyGroup\":\"gexpaojakhmsbz\",\"longitude\":\"hcrzevd\",\"latitude\":\"hlxaolthqtr\",\"homeLocation\":\"qjbpfzfsin\"},\"id\":\"v\",\"name\":\"cjrwzoxxjtfellu\",\"type\":\"fziton\"},{\"properties\":{\"provisioningState\":\"Failed\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"kjlxofpdvhpf\",\"regionalDisplayName\":\"xypininmayhuybbk\",\"regionType\":\"odepoogin\",\"regionCategory\":\"vamih\",\"geography\":\"ognarxzxtheotus\",\"geographyGroup\":\"vyevcciqi\",\"longitude\":\"nhungbw\",\"latitude\":\"zrnf\",\"homeLocation\":\"gxg\"},\"id\":\"pemvtzfkufubljof\",\"name\":\"qeof\",\"type\":\"aeqjhqjbasvms\"}],\"nextLink\":\"qulngsntnbybkzgc\"}") .toObject(ExtendedZoneListResult.class); - Assertions.assertEquals("wixjsprozvcp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedZoneListResult model = new ExtendedZoneListResult() - .withValue(Arrays.asList(new ExtendedZoneInner().withProperties(new ExtendedZoneProperties()))) - .withNextLink("wixjsprozvcp"); - model = BinaryData.fromObject(model).toObject(ExtendedZoneListResult.class); - Assertions.assertEquals("wixjsprozvcp", model.nextLink()); + Assertions.assertEquals("qulngsntnbybkzgc", model.nextLink()); } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonePropertiesTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonePropertiesTests.java index 329bedcaa29a..0d37261dff72 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonePropertiesTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -11,13 +11,7 @@ public final class ExtendedZonePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ExtendedZoneProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Accepted\",\"registrationState\":\"Registered\",\"displayName\":\"lluwfzitonpeq\",\"regionalDisplayName\":\"pjkjlxofpdv\",\"regionType\":\"pfxxy\",\"regionCategory\":\"ininmay\",\"geography\":\"uybbkpodep\",\"geographyGroup\":\"oginuvamiheognar\",\"longitude\":\"zxtheotusivyevcc\",\"latitude\":\"qi\",\"homeLocation\":\"nhungbw\"}") + "{\"provisioningState\":\"Canceled\",\"registrationState\":\"PendingRegister\",\"displayName\":\"ni\",\"regionalDisplayName\":\"joxzjnchgejspodm\",\"regionType\":\"ilzyd\",\"regionCategory\":\"h\",\"geography\":\"jwyahuxinpmqnja\",\"geographyGroup\":\"wixjsprozvcp\",\"longitude\":\"tegjvwmf\",\"latitude\":\"atscmd\",\"homeLocation\":\"pjhulsuuvmkj\"}") .toObject(ExtendedZoneProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtendedZoneProperties model = new ExtendedZoneProperties(); - model = BinaryData.fromObject(model).toObject(ExtendedZoneProperties.class); - } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetWithResponseMockTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetWithResponseMockTests.java index c273860f58a4..033e42e738d0 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetWithResponseMockTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.edgezones.EdgeZonesManager; import com.azure.resourcemanager.edgezones.models.ExtendedZone; @@ -20,17 +20,17 @@ public final class ExtendedZonesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleting\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"xhocdgeablgphuti\",\"regionalDisplayName\":\"ndv\",\"regionType\":\"aozwyiftyhxhu\",\"regionCategory\":\"okftyxolniwpwcuk\",\"geography\":\"fkgiawxk\",\"geographyGroup\":\"ryplwckbasyypn\",\"longitude\":\"dhsgcba\",\"latitude\":\"phejkotynqgoulz\",\"homeLocation\":\"dlikwyqkgfgibma\"},\"id\":\"akeqs\",\"name\":\"xybz\",\"type\":\"qedqytbciqfoufl\"}"; + = "{\"properties\":{\"provisioningState\":\"Updating\",\"registrationState\":\"NotRegistered\",\"displayName\":\"eebvmgxsab\",\"regionalDisplayName\":\"yqduujit\",\"regionType\":\"jczdzevndh\",\"regionCategory\":\"rwpdappdsbdkvwrw\",\"geography\":\"feusnhut\",\"geographyGroup\":\"eltmrldhugjzzdat\",\"longitude\":\"xhocdgeablgphuti\",\"latitude\":\"ndv\",\"homeLocation\":\"aozwyiftyhxhu\"},\"id\":\"k\",\"name\":\"tyxolniwpwc\",\"type\":\"kjfkg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); EdgeZonesManager manager = EdgeZonesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ExtendedZone response - = manager.extendedZones().getWithResponse("nhutjeltmrldhugj", com.azure.core.util.Context.NONE).getValue(); + = manager.extendedZones().getWithResponse("nzl", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListMockTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListMockTests.java index 8cd26b391519..70f87c05da63 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListMockTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.edgezones.EdgeZonesManager; import com.azure.resourcemanager.edgezones.models.ExtendedZone; @@ -21,14 +21,14 @@ public final class ExtendedZonesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"ybkzgcwr\",\"regionalDisplayName\":\"clxxwrljdo\",\"regionType\":\"skcqvkocrcjd\",\"regionCategory\":\"wtnhxbnjbiksqr\",\"geography\":\"lssai\",\"geographyGroup\":\"qpjwnzlljfm\",\"longitude\":\"pee\",\"latitude\":\"vmgxsab\",\"homeLocation\":\"yqduujit\"},\"id\":\"czdzev\",\"name\":\"dhkrwpdappdsbdk\",\"type\":\"wrwjfeu\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"registrationState\":\"PendingUnregister\",\"displayName\":\"ryplwckbasyypn\",\"regionalDisplayName\":\"dhsgcba\",\"regionType\":\"phejkotynqgoulz\",\"regionCategory\":\"dlikwyqkgfgibma\",\"geography\":\"gakeqsr\",\"geographyGroup\":\"yb\",\"longitude\":\"qqedqytbciqfou\",\"latitude\":\"lmmnkzsmodmglo\",\"homeLocation\":\"gpbkwtmut\"},\"id\":\"qktapspwgcuert\",\"name\":\"mkdo\",\"type\":\"vqwhbmdgbbjfd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); EdgeZonesManager manager = EdgeZonesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.extendedZones().list(com.azure.core.util.Context.NONE); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterWithResponseMockTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterWithResponseMockTests.java index 1721079e60ac..0ed49e4d3ed4 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterWithResponseMockTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesRegisterWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.edgezones.EdgeZonesManager; import com.azure.resourcemanager.edgezones.models.ExtendedZone; @@ -20,17 +20,17 @@ public final class ExtendedZonesRegisterWithResponseMockTests { @Test public void testRegisterWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Provisioning\",\"registrationState\":\"Registered\",\"displayName\":\"pbkwtmu\",\"regionalDisplayName\":\"duqkt\",\"regionType\":\"pspwgcuertu\",\"regionCategory\":\"kdosvqw\",\"geography\":\"bmdg\",\"geographyGroup\":\"bjf\",\"longitude\":\"dgmb\",\"latitude\":\"bexppb\",\"homeLocation\":\"tq\"},\"id\":\"ol\",\"name\":\"p\",\"type\":\"psalgbqux\"}"; + = "{\"properties\":{\"provisioningState\":\"Provisioning\",\"registrationState\":\"NotRegistered\",\"displayName\":\"fpfpsalgbquxigj\",\"regionalDisplayName\":\"jgzjaoyfhrtx\",\"regionType\":\"lnerkujysvleju\",\"regionCategory\":\"fqawrlyxw\",\"geography\":\"kcprbnw\",\"geographyGroup\":\"xgjvtbv\",\"longitude\":\"ysszdnrujqguh\",\"latitude\":\"uouq\",\"homeLocation\":\"prwzwbnguitnwui\"},\"id\":\"a\",\"name\":\"x\",\"type\":\"fizuckyf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); EdgeZonesManager manager = EdgeZonesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ExtendedZone response - = manager.extendedZones().registerWithResponse("mnkzsmod", com.azure.core.util.Context.NONE).getValue(); + = manager.extendedZones().registerWithResponse("gmbmbexppbh", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterWithResponseMockTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterWithResponseMockTests.java index 4a5ffd65aaa4..865cbca5186e 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterWithResponseMockTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/ExtendedZonesUnregisterWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.edgezones.EdgeZonesManager; import com.azure.resourcemanager.edgezones.models.ExtendedZone; @@ -20,18 +20,17 @@ public final class ExtendedZonesUnregisterWithResponseMockTests { @Test public void testUnregisterWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Accepted\",\"registrationState\":\"PendingRegister\",\"displayName\":\"jysvl\",\"regionalDisplayName\":\"juvf\",\"regionType\":\"awrlyx\",\"regionCategory\":\"jkcpr\",\"geography\":\"nwbxgjvtbvpyssz\",\"geographyGroup\":\"nruj\",\"longitude\":\"guhmuouqfpr\",\"latitude\":\"zw\",\"homeLocation\":\"nguitnwuizgazxu\"},\"id\":\"zuckyfi\",\"name\":\"rfidfvzwdz\",\"type\":\"htymw\"}"; + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"registrationState\":\"PendingRegister\",\"displayName\":\"wdzuhtymwisd\",\"regionalDisplayName\":\"fthwxmnteiwa\",\"regionType\":\"pvkmijcmmxdcuf\",\"regionCategory\":\"fsrpymzidnse\",\"geography\":\"cxtbzsg\",\"geographyGroup\":\"yc\",\"longitude\":\"sne\",\"latitude\":\"mdwzjeiachboo\",\"homeLocation\":\"flnrosfqpteehzz\"},\"id\":\"pyqr\",\"name\":\"mzinpvswjdk\",\"type\":\"rsoodqxhcrmnoh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); EdgeZonesManager manager = EdgeZonesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ExtendedZone response = manager.extendedZones() - .unregisterWithResponse("gjyjgzjaoyfhrtxi", com.azure.core.util.Context.NONE) - .getValue(); + ExtendedZone response + = manager.extendedZones().unregisterWithResponse("hr", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationDisplayTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationDisplayTests.java index d16a824e2de1..21d5beb55d4e 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationDisplayTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; @@ -11,13 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationInnerTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationInnerTests.java index ecd8b608674d..df59f25ccee4 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationInnerTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.edgezones.fluent.models.OperationInner; -import com.azure.resourcemanager.edgezones.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationListResultTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationListResultTests.java index e58856f39125..b8c7ed19d1c2 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationListResultTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.edgezones.models.OperationListResult; +import com.azure.resourcemanager.edgezones.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\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); } } diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationsListMockTests.java b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationsListMockTests.java index 2aa0aa73e57e..f87c4c3cc442 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationsListMockTests.java +++ b/sdk/edgezones/azure-resourcemanager-edgezones/src/test/java/com/azure/resourcemanager/edgezones/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.edgezones.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.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.edgezones.EdgeZonesManager; import com.azure.resourcemanager.edgezones.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"rnfygxgispem\",\"isDataAction\":true,\"display\":{\"provider\":\"ufubl\",\"resource\":\"fxqeof\",\"operation\":\"e\",\"description\":\"hqjbasvmsmj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"wclxxwrl\",\"isDataAction\":true,\"display\":{\"provider\":\"kcqvkocrc\",\"resource\":\"kwt\",\"operation\":\"xbnjbiksq\",\"description\":\"lssai\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); EdgeZonesManager manager = EdgeZonesManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/tsp-location.yaml b/sdk/edgezones/azure-resourcemanager-edgezones/tsp-location.yaml new file mode 100644 index 000000000000..abb6e685ca94 --- /dev/null +++ b/sdk/edgezones/azure-resourcemanager-edgezones/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/edgezones/EdgeZones.Management +commit: 6e702986ee542ebd38d0ab2e2f2c00ab48a50b45 +repo: Azure/azure-rest-api-specs +additionalDirectories: