diff --git a/eng/lintingconfigs/revapi/track2/revapi.json b/eng/lintingconfigs/revapi/track2/revapi.json index 88da8835cc34..57fdf2e0a1b9 100644 --- a/eng/lintingconfigs/revapi/track2/revapi.json +++ b/eng/lintingconfigs/revapi/track2/revapi.json @@ -771,6 +771,11 @@ "code": "java.field.removed", "old": "field com.azure.resourcemanager.network.models.SensitivityType.NONE", "justification": "Remove NonSensitivity for DDoS ruleset." + }, + { + "code": "java.method.removed", + "old": "method com.azure.resourcemanager.compute.models.ExecutedValidation com.azure.resourcemanager.compute.models.ExecutedValidation::withStatus(com.azure.resourcemanager.compute.models.ValidationStatus)", + "justification": "ExecutedValidation is output-only; fluent setter removed as part of immutable model cleanup." } ] } diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 822b9e425245..d54a3999f5f5 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -277,7 +277,7 @@ com.azure.resourcemanager:azure-resourcemanager-appplatform;2.51.0;2.52.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.54.1;2.55.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-authorization;2.53.6;2.54.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-cdn;2.53.5;2.54.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-compute;2.55.1;2.56.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-compute;2.55.1;2.56.0 com.azure.resourcemanager:azure-resourcemanager-containerinstance;2.53.6;2.54.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerregistry;2.54.1;2.55.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerservice;2.57.0;2.58.0-beta.2 @@ -553,6 +553,7 @@ unreleased_com.azure:azure-core-test;1.27.0-beta.14 unreleased_com.azure.v2:azure-identity;2.0.0-beta.1 unreleased_com.azure.v2:azure-data-appconfiguration;2.0.0-beta.1 unreleased_io.clientcore:http-netty4;1.0.0-beta.1 +unreleased_com.azure.resourcemanager:azure-resourcemanager-compute;2.56.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid diff --git a/sdk/compute/azure-resourcemanager-compute/CHANGELOG.md b/sdk/compute/azure-resourcemanager-compute/CHANGELOG.md index 842551add4dd..58acbbc1fb0a 100644 --- a/sdk/compute/azure-resourcemanager-compute/CHANGELOG.md +++ b/sdk/compute/azure-resourcemanager-compute/CHANGELOG.md @@ -1,14 +1,12 @@ # Release History -## 2.56.0-beta.1 (Unreleased) +## 2.56.0 (2026-01-12) -### Features Added - -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Updated `GalleryRP api-version` to `2025-03-03`. ## 2.55.1 (2025-11-24) diff --git a/sdk/compute/azure-resourcemanager-compute/README.md b/sdk/compute/azure-resourcemanager-compute/README.md index 44833d95f6b1..48c9f4451c34 100644 --- a/sdk/compute/azure-resourcemanager-compute/README.md +++ b/sdk/compute/azure-resourcemanager-compute/README.md @@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager-compute - 2.55.0 + 2.56.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/compute/azure-resourcemanager-compute/assets.json b/sdk/compute/azure-resourcemanager-compute/assets.json index 145f980ec880..cb9dbc709018 100644 --- a/sdk/compute/azure-resourcemanager-compute/assets.json +++ b/sdk/compute/azure-resourcemanager-compute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/compute/azure-resourcemanager-compute", - "Tag": "java/compute/azure-resourcemanager-compute_6539f79365" + "Tag": "java/compute/azure-resourcemanager-compute_6a5861292e" } diff --git a/sdk/compute/azure-resourcemanager-compute/pom.xml b/sdk/compute/azure-resourcemanager-compute/pom.xml index 5b7045da2805..1b02ea7e4073 100644 --- a/sdk/compute/azure-resourcemanager-compute/pom.xml +++ b/sdk/compute/azure-resourcemanager-compute/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-compute - 2.56.0-beta.1 + 2.56.0 jar Microsoft Azure SDK for Compute Management diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java index c2308d8125ba..2af6f5d3ab52 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/ComputeManagementClient.java @@ -354,6 +354,20 @@ public interface ComputeManagementClient { */ GalleryInVMAccessControlProfileVersionsClient getGalleryInVMAccessControlProfileVersions(); + /** + * Gets the GalleryScriptsClient object to access its operations. + * + * @return the GalleryScriptsClient object. + */ + GalleryScriptsClient getGalleryScripts(); + + /** + * Gets the GalleryScriptVersionsClient object to access its operations. + * + * @return the GalleryScriptVersionsClient object. + */ + GalleryScriptVersionsClient getGalleryScriptVersions(); + /** * Gets the GallerySharingProfilesClient object to access its operations. * diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptVersionsClient.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptVersionsClient.java new file mode 100644 index 000000000000..5f52a60fbb44 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptVersionsClient.java @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionInner; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GalleryScriptVersionsClient. + */ +public interface GalleryScriptVersionsClient { + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByGalleryScriptAsync(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryScript(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGalleryScript(String resourceGroupName, String galleryName, + String galleryScriptName, Context context); + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName); + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName); + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context); + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptVersionInner get(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GalleryScriptVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptVersionInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptVersionInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion, Context context); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptVersionInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion); + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptVersionInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion, Context context); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GalleryScriptVersionInner> beginUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptVersionInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptVersionInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion, Context context); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptVersionInner update(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion); + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptVersionInner update(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion, Context context); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName); + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptsClient.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptsClient.java new file mode 100644 index 000000000000..8926715dc47c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryScriptsClient.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptInner; +import com.azure.resourcemanager.compute.models.GalleryScriptUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GalleryScriptsClient. + */ +public interface GalleryScriptsClient { + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName); + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName); + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByGallery(String resourceGroupName, String galleryName, Context context); + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String galleryName, String galleryScriptName); + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String galleryName, String galleryScriptName, + Context context); + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptInner get(String resourceGroupName, String galleryName, String galleryScriptName); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptInner galleryScript); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GalleryScriptInner> beginCreateOrUpdateAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptInner> beginCreateOrUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptInner> beginCreateOrUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript, Context context); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptInner galleryScript); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptInner galleryScript); + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptInner galleryScript, Context context); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptUpdate galleryScript); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GalleryScriptInner> beginUpdateAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GalleryScriptInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript, Context context); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptInner update(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript); + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GalleryScriptInner update(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript, Context context); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, Context context); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryName, String galleryScriptName); + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String galleryName, String galleryScriptName, Context context); +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptInner.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptInner.java new file mode 100644 index 000000000000..b6121b6df01c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Specifies information about the gallery Script Definition that you want to create or update. + */ +@Fluent +public final class GalleryScriptInner extends Resource { + /* + * Describes the properties of a gallery Script Definition. + */ + private GalleryScriptProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GalleryScriptInner class. + */ + public GalleryScriptInner() { + } + + /** + * Get the properties property: Describes the properties of a gallery Script Definition. + * + * @return the properties value. + */ + public GalleryScriptProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes the properties of a gallery Script Definition. + * + * @param properties the properties value to set. + * @return the GalleryScriptInner object itself. + */ + public GalleryScriptInner withProperties(GalleryScriptProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptInner 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 GalleryScriptInner. + */ + public static GalleryScriptInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptInner deserializedGalleryScriptInner = new GalleryScriptInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGalleryScriptInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGalleryScriptInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGalleryScriptInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGalleryScriptInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryScriptInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGalleryScriptInner.properties = GalleryScriptProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGalleryScriptInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptProperties.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptProperties.java new file mode 100644 index 000000000000..37fd002e8e53 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptProperties.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.models.OperatingSystemTypes; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Describes the properties of a gallery script definition. + */ +@Fluent +public final class GalleryScriptProperties implements JsonSerializable { + /* + * The description of this gallery script definition resource. This property is updatable. + */ + private String description; + + /* + * The Eula agreement (End User License Agreement) for the gallery Script Definition. + */ + private String eula; + + /* + * The privacy statement uri. + */ + private String privacyStatementUri; + + /* + * The release note uri. + */ + private String releaseNoteUri; + + /* + * The end of life date of the gallery Script Definition. This property can be used for decommissioning purposes. + * This property is updatable. + */ + private OffsetDateTime endOfLifeDate; + + /* + * This property allows you to specify the supported type of the OS that application is built for. Possible values + * are: **Windows,** **Linux.** + */ + private OperatingSystemTypes supportedOSType; + + /* + * The provisioning state, which only appears in the response. + */ + private GalleryProvisioningState provisioningState; + + /** + * Creates an instance of GalleryScriptProperties class. + */ + public GalleryScriptProperties() { + } + + /** + * Get the description property: The description of this gallery script definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of this gallery script definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the eula property: The Eula agreement (End User License Agreement) for the gallery Script Definition. + * + * @return the eula value. + */ + public String eula() { + return this.eula; + } + + /** + * Set the eula property: The Eula agreement (End User License Agreement) for the gallery Script Definition. + * + * @param eula the eula value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withEula(String eula) { + this.eula = eula; + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.privacyStatementUri; + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withPrivacyStatementUri(String privacyStatementUri) { + this.privacyStatementUri = privacyStatementUri; + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.releaseNoteUri; + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withReleaseNoteUri(String releaseNoteUri) { + this.releaseNoteUri = releaseNoteUri; + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery Script Definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.endOfLifeDate; + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery Script Definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + this.endOfLifeDate = endOfLifeDate; + return this; + } + + /** + * Get the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. Possible values are: **Windows,** **Linux.**. + * + * @return the supportedOSType value. + */ + public OperatingSystemTypes supportedOSType() { + return this.supportedOSType; + } + + /** + * Set the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. Possible values are: **Windows,** **Linux.**. + * + * @param supportedOSType the supportedOSType value to set. + * @return the GalleryScriptProperties object itself. + */ + public GalleryScriptProperties withSupportedOSType(OperatingSystemTypes supportedOSType) { + this.supportedOSType = supportedOSType; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedOSType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property supportedOSType in model GalleryScriptProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("supportedOSType", + this.supportedOSType == null ? null : this.supportedOSType.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("eula", this.eula); + jsonWriter.writeStringField("privacyStatementUri", this.privacyStatementUri); + jsonWriter.writeStringField("releaseNoteUri", this.releaseNoteUri); + jsonWriter.writeStringField("endOfLifeDate", + this.endOfLifeDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endOfLifeDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptProperties 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 GalleryScriptProperties. + */ + public static GalleryScriptProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptProperties deserializedGalleryScriptProperties = new GalleryScriptProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportedOSType".equals(fieldName)) { + deserializedGalleryScriptProperties.supportedOSType + = OperatingSystemTypes.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedGalleryScriptProperties.description = reader.getString(); + } else if ("eula".equals(fieldName)) { + deserializedGalleryScriptProperties.eula = reader.getString(); + } else if ("privacyStatementUri".equals(fieldName)) { + deserializedGalleryScriptProperties.privacyStatementUri = reader.getString(); + } else if ("releaseNoteUri".equals(fieldName)) { + deserializedGalleryScriptProperties.releaseNoteUri = reader.getString(); + } else if ("endOfLifeDate".equals(fieldName)) { + deserializedGalleryScriptProperties.endOfLifeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedGalleryScriptProperties.provisioningState + = GalleryProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionInner.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionInner.java new file mode 100644 index 000000000000..2a61efb82073 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class GalleryScriptVersionInner extends Resource { + /* + * Describes the properties of a gallery Script Version. + */ + private GalleryScriptVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GalleryScriptVersionInner class. + */ + public GalleryScriptVersionInner() { + } + + /** + * Get the properties property: Describes the properties of a gallery Script Version. + * + * @return the properties value. + */ + public GalleryScriptVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Describes the properties of a gallery Script Version. + * + * @param properties the properties value to set. + * @return the GalleryScriptVersionInner object itself. + */ + public GalleryScriptVersionInner withProperties(GalleryScriptVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionInner 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 GalleryScriptVersionInner. + */ + public static GalleryScriptVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionInner deserializedGalleryScriptVersionInner = new GalleryScriptVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGalleryScriptVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGalleryScriptVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGalleryScriptVersionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGalleryScriptVersionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryScriptVersionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGalleryScriptVersionInner.properties = GalleryScriptVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGalleryScriptVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionInner; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionProperties.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionProperties.java new file mode 100644 index 000000000000..c808ac63e8a6 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryScriptVersionProperties.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.models.GalleryProvisioningState; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionPublishingProfile; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionSafetyProfile; +import com.azure.resourcemanager.compute.models.ReplicationStatus; +import java.io.IOException; + +/** + * Describes the properties of a gallery script version. + */ +@Fluent +public final class GalleryScriptVersionProperties implements JsonSerializable { + /* + * The publishing profile of a gallery image version. + */ + private GalleryScriptVersionPublishingProfile publishingProfile; + + /* + * The safety profile of the Gallery Script Version. + */ + private GalleryScriptVersionSafetyProfile safetyProfile; + + /* + * The provisioning state, which only appears in the response. + */ + private GalleryProvisioningState provisioningState; + + /* + * This is the replication status of the gallery image version. + */ + private ReplicationStatus replicationStatus; + + /** + * Creates an instance of GalleryScriptVersionProperties class. + */ + public GalleryScriptVersionProperties() { + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryScriptVersionPublishingProfile publishingProfile() { + return this.publishingProfile; + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryScriptVersionProperties object itself. + */ + public GalleryScriptVersionProperties + withPublishingProfile(GalleryScriptVersionPublishingProfile publishingProfile) { + this.publishingProfile = publishingProfile; + return this; + } + + /** + * Get the safetyProfile property: The safety profile of the Gallery Script Version. + * + * @return the safetyProfile value. + */ + public GalleryScriptVersionSafetyProfile safetyProfile() { + return this.safetyProfile; + } + + /** + * Set the safetyProfile property: The safety profile of the Gallery Script Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryScriptVersionProperties object itself. + */ + public GalleryScriptVersionProperties withSafetyProfile(GalleryScriptVersionSafetyProfile safetyProfile) { + this.safetyProfile = safetyProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.replicationStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishingProfile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publishingProfile in model GalleryScriptVersionProperties")); + } else { + publishingProfile().validate(); + } + if (safetyProfile() != null) { + safetyProfile().validate(); + } + if (replicationStatus() != null) { + replicationStatus().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptVersionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("publishingProfile", this.publishingProfile); + jsonWriter.writeJsonField("safetyProfile", this.safetyProfile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionProperties 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 GalleryScriptVersionProperties. + */ + public static GalleryScriptVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionProperties deserializedGalleryScriptVersionProperties + = new GalleryScriptVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publishingProfile".equals(fieldName)) { + deserializedGalleryScriptVersionProperties.publishingProfile + = GalleryScriptVersionPublishingProfile.fromJson(reader); + } else if ("safetyProfile".equals(fieldName)) { + deserializedGalleryScriptVersionProperties.safetyProfile + = GalleryScriptVersionSafetyProfile.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedGalleryScriptVersionProperties.provisioningState + = GalleryProvisioningState.fromString(reader.getString()); + } else if ("replicationStatus".equals(fieldName)) { + deserializedGalleryScriptVersionProperties.replicationStatus = ReplicationStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionProperties; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleriesClientImpl.java index 0ede6492e712..c20a0769505e 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleriesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleriesClientImpl.java @@ -95,7 +95,7 @@ public Mono> getWithResponseAsync(String locatio return Mono .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -133,7 +133,7 @@ private Mono> getWithResponseAsync(String locati return Mono .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImageVersionsClientImpl.java index a12dd69096d4..d57a0d83fa34 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImageVersionsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImageVersionsClientImpl.java @@ -126,7 +126,7 @@ private Mono> listSinglePageAsy return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -171,7 +171,7 @@ private Mono> listSinglePageAsy return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -297,7 +297,7 @@ public Mono> getWithResponseAsync(St return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -346,7 +346,7 @@ private Mono> getWithResponseAsync(S return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImagesClientImpl.java index 6c9c89cb3ddc..e01bb3d09166 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImagesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/CommunityGalleryImagesClientImpl.java @@ -119,7 +119,7 @@ private Mono> listSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -159,7 +159,7 @@ private Mono> listSinglePageAsync(Stri return Mono .error(new IllegalArgumentException("Parameter publicGalleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -267,7 +267,7 @@ public Mono> getWithResponseAsync(String lo return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -309,7 +309,7 @@ private Mono> getWithResponseAsync(String l return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java index e0064856d407..c5862bfec946 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/ComputeManagementClientImpl.java @@ -33,6 +33,8 @@ import com.azure.resourcemanager.compute.fluent.GalleryImagesClient; import com.azure.resourcemanager.compute.fluent.GalleryInVMAccessControlProfileVersionsClient; import com.azure.resourcemanager.compute.fluent.GalleryInVMAccessControlProfilesClient; +import com.azure.resourcemanager.compute.fluent.GalleryScriptVersionsClient; +import com.azure.resourcemanager.compute.fluent.GalleryScriptsClient; import com.azure.resourcemanager.compute.fluent.GallerySharingProfilesClient; import com.azure.resourcemanager.compute.fluent.ImagesClient; import com.azure.resourcemanager.compute.fluent.LogAnalyticsClient; @@ -769,6 +771,34 @@ public GalleryInVMAccessControlProfileVersionsClient getGalleryInVMAccessControl return this.galleryInVMAccessControlProfileVersions; } + /** + * The GalleryScriptsClient object to access its operations. + */ + private final GalleryScriptsClient galleryScripts; + + /** + * Gets the GalleryScriptsClient object to access its operations. + * + * @return the GalleryScriptsClient object. + */ + public GalleryScriptsClient getGalleryScripts() { + return this.galleryScripts; + } + + /** + * The GalleryScriptVersionsClient object to access its operations. + */ + private final GalleryScriptVersionsClient galleryScriptVersions; + + /** + * Gets the GalleryScriptVersionsClient object to access its operations. + * + * @return the GalleryScriptVersionsClient object. + */ + public GalleryScriptVersionsClient getGalleryScriptVersions() { + return this.galleryScriptVersions; + } + /** * The GallerySharingProfilesClient object to access its operations. */ @@ -930,6 +960,8 @@ public CloudServiceOperatingSystemsClient getCloudServiceOperatingSystems() { this.galleryImageVersions = new GalleryImageVersionsClientImpl(this); this.galleryInVMAccessControlProfiles = new GalleryInVMAccessControlProfilesClientImpl(this); this.galleryInVMAccessControlProfileVersions = new GalleryInVMAccessControlProfileVersionsClientImpl(this); + this.galleryScripts = new GalleryScriptsClientImpl(this); + this.galleryScriptVersions = new GalleryScriptVersionsClientImpl(this); this.gallerySharingProfiles = new GallerySharingProfilesClientImpl(this); this.softDeletedResources = new SoftDeletedResourcesClientImpl(this); this.cloudServiceRoleInstances = new CloudServiceRoleInstancesClientImpl(this); diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java index 7ff2787e9575..3351bb93ee87 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleriesClientImpl.java @@ -167,7 +167,7 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -197,7 +197,7 @@ private Mono> listSinglePageAsync(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) @@ -282,7 +282,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, @@ -318,7 +318,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -419,7 +419,7 @@ public Mono> getByResourceGroupWithResponseAsync(String r if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, @@ -459,7 +459,7 @@ private Mono> getByResourceGroupWithResponseAsync(String if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -557,7 +557,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { gallery.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -601,7 +601,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { gallery.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -796,7 +796,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { gallery.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -840,7 +840,7 @@ private Mono>> updateWithResponseAsync(String resource } else { gallery.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -1025,7 +1025,7 @@ public Mono>> deleteWithResponseAsync(String resourceG if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, @@ -1062,7 +1062,7 @@ private Mono>> deleteWithResponseAsync(String resource if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java index 2a64123adfdd..c6310b8e14b7 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationVersionsClientImpl.java @@ -173,7 +173,7 @@ private Mono> listByGalleryApplica return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.listByGalleryApplication(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryApplicationName, accept, context)) @@ -217,7 +217,7 @@ private Mono> listByGalleryApplica return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -344,7 +344,7 @@ public Mono> getWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter galleryApplicationVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -395,7 +395,7 @@ private Mono> getWithResponseAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter galleryApplicationVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -514,7 +514,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryApplicationVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -572,7 +572,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryApplicationVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -828,7 +828,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryApplicationVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -885,7 +885,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryApplicationVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -1122,7 +1122,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter galleryApplicationVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, @@ -1170,7 +1170,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter galleryApplicationVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java index 6a08165d3f97..900e39f3ca7e 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryApplicationsClientImpl.java @@ -161,7 +161,7 @@ private Mono> listByGallerySinglePageAsyn if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByGallery(this.client.getEndpoint(), apiVersion, @@ -201,7 +201,7 @@ private Mono> listByGallerySinglePageAsyn if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -311,7 +311,7 @@ public Mono> getWithResponseAsync(String resou return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -354,7 +354,7 @@ private Mono> getWithResponseAsync(String reso return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -456,7 +456,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryApplication.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -508,7 +508,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryApplication.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -730,7 +730,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryApplication.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext( @@ -781,7 +781,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryApplication.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -993,7 +993,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1036,7 +1036,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java index 23180dfa095e..249d019b6cad 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImageVersionsClientImpl.java @@ -173,7 +173,7 @@ private Mono> listByGalleryImageSinglePa return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByGalleryImage(this.client.getEndpoint(), apiVersion, @@ -218,7 +218,7 @@ private Mono> listByGalleryImageSinglePa return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -342,7 +342,7 @@ public Mono> getWithResponseAsync(String reso return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -391,7 +391,7 @@ private Mono> getWithResponseAsync(String res return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -508,7 +508,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryImageVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -565,7 +565,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryImageVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -805,7 +805,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryImageVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -862,7 +862,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryImageVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -1092,7 +1092,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1140,7 +1140,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java index 4d4648ccdbbe..98095fda65a4 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryImagesClientImpl.java @@ -161,7 +161,7 @@ private Mono> listByGallerySinglePageAsync(Stri if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByGallery(this.client.getEndpoint(), apiVersion, @@ -201,7 +201,7 @@ private Mono> listByGallerySinglePageAsync(Stri if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -311,7 +311,7 @@ public Mono> getWithResponseAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -354,7 +354,7 @@ private Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -454,7 +454,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryImage.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -504,7 +504,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryImage.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -717,7 +717,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryImage.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext( @@ -767,7 +767,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryImage.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -971,7 +971,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, @@ -1013,7 +1013,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfileVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfileVersionsClientImpl.java index 530c0fda9331..95d194a48c18 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfileVersionsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfileVersionsClientImpl.java @@ -175,7 +175,7 @@ Mono> listByGalleryInVMAcce return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByGalleryInVMAccessControlProfile(this.client.getEndpoint(), apiVersion, @@ -223,7 +223,7 @@ Mono> listByGalleryInVMAcce return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -356,7 +356,7 @@ public Mono> getWithRespon return Mono.error(new IllegalArgumentException( "Parameter inVMAccessControlProfileVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -407,7 +407,7 @@ private Mono> getWithRespo return Mono.error(new IllegalArgumentException( "Parameter inVMAccessControlProfileVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -528,7 +528,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryInVMAccessControlProfileVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -587,7 +587,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryInVMAccessControlProfileVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -864,7 +864,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryInVMAccessControlProfileVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -923,7 +923,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryInVMAccessControlProfileVersion.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -1190,7 +1190,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter inVMAccessControlProfileVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, @@ -1239,7 +1239,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter inVMAccessControlProfileVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfilesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfilesClientImpl.java index 0dcc8b4f753c..39faae2b510d 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfilesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryInVMAccessControlProfilesClientImpl.java @@ -161,7 +161,7 @@ Mono> listByGalleryNext( if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByGallery(this.client.getEndpoint(), apiVersion, @@ -201,7 +201,7 @@ Mono> listByGalleryNext( if (galleryName == null) { return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -317,7 +317,7 @@ public Mono> getWithResponseAsync return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -360,7 +360,7 @@ private Mono> getWithResponseAsyn return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -465,7 +465,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { galleryInVMAccessControlProfile.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, @@ -518,7 +518,7 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { galleryInVMAccessControlProfile.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -755,7 +755,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { galleryInVMAccessControlProfile.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -808,7 +808,7 @@ private Mono>> updateWithResponseAsync(String resource } else { galleryInVMAccessControlProfile.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, @@ -1035,7 +1035,7 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1078,7 +1078,7 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter inVMAccessControlProfileName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptVersionsClientImpl.java new file mode 100644 index 000000000000..eb94c0444d91 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptVersionsClientImpl.java @@ -0,0 +1,1358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.fluent.GalleryScriptVersionsClient; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionInner; +import com.azure.resourcemanager.compute.models.ApiErrorException; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionList; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GalleryScriptVersionsClient. + */ +public final class GalleryScriptVersionsClientImpl implements GalleryScriptVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GalleryScriptVersionsService service; + + /** + * The service client containing this operation class. + */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryScriptVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryScriptVersionsClientImpl(ComputeManagementClientImpl client) { + this.service = RestProxy.create(GalleryScriptVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryScriptVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementClientGalleryScriptVersions") + public interface GalleryScriptVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryScript(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @PathParam("galleryScriptVersionName") String galleryScriptVersionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @PathParam("galleryScriptVersionName") String galleryScriptVersionName, + @BodyParam("application/json") GalleryScriptVersionInner galleryScriptVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @PathParam("galleryScriptVersionName") String galleryScriptVersionName, + @BodyParam("application/json") GalleryScriptVersionUpdate galleryScriptVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}/versions/{galleryScriptVersionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @PathParam("galleryScriptVersionName") String galleryScriptVersionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryScriptNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryScriptSinglePageAsync(String resourceGroupName, + String galleryName, String galleryScriptName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByGalleryScript(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryScriptName, 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())); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryScriptSinglePageAsync(String resourceGroupName, + String galleryName, String galleryScriptName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGalleryScript(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByGalleryScriptAsync(String resourceGroupName, String galleryName, + String galleryScriptName) { + return new PagedFlux<>( + () -> listByGalleryScriptSinglePageAsync(resourceGroupName, galleryName, galleryScriptName), + nextLink -> listByGalleryScriptNextSinglePageAsync(nextLink)); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryScriptAsync(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + return new PagedFlux<>( + () -> listByGalleryScriptSinglePageAsync(resourceGroupName, galleryName, galleryScriptName, context), + nextLink -> listByGalleryScriptNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryScript(String resourceGroupName, String galleryName, + String galleryScriptName) { + return new PagedIterable<>(listByGalleryScriptAsync(resourceGroupName, galleryName, galleryScriptName)); + } + + /** + * List gallery Script Versions in a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGalleryScript(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + return new PagedIterable<>( + listByGalleryScriptAsync(resourceGroupName, galleryName, galleryScriptName, context)); + } + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, galleryScriptVersionName, accept, context); + } + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + context).block(); + } + + /** + * Custom ArmResourceRead operation template with CloudError as Error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptVersionInner get(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName) { + return getWithResponse(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + Context.NONE).getValue(); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + if (galleryScriptVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptVersion is required and cannot be null.")); + } else { + galleryScriptVersion.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryScriptName, + galleryScriptVersionName, galleryScriptVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + if (galleryScriptVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptVersion is required and cannot be null.")); + } else { + galleryScriptVersion.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, galleryScriptVersion, accept, + context); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GalleryScriptVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScriptVersionName, galleryScriptVersion); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GalleryScriptVersionInner.class, GalleryScriptVersionInner.class, + this.client.getContext()); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryScriptVersionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScriptVersionName, galleryScriptVersion, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GalleryScriptVersionInner.class, GalleryScriptVersionInner.class, context); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptVersionInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion) + .getSyncPoller(); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptVersionInner> beginCreateOrUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionInner galleryScriptVersion, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context) + .getSyncPoller(); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptVersionInner createOrUpdate(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion).block(); + } + + /** + * Create or update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the create or update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptVersionInner createOrUpdate(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionInner galleryScriptVersion, + Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context).block(); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + if (galleryScriptVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptVersion is required and cannot be null.")); + } else { + galleryScriptVersion.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryScriptName, + galleryScriptVersionName, galleryScriptVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + if (galleryScriptVersion == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptVersion is required and cannot be null.")); + } else { + galleryScriptVersion.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, galleryScriptVersionName, galleryScriptVersion, accept, context); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GalleryScriptVersionInner> beginUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScriptVersionName, galleryScriptVersion); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GalleryScriptVersionInner.class, GalleryScriptVersionInner.class, + this.client.getContext()); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryScriptVersionInner> beginUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScriptVersionName, galleryScriptVersion, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GalleryScriptVersionInner.class, GalleryScriptVersionInner.class, context); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptVersionInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion) { + return this + .beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion) + .getSyncPoller(); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptVersionInner> beginUpdate( + String resourceGroupName, String galleryName, String galleryScriptName, String galleryScriptVersionName, + GalleryScriptVersionUpdate galleryScriptVersion, Context context) { + return this + .beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context) + .getSyncPoller(); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion, + Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptVersionInner update(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion) { + return updateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion).block(); + } + + /** + * Update a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param galleryScriptVersion Parameters supplied to the update gallery Script Version operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptVersionInner update(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, GalleryScriptVersionUpdate galleryScriptVersion, Context context) { + return updateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, + galleryScriptVersion, context).block(); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScriptVersionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter galleryScriptVersionName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, galleryScriptVersionName, accept, context); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScriptVersionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName) { + return this.beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName) + .getSyncPoller(); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, String galleryScriptVersionName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, context) + .getSyncPoller(); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName) { + deleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName).block(); + } + + /** + * Delete a gallery Script Version. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScriptVersionName The name of the gallery Script Version to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryName, String galleryScriptName, + String galleryScriptVersionName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryScriptName, galleryScriptVersionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryScriptNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByGalleryScriptNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of GalleryScriptVersion items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryScriptNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByGalleryScriptNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptsClientImpl.java new file mode 100644 index 000000000000..4fa485a98fee --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GalleryScriptsClientImpl.java @@ -0,0 +1,1231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.compute.fluent.GalleryScriptsClient; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptInner; +import com.azure.resourcemanager.compute.models.ApiErrorException; +import com.azure.resourcemanager.compute.models.GalleryScriptList; +import com.azure.resourcemanager.compute.models.GalleryScriptUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GalleryScriptsClient. + */ +public final class GalleryScriptsClientImpl implements GalleryScriptsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GalleryScriptsService service; + + /** + * The service client containing this operation class. + */ + private final ComputeManagementClientImpl client; + + /** + * Initializes an instance of GalleryScriptsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GalleryScriptsClientImpl(ComputeManagementClientImpl client) { + this.service + = RestProxy.create(GalleryScriptsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ComputeManagementClientGalleryScripts to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ComputeManagementClientGalleryScripts") + public interface GalleryScriptsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGallery(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @BodyParam("application/json") GalleryScriptInner galleryScript, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, + @BodyParam("application/json") GalleryScriptUpdate galleryScript, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{galleryScriptName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("galleryName") String galleryName, + @PathParam("galleryScriptName") String galleryScriptName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ApiErrorException.class) + Mono> listByGalleryNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync(String resourceGroupName, + String galleryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByGallery(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, 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())); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGallerySinglePageAsync(String resourceGroupName, + String galleryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByGallery(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName) { + return new PagedFlux<>(() -> listByGallerySinglePageAsync(resourceGroupName, galleryName), + nextLink -> listByGalleryNextSinglePageAsync(nextLink)); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByGalleryAsync(String resourceGroupName, String galleryName, + Context context) { + return new PagedFlux<>(() -> listByGallerySinglePageAsync(resourceGroupName, galleryName, context), + nextLink -> listByGalleryNextSinglePageAsync(nextLink, context)); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery(String resourceGroupName, String galleryName) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName)); + } + + /** + * List gallery Script Definitions in a gallery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByGallery(String resourceGroupName, String galleryName, + Context context) { + return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); + } + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, accept, context); + } + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String galleryName, String galleryScriptName) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryScriptName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + return getWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, context).block(); + } + + /** + * Retrieves information about a gallery script definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptInner get(String resourceGroupName, String galleryName, String galleryScriptName) { + return getWithResponse(resourceGroupName, galleryName, galleryScriptName, Context.NONE).getValue(); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScript == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryScript is required and cannot be null.")); + } else { + galleryScript.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryScriptName, galleryScript, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScript == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryScript is required and cannot be null.")); + } else { + galleryScript.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, galleryScript, accept, context); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GalleryScriptInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, GalleryScriptInner galleryScript) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryScriptInner.class, GalleryScriptInner.class, this.client.getContext()); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryScriptInner> beginCreateOrUpdateAsync( + String resourceGroupName, String galleryName, String galleryScriptName, GalleryScriptInner galleryScript, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, galleryName, + galleryScriptName, galleryScript, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryScriptInner.class, GalleryScriptInner.class, context); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptInner> beginCreateOrUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript) { + return this.beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript) + .getSyncPoller(); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptInner> beginCreateOrUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptInner galleryScript, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context) + .getSyncPoller(); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptInner galleryScript) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptInner galleryScript, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptInner galleryScript) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript).block(); + } + + /** + * Create or update a Gallery Script Definition. Gallery scripts allow the storage, sharing and reuse of common + * scripts. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the create or update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptInner createOrUpdate(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptInner galleryScript, Context context) { + return createOrUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context).block(); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptUpdate galleryScript) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScript == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryScript is required and cannot be null.")); + } else { + galleryScript.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, galleryName, galleryScriptName, galleryScript, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, GalleryScriptUpdate galleryScript, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + if (galleryScript == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryScript is required and cannot be null.")); + } else { + galleryScript.validate(); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, galleryScript, accept, context); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GalleryScriptInner> beginUpdateAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryScriptInner.class, GalleryScriptInner.class, this.client.getContext()); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GalleryScriptInner> beginUpdateAsync(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GalleryScriptInner.class, GalleryScriptInner.class, context); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript) { + return this.beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript).getSyncPoller(); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies information about the gallery Script Definition that you + * want to create or update. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GalleryScriptInner> beginUpdate(String resourceGroupName, + String galleryName, String galleryScriptName, GalleryScriptUpdate galleryScript, Context context) { + return this.beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context) + .getSyncPoller(); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript, Context context) { + return beginUpdateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptInner update(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript) { + return updateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript).block(); + } + + /** + * Update a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param galleryScript Parameters supplied to the update gallery Script operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies information about the gallery Script Definition that you want to create or update. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GalleryScriptInner update(String resourceGroupName, String galleryName, String galleryScriptName, + GalleryScriptUpdate galleryScript, Context context) { + return updateAsync(resourceGroupName, galleryName, galleryScriptName, galleryScript, context).block(); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, galleryName, galleryScriptName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (galleryName == null) { + return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); + } + if (galleryScriptName == null) { + return Mono + .error(new IllegalArgumentException("Parameter galleryScriptName is required and cannot be null.")); + } + final String apiVersion = "2025-03-03"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + galleryName, galleryScriptName, accept, context); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, galleryName, galleryScriptName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, galleryName, galleryScriptName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName) { + return this.beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName).getSyncPoller(); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String galleryName, + String galleryScriptName, Context context) { + return this.beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, context).getSyncPoller(); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String galleryName, String galleryScriptName, + Context context) { + return beginDeleteAsync(resourceGroupName, galleryName, galleryScriptName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryName, String galleryScriptName) { + deleteAsync(resourceGroupName, galleryName, galleryScriptName).block(); + } + + /** + * Delete a gallery Script Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param galleryName The name of the Shared Image Gallery. + * @param galleryScriptName The name of the gallery Script Definition to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String galleryName, String galleryScriptName, Context context) { + deleteAsync(resourceGroupName, galleryName, galleryScriptName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Gallery Script operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByGalleryNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByGalleryNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GallerySharingProfilesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GallerySharingProfilesClientImpl.java index 7bb8713b3d2f..e55cf741a9b4 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GallerySharingProfilesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/GallerySharingProfilesClientImpl.java @@ -109,7 +109,7 @@ public Mono>> updateWithResponseAsync(String resourceG } else { sharingUpdate.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, @@ -153,7 +153,7 @@ private Mono>> updateWithResponseAsync(String resource } else { sharingUpdate.validate(); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleriesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleriesClientImpl.java index 9cf0170437e0..515aeac03e6b 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleriesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleriesClientImpl.java @@ -113,7 +113,7 @@ private Mono> listSinglePageAsync(String locat if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -149,7 +149,7 @@ private Mono> listSinglePageAsync(String locat if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -267,7 +267,7 @@ public Mono> getWithResponseAsync(String location, return Mono .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -305,7 +305,7 @@ private Mono> getWithResponseAsync(String location, return Mono .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImageVersionsClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImageVersionsClientImpl.java index aae8584a7748..20cbfaa1a9f6 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImageVersionsClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImageVersionsClientImpl.java @@ -129,7 +129,7 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -176,7 +176,7 @@ private Mono> listSinglePageAsync( return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -331,7 +331,7 @@ public Mono> getWithResponseAsync(Strin return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -382,7 +382,7 @@ private Mono> getWithResponseAsync(Stri return Mono.error( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImagesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImagesClientImpl.java index f00a1d103fe3..40fffa90af8a 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImagesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SharedGalleryImagesClientImpl.java @@ -120,7 +120,7 @@ private Mono> listSinglePageAsync(String return Mono .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -161,7 +161,7 @@ private Mono> listSinglePageAsync(String return Mono .error(new IllegalArgumentException("Parameter galleryUniqueName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -294,7 +294,7 @@ public Mono> getWithResponseAsync(String locat return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), @@ -338,7 +338,7 @@ private Mono> getWithResponseAsync(String loca return Mono .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SoftDeletedResourcesClientImpl.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SoftDeletedResourcesClientImpl.java index 160c1d6547af..1ae30c9d5d78 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SoftDeletedResourcesClientImpl.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/SoftDeletedResourcesClientImpl.java @@ -120,7 +120,7 @@ private Mono> listByArtifactNameS if (artifactName == null) { return Mono.error(new IllegalArgumentException("Parameter artifactName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByArtifactName(this.client.getEndpoint(), apiVersion, @@ -171,7 +171,7 @@ private Mono> listByArtifactNameS if (artifactName == null) { return Mono.error(new IllegalArgumentException("Parameter artifactName is required and cannot be null.")); } - final String apiVersion = "2024-03-03"; + final String apiVersion = "2025-03-03"; final String accept = "application/json"; context = this.client.mergeContext(context); return service diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Architecture.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Architecture.java index 5c03d857b4be..5f6842321366 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Architecture.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/Architecture.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The architecture of the image. Applicable to OS disks only. + * CPU architecture supported by an OS disk. */ public final class Architecture extends ExpandableStringEnum { /** diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutedValidation.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutedValidation.java index 6ce9bb3a1ae5..3b8273be3f2e 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutedValidation.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ExecutedValidation.java @@ -74,17 +74,6 @@ public ValidationStatus status() { return this.status; } - /** - * Set the status property: This property specifies the status of the validationProfile of the image version. - * - * @param status the status value to set. - * @return the ExecutedValidation object itself. - */ - public ExecutedValidation withStatus(ValidationStatus status) { - this.status = status; - return this; - } - /** * Get the version property: This property specifies the valid version of the validation. * @@ -140,7 +129,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); jsonWriter.writeStringField("version", this.version); jsonWriter.writeStringField("executionTime", this.executionTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.executionTime)); diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java index 569803165ed8..916e617fc5a8 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryApplicationVersionPublishingProfile.java @@ -264,6 +264,16 @@ public GalleryApplicationVersionPublishingProfile withReplicationMode(Replicatio return this; } + /** + * {@inheritDoc} + */ + @Override + public GalleryApplicationVersionPublishingProfile + withStorageAccountStrategy(StorageAccountStrategy storageAccountStrategy) { + super.withStorageAccountStrategy(storageAccountStrategy); + return this; + } + /** * Validates the instance. * @@ -313,6 +323,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("replicationMode", replicationMode() == null ? null : replicationMode().toString()); jsonWriter.writeArrayField("targetExtendedLocations", targetExtendedLocations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("storageAccountStrategy", + storageAccountStrategy() == null ? null : storageAccountStrategy().toString()); jsonWriter.writeJsonField("source", this.source); jsonWriter.writeJsonField("manageActions", this.manageActions); jsonWriter.writeJsonField("settings", this.settings); @@ -366,6 +378,9 @@ public static GalleryApplicationVersionPublishingProfile fromJson(JsonReader jso = reader.readArray(reader1 -> GalleryTargetExtendedLocation.fromJson(reader1)); deserializedGalleryApplicationVersionPublishingProfile .withTargetExtendedLocations(targetExtendedLocations); + } else if ("storageAccountStrategy".equals(fieldName)) { + deserializedGalleryApplicationVersionPublishingProfile + .withStorageAccountStrategy(StorageAccountStrategy.fromString(reader.getString())); } else if ("source".equals(fieldName)) { deserializedGalleryApplicationVersionPublishingProfile.source = UserArtifactSource.fromJson(reader); } else if ("manageActions".equals(fieldName)) { diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java index a55e5533620e..6a34011beada 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryArtifactPublishingProfileBase.java @@ -49,7 +49,8 @@ public class GalleryArtifactPublishingProfileBase implements JsonSerializable targetExtendedLocations; + /* + * Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with + * storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This + * property is not updatable. + */ + private StorageAccountStrategy storageAccountStrategy; + /** * Creates an instance of GalleryArtifactPublishingProfileBase class. */ @@ -178,8 +186,8 @@ public GalleryArtifactPublishingProfileBase withEndOfLifeDate(OffsetDateTime end } /** - * Get the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. + * Get the storageAccountType property: Specifies the storage account type to be used to store the image. Cannot be + * specified along with storageAccountStrategy. This property is not updatable. * * @return the storageAccountType value. */ @@ -188,8 +196,8 @@ public StorageAccountType storageAccountType() { } /** - * Set the storageAccountType property: Specifies the storage account type to be used to store the image. This - * property is not updatable. + * Set the storageAccountType property: Specifies the storage account type to be used to store the image. Cannot be + * specified along with storageAccountStrategy. This property is not updatable. * * @param storageAccountType the storageAccountType value to set. * @return the GalleryArtifactPublishingProfileBase object itself. @@ -244,6 +252,31 @@ public List targetExtendedLocations() { return this; } + /** + * Get the storageAccountStrategy property: Specifies the strategy to be used when selecting the storage account + * type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying + * targetRegions[].storageAccountType. This property is not updatable. + * + * @return the storageAccountStrategy value. + */ + public StorageAccountStrategy storageAccountStrategy() { + return this.storageAccountStrategy; + } + + /** + * Set the storageAccountStrategy property: Specifies the strategy to be used when selecting the storage account + * type. Cannot be specified along with storageAccountType, but can be overridden per region by specifying + * targetRegions[].storageAccountType. This property is not updatable. + * + * @param storageAccountStrategy the storageAccountStrategy value to set. + * @return the GalleryArtifactPublishingProfileBase object itself. + */ + public GalleryArtifactPublishingProfileBase + withStorageAccountStrategy(StorageAccountStrategy storageAccountStrategy) { + this.storageAccountStrategy = storageAccountStrategy; + return this; + } + /** * Validates the instance. * @@ -275,6 +308,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.replicationMode == null ? null : this.replicationMode.toString()); jsonWriter.writeArrayField("targetExtendedLocations", this.targetExtendedLocations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("storageAccountStrategy", + this.storageAccountStrategy == null ? null : this.storageAccountStrategy.toString()); return jsonWriter.writeEndObject(); } @@ -319,6 +354,9 @@ public static GalleryArtifactPublishingProfileBase fromJson(JsonReader jsonReade List targetExtendedLocations = reader.readArray(reader1 -> GalleryTargetExtendedLocation.fromJson(reader1)); deserializedGalleryArtifactPublishingProfileBase.targetExtendedLocations = targetExtendedLocations; + } else if ("storageAccountStrategy".equals(fieldName)) { + deserializedGalleryArtifactPublishingProfileBase.storageAccountStrategy + = StorageAccountStrategy.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java index 0d6f32c5612d..ccb9083dfbb8 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryImageVersionPublishingProfile.java @@ -104,6 +104,16 @@ public GalleryImageVersionPublishingProfile withReplicationMode(ReplicationMode return this; } + /** + * {@inheritDoc} + */ + @Override + public GalleryImageVersionPublishingProfile + withStorageAccountStrategy(StorageAccountStrategy storageAccountStrategy) { + super.withStorageAccountStrategy(storageAccountStrategy); + return this; + } + /** * Validates the instance. * @@ -135,6 +145,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("replicationMode", replicationMode() == null ? null : replicationMode().toString()); jsonWriter.writeArrayField("targetExtendedLocations", targetExtendedLocations(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("storageAccountStrategy", + storageAccountStrategy() == null ? null : storageAccountStrategy().toString()); return jsonWriter.writeEndObject(); } @@ -180,6 +192,9 @@ public static GalleryImageVersionPublishingProfile fromJson(JsonReader jsonReade = reader.readArray(reader1 -> GalleryTargetExtendedLocation.fromJson(reader1)); deserializedGalleryImageVersionPublishingProfile .withTargetExtendedLocations(targetExtendedLocations); + } else if ("storageAccountStrategy".equals(fieldName)) { + deserializedGalleryImageVersionPublishingProfile + .withStorageAccountStrategy(StorageAccountStrategy.fromString(reader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptList.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptList.java new file mode 100644 index 000000000000..2a4d70215c0d --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptList.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptInner; +import java.io.IOException; +import java.util.List; + +/** + * The List Gallery Script operation response. + */ +@Fluent +public final class GalleryScriptList implements JsonSerializable { + /* + * The GalleryScript items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GalleryScriptList class. + */ + public GalleryScriptList() { + } + + /** + * Get the value property: The GalleryScript items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The GalleryScript items on this page. + * + * @param value the value value to set. + * @return the GalleryScriptList object itself. + */ + public GalleryScriptList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + 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 GalleryScriptList object itself. + */ + public GalleryScriptList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model GalleryScriptList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptList.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(); + } + + /** + * Reads an instance of GalleryScriptList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptList 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 GalleryScriptList. + */ + public static GalleryScriptList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptList deserializedGalleryScriptList = new GalleryScriptList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GalleryScriptInner.fromJson(reader1)); + deserializedGalleryScriptList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGalleryScriptList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptList; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameter.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameter.java new file mode 100644 index 000000000000..b90eb19e16aa --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameter.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The definition of a parameter that can be passed to a script of a Gallery Script Version. + */ +@Fluent +public final class GalleryScriptParameter extends GenericGalleryParameter { + /* + * Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum + */ + private GalleryScriptParameterType type; + + /* + * The minimum value of parameter. + */ + private String minValue; + + /* + * The minimum value of parameter. + */ + private String maxValue; + + /* + * A list of permissible values. Only applicable values are from 'enum' values defined in 'GalleryScriptParameter'. + */ + private List enumValues; + + /** + * Creates an instance of GalleryScriptParameter class. + */ + public GalleryScriptParameter() { + } + + /** + * Get the type property: Specifies the type of the Gallery Script parameter. Possible values are: String, Int, + * Double, Boolean, Enum. + * + * @return the type value. + */ + public GalleryScriptParameterType type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the Gallery Script parameter. Possible values are: String, Int, + * Double, Boolean, Enum. + * + * @param type the type value to set. + * @return the GalleryScriptParameter object itself. + */ + public GalleryScriptParameter withType(GalleryScriptParameterType type) { + this.type = type; + return this; + } + + /** + * Get the minValue property: The minimum value of parameter. + * + * @return the minValue value. + */ + public String minValue() { + return this.minValue; + } + + /** + * Set the minValue property: The minimum value of parameter. + * + * @param minValue the minValue value to set. + * @return the GalleryScriptParameter object itself. + */ + public GalleryScriptParameter withMinValue(String minValue) { + this.minValue = minValue; + return this; + } + + /** + * Get the maxValue property: The minimum value of parameter. + * + * @return the maxValue value. + */ + public String maxValue() { + return this.maxValue; + } + + /** + * Set the maxValue property: The minimum value of parameter. + * + * @param maxValue the maxValue value to set. + * @return the GalleryScriptParameter object itself. + */ + public GalleryScriptParameter withMaxValue(String maxValue) { + this.maxValue = maxValue; + return this; + } + + /** + * Get the enumValues property: A list of permissible values. Only applicable values are from 'enum' values defined + * in 'GalleryScriptParameter'. + * + * @return the enumValues value. + */ + public List enumValues() { + return this.enumValues; + } + + /** + * Set the enumValues property: A list of permissible values. Only applicable values are from 'enum' values defined + * in 'GalleryScriptParameter'. + * + * @param enumValues the enumValues value to set. + * @return the GalleryScriptParameter object itself. + */ + public GalleryScriptParameter withEnumValues(List enumValues) { + this.enumValues = enumValues; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptParameter withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptParameter withRequired(Boolean required) { + super.withRequired(required); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptParameter withDefaultValue(String defaultValue) { + super.withDefaultValue(defaultValue); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptParameter withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model GalleryScriptParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptParameter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeBooleanField("required", required()); + jsonWriter.writeStringField("defaultValue", defaultValue()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("minValue", this.minValue); + jsonWriter.writeStringField("maxValue", this.maxValue); + jsonWriter.writeArrayField("enumValues", this.enumValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptParameter 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 GalleryScriptParameter. + */ + public static GalleryScriptParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptParameter deserializedGalleryScriptParameter = new GalleryScriptParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedGalleryScriptParameter.withName(reader.getString()); + } else if ("required".equals(fieldName)) { + deserializedGalleryScriptParameter.withRequired(reader.getNullable(JsonReader::getBoolean)); + } else if ("defaultValue".equals(fieldName)) { + deserializedGalleryScriptParameter.withDefaultValue(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedGalleryScriptParameter.withDescription(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedGalleryScriptParameter.type = GalleryScriptParameterType.fromString(reader.getString()); + } else if ("minValue".equals(fieldName)) { + deserializedGalleryScriptParameter.minValue = reader.getString(); + } else if ("maxValue".equals(fieldName)) { + deserializedGalleryScriptParameter.maxValue = reader.getString(); + } else if ("enumValues".equals(fieldName)) { + List enumValues = reader.readArray(reader1 -> reader1.getString()); + deserializedGalleryScriptParameter.enumValues = enumValues; + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptParameter; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameterType.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameterType.java new file mode 100644 index 000000000000..d2983b83b137 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptParameterType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the type of the Gallery Script parameter. Possible values are: String, Int, Double, Boolean, Enum. + */ +public final class GalleryScriptParameterType extends ExpandableStringEnum { + /** + * Static value String for GalleryScriptParameterType. + */ + public static final GalleryScriptParameterType STRING = fromString("String"); + + /** + * Static value Int for GalleryScriptParameterType. + */ + public static final GalleryScriptParameterType INT = fromString("Int"); + + /** + * Static value Double for GalleryScriptParameterType. + */ + public static final GalleryScriptParameterType DOUBLE = fromString("Double"); + + /** + * Static value Boolean for GalleryScriptParameterType. + */ + public static final GalleryScriptParameterType BOOLEAN = fromString("Boolean"); + + /** + * Static value Enum for GalleryScriptParameterType. + */ + public static final GalleryScriptParameterType ENUM = fromString("Enum"); + + /** + * Creates a new instance of GalleryScriptParameterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GalleryScriptParameterType() { + } + + /** + * Creates or finds a GalleryScriptParameterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GalleryScriptParameterType. + */ + public static GalleryScriptParameterType fromString(String name) { + return fromString(name, GalleryScriptParameterType.class); + } + + /** + * Gets known GalleryScriptParameterType values. + * + * @return known GalleryScriptParameterType values. + */ + public static Collection values() { + return values(GalleryScriptParameterType.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptUpdate.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptUpdate.java new file mode 100644 index 000000000000..73a82efb272f --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptUpdate.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * Specifies information about the gallery Script Definition that you want to update. + */ +@Fluent +public final class GalleryScriptUpdate extends UpdateResourceDefinition { + /* + * Gallery script definition properties to update. + */ + private GalleryScriptProperties innerProperties; + + /* + * Resource type + */ + private String type; + + /* + * Resource name + */ + private String name; + + /* + * Resource Id + */ + private String id; + + /** + * Creates an instance of GalleryScriptUpdate class. + */ + public GalleryScriptUpdate() { + } + + /** + * Get the innerProperties property: Gallery script definition properties to update. + * + * @return the innerProperties value. + */ + private GalleryScriptProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: The description of this gallery script definition resource. This property is + * updatable. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of this gallery script definition resource. This property is + * updatable. + * + * @param description the description value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the eula property: The Eula agreement (End User License Agreement) for the gallery Script Definition. + * + * @return the eula value. + */ + public String eula() { + return this.innerProperties() == null ? null : this.innerProperties().eula(); + } + + /** + * Set the eula property: The Eula agreement (End User License Agreement) for the gallery Script Definition. + * + * @param eula the eula value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withEula(String eula) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withEula(eula); + return this; + } + + /** + * Get the privacyStatementUri property: The privacy statement uri. + * + * @return the privacyStatementUri value. + */ + public String privacyStatementUri() { + return this.innerProperties() == null ? null : this.innerProperties().privacyStatementUri(); + } + + /** + * Set the privacyStatementUri property: The privacy statement uri. + * + * @param privacyStatementUri the privacyStatementUri value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withPrivacyStatementUri(String privacyStatementUri) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withPrivacyStatementUri(privacyStatementUri); + return this; + } + + /** + * Get the releaseNoteUri property: The release note uri. + * + * @return the releaseNoteUri value. + */ + public String releaseNoteUri() { + return this.innerProperties() == null ? null : this.innerProperties().releaseNoteUri(); + } + + /** + * Set the releaseNoteUri property: The release note uri. + * + * @param releaseNoteUri the releaseNoteUri value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withReleaseNoteUri(String releaseNoteUri) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withReleaseNoteUri(releaseNoteUri); + return this; + } + + /** + * Get the endOfLifeDate property: The end of life date of the gallery Script Definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @return the endOfLifeDate value. + */ + public OffsetDateTime endOfLifeDate() { + return this.innerProperties() == null ? null : this.innerProperties().endOfLifeDate(); + } + + /** + * Set the endOfLifeDate property: The end of life date of the gallery Script Definition. This property can be used + * for decommissioning purposes. This property is updatable. + * + * @param endOfLifeDate the endOfLifeDate value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * Get the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. Possible values are: **Windows,** **Linux.**. + * + * @return the supportedOSType value. + */ + public OperatingSystemTypes supportedOSType() { + return this.innerProperties() == null ? null : this.innerProperties().supportedOSType(); + } + + /** + * Set the supportedOSType property: This property allows you to specify the supported type of the OS that + * application is built for. Possible values are: **Windows,** **Linux.**. + * + * @param supportedOSType the supportedOSType value to set. + * @return the GalleryScriptUpdate object itself. + */ + public GalleryScriptUpdate withSupportedOSType(OperatingSystemTypes supportedOSType) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptProperties(); + } + this.innerProperties().withSupportedOSType(supportedOSType); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryScriptUpdate. + */ + public static GalleryScriptUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptUpdate deserializedGalleryScriptUpdate = new GalleryScriptUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGalleryScriptUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGalleryScriptUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGalleryScriptUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryScriptUpdate.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGalleryScriptUpdate.innerProperties = GalleryScriptProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptUpdate; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionList.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionList.java new file mode 100644 index 000000000000..9e8b6eea3611 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionList.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * Paged collection of GalleryScriptVersion items. + */ +@Fluent +public final class GalleryScriptVersionList implements JsonSerializable { + /* + * The GalleryScriptVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GalleryScriptVersionList class. + */ + public GalleryScriptVersionList() { + } + + /** + * Get the value property: The GalleryScriptVersion items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The GalleryScriptVersion items on this page. + * + * @param value the value value to set. + * @return the GalleryScriptVersionList object itself. + */ + public GalleryScriptVersionList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + 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 GalleryScriptVersionList object itself. + */ + public GalleryScriptVersionList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model GalleryScriptVersionList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptVersionList.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(); + } + + /** + * Reads an instance of GalleryScriptVersionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionList 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 GalleryScriptVersionList. + */ + public static GalleryScriptVersionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionList deserializedGalleryScriptVersionList = new GalleryScriptVersionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GalleryScriptVersionInner.fromJson(reader1)); + deserializedGalleryScriptVersionList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGalleryScriptVersionList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionList; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionPublishingProfile.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionPublishingProfile.java new file mode 100644 index 000000000000..1ab20ea9a28c --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionPublishingProfile.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The publishing profile of a gallery image version. + */ +@Fluent +public final class GalleryScriptVersionPublishingProfile extends GalleryArtifactPublishingProfileBase { + /* + * The source script from which the Script Version is going to be created. + */ + private ScriptSource source; + + /* + * The timestamp for when the gallery image version is published. + */ + private OffsetDateTime publishedDate; + + /** + * Creates an instance of GalleryScriptVersionPublishingProfile class. + */ + public GalleryScriptVersionPublishingProfile() { + } + + /** + * Get the source property: The source script from which the Script Version is going to be created. + * + * @return the source value. + */ + public ScriptSource source() { + return this.source; + } + + /** + * Set the source property: The source script from which the Script Version is going to be created. + * + * @param source the source value to set. + * @return the GalleryScriptVersionPublishingProfile object itself. + */ + public GalleryScriptVersionPublishingProfile withSource(ScriptSource source) { + this.source = source; + return this; + } + + /** + * Get the publishedDate property: The timestamp for when the gallery image version is published. + * + * @return the publishedDate value. + */ + @Override + public OffsetDateTime publishedDate() { + return this.publishedDate; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withTargetRegions(List targetRegions) { + super.withTargetRegions(targetRegions); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withReplicaCount(Integer replicaCount) { + super.withReplicaCount(replicaCount); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withExcludeFromLatest(Boolean excludeFromLatest) { + super.withExcludeFromLatest(excludeFromLatest); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withEndOfLifeDate(OffsetDateTime endOfLifeDate) { + super.withEndOfLifeDate(endOfLifeDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withStorageAccountType(StorageAccountType storageAccountType) { + super.withStorageAccountType(storageAccountType); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile withReplicationMode(ReplicationMode replicationMode) { + super.withReplicationMode(replicationMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile + withTargetExtendedLocations(List targetExtendedLocations) { + super.withTargetExtendedLocations(targetExtendedLocations); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionPublishingProfile + withStorageAccountStrategy(StorageAccountStrategy storageAccountStrategy) { + super.withStorageAccountStrategy(storageAccountStrategy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model GalleryScriptVersionPublishingProfile")); + } else { + source().validate(); + } + if (targetRegions() != null) { + targetRegions().forEach(e -> e.validate()); + } + if (targetExtendedLocations() != null) { + targetExtendedLocations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GalleryScriptVersionPublishingProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("targetRegions", targetRegions(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("replicaCount", replicaCount()); + jsonWriter.writeBooleanField("excludeFromLatest", excludeFromLatest()); + jsonWriter.writeStringField("endOfLifeDate", + endOfLifeDate() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endOfLifeDate())); + jsonWriter.writeStringField("storageAccountType", + storageAccountType() == null ? null : storageAccountType().toString()); + jsonWriter.writeStringField("replicationMode", replicationMode() == null ? null : replicationMode().toString()); + jsonWriter.writeArrayField("targetExtendedLocations", targetExtendedLocations(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("storageAccountStrategy", + storageAccountStrategy() == null ? null : storageAccountStrategy().toString()); + jsonWriter.writeJsonField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptVersionPublishingProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionPublishingProfile 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 GalleryScriptVersionPublishingProfile. + */ + public static GalleryScriptVersionPublishingProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionPublishingProfile deserializedGalleryScriptVersionPublishingProfile + = new GalleryScriptVersionPublishingProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetRegions".equals(fieldName)) { + List targetRegions = reader.readArray(reader1 -> TargetRegion.fromJson(reader1)); + deserializedGalleryScriptVersionPublishingProfile.withTargetRegions(targetRegions); + } else if ("replicaCount".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile + .withReplicaCount(reader.getNullable(JsonReader::getInt)); + } else if ("excludeFromLatest".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile + .withExcludeFromLatest(reader.getNullable(JsonReader::getBoolean)); + } else if ("publishedDate".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile.publishedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endOfLifeDate".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile.withEndOfLifeDate(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("storageAccountType".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile + .withStorageAccountType(StorageAccountType.fromString(reader.getString())); + } else if ("replicationMode".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile + .withReplicationMode(ReplicationMode.fromString(reader.getString())); + } else if ("targetExtendedLocations".equals(fieldName)) { + List targetExtendedLocations + = reader.readArray(reader1 -> GalleryTargetExtendedLocation.fromJson(reader1)); + deserializedGalleryScriptVersionPublishingProfile + .withTargetExtendedLocations(targetExtendedLocations); + } else if ("storageAccountStrategy".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile + .withStorageAccountStrategy(StorageAccountStrategy.fromString(reader.getString())); + } else if ("source".equals(fieldName)) { + deserializedGalleryScriptVersionPublishingProfile.source = ScriptSource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionPublishingProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionSafetyProfile.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionSafetyProfile.java new file mode 100644 index 000000000000..8796d9dc7196 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionSafetyProfile.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The safety profile of the Gallery Script Version. + */ +@Fluent +public final class GalleryScriptVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + /** + * Creates an instance of GalleryScriptVersionSafetyProfile class. + */ + public GalleryScriptVersionSafetyProfile() { + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionSafetyProfile + withAllowDeletionOfReplicatedLocations(Boolean allowDeletionOfReplicatedLocations) { + super.withAllowDeletionOfReplicatedLocations(allowDeletionOfReplicatedLocations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowDeletionOfReplicatedLocations", allowDeletionOfReplicatedLocations()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptVersionSafetyProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionSafetyProfile if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryScriptVersionSafetyProfile. + */ + public static GalleryScriptVersionSafetyProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionSafetyProfile deserializedGalleryScriptVersionSafetyProfile + = new GalleryScriptVersionSafetyProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowDeletionOfReplicatedLocations".equals(fieldName)) { + deserializedGalleryScriptVersionSafetyProfile + .withAllowDeletionOfReplicatedLocations(reader.getNullable(JsonReader::getBoolean)); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionSafetyProfile; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionUpdate.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionUpdate.java new file mode 100644 index 000000000000..ca7a3f4811a3 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GalleryScriptVersionUpdate.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Specifies information about the gallery Script Version that you want to update. + */ +@Fluent +public final class GalleryScriptVersionUpdate extends UpdateResourceDefinition { + /* + * Gallery script version properties to update. + */ + private GalleryScriptVersionProperties innerProperties; + + /* + * Resource type + */ + private String type; + + /* + * Resource name + */ + private String name; + + /* + * Resource Id + */ + private String id; + + /** + * Creates an instance of GalleryScriptVersionUpdate class. + */ + public GalleryScriptVersionUpdate() { + } + + /** + * Get the innerProperties property: Gallery script version properties to update. + * + * @return the innerProperties value. + */ + private GalleryScriptVersionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: Resource name. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GalleryScriptVersionUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publishingProfile property: The publishing profile of a gallery image version. + * + * @return the publishingProfile value. + */ + public GalleryScriptVersionPublishingProfile publishingProfile() { + return this.innerProperties() == null ? null : this.innerProperties().publishingProfile(); + } + + /** + * Set the publishingProfile property: The publishing profile of a gallery image version. + * + * @param publishingProfile the publishingProfile value to set. + * @return the GalleryScriptVersionUpdate object itself. + */ + public GalleryScriptVersionUpdate withPublishingProfile(GalleryScriptVersionPublishingProfile publishingProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptVersionProperties(); + } + this.innerProperties().withPublishingProfile(publishingProfile); + return this; + } + + /** + * Get the safetyProfile property: The safety profile of the Gallery Script Version. + * + * @return the safetyProfile value. + */ + public GalleryScriptVersionSafetyProfile safetyProfile() { + return this.innerProperties() == null ? null : this.innerProperties().safetyProfile(); + } + + /** + * Set the safetyProfile property: The safety profile of the Gallery Script Version. + * + * @param safetyProfile the safetyProfile value to set. + * @return the GalleryScriptVersionUpdate object itself. + */ + public GalleryScriptVersionUpdate withSafetyProfile(GalleryScriptVersionSafetyProfile safetyProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new GalleryScriptVersionProperties(); + } + this.innerProperties().withSafetyProfile(safetyProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public GalleryProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the replicationStatus property: This is the replication status of the gallery image version. + * + * @return the replicationStatus value. + */ + public ReplicationStatus replicationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().replicationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GalleryScriptVersionUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GalleryScriptVersionUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GalleryScriptVersionUpdate. + */ + public static GalleryScriptVersionUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GalleryScriptVersionUpdate deserializedGalleryScriptVersionUpdate = new GalleryScriptVersionUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGalleryScriptVersionUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGalleryScriptVersionUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGalleryScriptVersionUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGalleryScriptVersionUpdate.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGalleryScriptVersionUpdate.innerProperties + = GalleryScriptVersionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGalleryScriptVersionUpdate; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GenericGalleryParameter.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GenericGalleryParameter.java new file mode 100644 index 000000000000..f26338ea48fc --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/GenericGalleryParameter.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The definition of a generic gallery parameter. + */ +@Fluent +public class GenericGalleryParameter implements JsonSerializable { + /* + * The name of the parameter. + */ + private String name; + + /* + * Indicates whether this parameter must be passed. + */ + private Boolean required; + + /* + * The default value of the parameter, only applies to string types. + */ + private String defaultValue; + + /* + * A description to help users understand what this parameter means + */ + private String description; + + /** + * Creates an instance of GenericGalleryParameter class. + */ + public GenericGalleryParameter() { + } + + /** + * Get the name property: The name of the parameter. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the parameter. + * + * @param name the name value to set. + * @return the GenericGalleryParameter object itself. + */ + public GenericGalleryParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the required property: Indicates whether this parameter must be passed. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: Indicates whether this parameter must be passed. + * + * @param required the required value to set. + * @return the GenericGalleryParameter object itself. + */ + public GenericGalleryParameter withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Get the defaultValue property: The default value of the parameter, only applies to string types. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: The default value of the parameter, only applies to string types. + * + * @param defaultValue the defaultValue value to set. + * @return the GenericGalleryParameter object itself. + */ + public GenericGalleryParameter withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the description property: A description to help users understand what this parameter means. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description to help users understand what this parameter means. + * + * @param description the description value to set. + * @return the GenericGalleryParameter object itself. + */ + public GenericGalleryParameter withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model GenericGalleryParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenericGalleryParameter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("required", this.required); + jsonWriter.writeStringField("defaultValue", this.defaultValue); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenericGalleryParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenericGalleryParameter 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 GenericGalleryParameter. + */ + public static GenericGalleryParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenericGalleryParameter deserializedGenericGalleryParameter = new GenericGalleryParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedGenericGalleryParameter.name = reader.getString(); + } else if ("required".equals(fieldName)) { + deserializedGenericGalleryParameter.required = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultValue".equals(fieldName)) { + deserializedGenericGalleryParameter.defaultValue = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedGenericGalleryParameter.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenericGalleryParameter; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java index ed1d058e4325..597e32585d19 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/OperatingSystemTypes.java @@ -5,8 +5,7 @@ package com.azure.resourcemanager.compute.models; /** - * This property allows you to specify the supported type of the OS that application is built for. Possible values are: - * **Windows,** **Linux.**. + * The Operating System type. */ public enum OperatingSystemTypes { /** diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScriptSource.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScriptSource.java new file mode 100644 index 000000000000..a47b33b9460b --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/ScriptSource.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The source script from which the Script Version is going to be created. + */ +@Fluent +public final class ScriptSource implements JsonSerializable { + /* + * Required. The link of the source script, it must be a readable storage blob with SAS URI or publicly accessible + * URI or managed identity enabled. + */ + private String scriptLink; + + /* + * Optional. Any input parameters that needs to passed to the script and are accessed within the script for its + * execution. + */ + private List parameters; + + /** + * Creates an instance of ScriptSource class. + */ + public ScriptSource() { + } + + /** + * Get the scriptLink property: Required. The link of the source script, it must be a readable storage blob with SAS + * URI or publicly accessible URI or managed identity enabled. + * + * @return the scriptLink value. + */ + public String scriptLink() { + return this.scriptLink; + } + + /** + * Set the scriptLink property: Required. The link of the source script, it must be a readable storage blob with SAS + * URI or publicly accessible URI or managed identity enabled. + * + * @param scriptLink the scriptLink value to set. + * @return the ScriptSource object itself. + */ + public ScriptSource withScriptLink(String scriptLink) { + this.scriptLink = scriptLink; + return this; + } + + /** + * Get the parameters property: Optional. Any input parameters that needs to passed to the script and are accessed + * within the script for its execution. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Optional. Any input parameters that needs to passed to the script and are accessed + * within the script for its execution. + * + * @param parameters the parameters value to set. + * @return the ScriptSource object itself. + */ + public ScriptSource withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scriptLink() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property scriptLink in model ScriptSource")); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scriptLink", this.scriptLink); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScriptSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScriptSource 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 ScriptSource. + */ + public static ScriptSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScriptSource deserializedScriptSource = new ScriptSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scriptLink".equals(fieldName)) { + deserializedScriptSource.scriptLink = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> GalleryScriptParameter.fromJson(reader1)); + deserializedScriptSource.parameters = parameters; + } else { + reader.skipChildren(); + } + } + + return deserializedScriptSource; + }); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountStrategy.java b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountStrategy.java new file mode 100644 index 000000000000..23cc60cd7635 --- /dev/null +++ b/sdk/compute/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/StorageAccountStrategy.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the strategy to be used when selecting the storage account type. Cannot be specified along with + * storageAccountType, but can be overridden per region by specifying targetRegions[].storageAccountType. This property + * is not updatable. + */ +public final class StorageAccountStrategy extends ExpandableStringEnum { + /** + * Static value PreferStandard_ZRS for StorageAccountStrategy. + */ + public static final StorageAccountStrategy PREFER_STANDARD_ZRS = fromString("PreferStandard_ZRS"); + + /** + * Static value DefaultStandard_LRS for StorageAccountStrategy. + */ + public static final StorageAccountStrategy DEFAULT_STANDARD_LRS = fromString("DefaultStandard_LRS"); + + /** + * Creates a new instance of StorageAccountStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageAccountStrategy() { + } + + /** + * Creates or finds a StorageAccountStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountStrategy. + */ + public static StorageAccountStrategy fromString(String name) { + return fromString(name, StorageAccountStrategy.class); + } + + /** + * Gets known StorageAccountStrategy values. + * + * @return known StorageAccountStrategy values. + */ + public static Collection values() { + return values(StorageAccountStrategy.class); + } +} diff --git a/sdk/compute/azure-resourcemanager-compute/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute/proxy-config.json b/sdk/compute/azure-resourcemanager-compute/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute/proxy-config.json index dab362f94aee..29d1f26b6274 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute/proxy-config.json +++ b/sdk/compute/azure-resourcemanager-compute/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-compute/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.compute.implementation.AvailabilitySetsClientImpl$AvailabilitySetsService"],["com.azure.resourcemanager.compute.implementation.CapacityReservationGroupsClientImpl$CapacityReservationGroupsService"],["com.azure.resourcemanager.compute.implementation.CapacityReservationsClientImpl$CapacityReservationsService"],["com.azure.resourcemanager.compute.implementation.CloudServiceOperatingSystemsClientImpl$CloudServiceOperatingSystemsService"],["com.azure.resourcemanager.compute.implementation.CloudServiceRoleInstancesClientImpl$CloudServiceRoleInstancesService"],["com.azure.resourcemanager.compute.implementation.CloudServiceRolesClientImpl$CloudServiceRolesService"],["com.azure.resourcemanager.compute.implementation.CloudServicesClientImpl$CloudServicesService"],["com.azure.resourcemanager.compute.implementation.CloudServicesUpdateDomainsClientImpl$CloudServicesUpdateDomainsService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleriesClientImpl$CommunityGalleriesService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleryImageVersionsClientImpl$CommunityGalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleryImagesClientImpl$CommunityGalleryImagesService"],["com.azure.resourcemanager.compute.implementation.DedicatedHostGroupsClientImpl$DedicatedHostGroupsService"],["com.azure.resourcemanager.compute.implementation.DedicatedHostsClientImpl$DedicatedHostsService"],["com.azure.resourcemanager.compute.implementation.DiskAccessesClientImpl$DiskAccessesService"],["com.azure.resourcemanager.compute.implementation.DiskEncryptionSetsClientImpl$DiskEncryptionSetsService"],["com.azure.resourcemanager.compute.implementation.DiskRestorePointsClientImpl$DiskRestorePointsService"],["com.azure.resourcemanager.compute.implementation.DisksClientImpl$DisksService"],["com.azure.resourcemanager.compute.implementation.GalleriesClientImpl$GalleriesService"],["com.azure.resourcemanager.compute.implementation.GalleryApplicationVersionsClientImpl$GalleryApplicationVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryApplicationsClientImpl$GalleryApplicationsService"],["com.azure.resourcemanager.compute.implementation.GalleryImageVersionsClientImpl$GalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryImagesClientImpl$GalleryImagesService"],["com.azure.resourcemanager.compute.implementation.GalleryInVMAccessControlProfileVersionsClientImpl$GalleryInVMAccessControlProfileVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryInVMAccessControlProfilesClientImpl$GalleryInVMAccessControlProfilesService"],["com.azure.resourcemanager.compute.implementation.GallerySharingProfilesClientImpl$GallerySharingProfilesService"],["com.azure.resourcemanager.compute.implementation.ImagesClientImpl$ImagesService"],["com.azure.resourcemanager.compute.implementation.LogAnalyticsClientImpl$LogAnalyticsService"],["com.azure.resourcemanager.compute.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.compute.implementation.ProximityPlacementGroupsClientImpl$ProximityPlacementGroupsService"],["com.azure.resourcemanager.compute.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.compute.implementation.RestorePointCollectionsClientImpl$RestorePointCollectionsService"],["com.azure.resourcemanager.compute.implementation.RestorePointsClientImpl$RestorePointsService"],["com.azure.resourcemanager.compute.implementation.SharedGalleriesClientImpl$SharedGalleriesService"],["com.azure.resourcemanager.compute.implementation.SharedGalleryImageVersionsClientImpl$SharedGalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.SharedGalleryImagesClientImpl$SharedGalleryImagesService"],["com.azure.resourcemanager.compute.implementation.SnapshotsClientImpl$SnapshotsService"],["com.azure.resourcemanager.compute.implementation.SoftDeletedResourcesClientImpl$SoftDeletedResourcesService"],["com.azure.resourcemanager.compute.implementation.SshPublicKeysClientImpl$SshPublicKeysService"],["com.azure.resourcemanager.compute.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineExtensionImagesClientImpl$VirtualMachineExtensionImagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineExtensionsClientImpl$VirtualMachineExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineImagesClientImpl$VirtualMachineImagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineImagesEdgeZonesClientImpl$VirtualMachineImagesEdgeZonesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineRunCommandsClientImpl$VirtualMachineRunCommandsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetExtensionsClientImpl$VirtualMachineScaleSetExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetRollingUpgradesClientImpl$VirtualMachineScaleSetRollingUpgradesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMExtensionsClientImpl$VirtualMachineScaleSetVMExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMRunCommandsClientImpl$VirtualMachineScaleSetVMRunCommandsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMsClientImpl$VirtualMachineScaleSetVMsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetsClientImpl$VirtualMachineScaleSetsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineSizesClientImpl$VirtualMachineSizesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachinesClientImpl$VirtualMachinesService"]] \ No newline at end of file +[["com.azure.resourcemanager.compute.implementation.AvailabilitySetsClientImpl$AvailabilitySetsService"],["com.azure.resourcemanager.compute.implementation.CapacityReservationGroupsClientImpl$CapacityReservationGroupsService"],["com.azure.resourcemanager.compute.implementation.CapacityReservationsClientImpl$CapacityReservationsService"],["com.azure.resourcemanager.compute.implementation.CloudServiceOperatingSystemsClientImpl$CloudServiceOperatingSystemsService"],["com.azure.resourcemanager.compute.implementation.CloudServiceRoleInstancesClientImpl$CloudServiceRoleInstancesService"],["com.azure.resourcemanager.compute.implementation.CloudServiceRolesClientImpl$CloudServiceRolesService"],["com.azure.resourcemanager.compute.implementation.CloudServicesClientImpl$CloudServicesService"],["com.azure.resourcemanager.compute.implementation.CloudServicesUpdateDomainsClientImpl$CloudServicesUpdateDomainsService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleriesClientImpl$CommunityGalleriesService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleryImageVersionsClientImpl$CommunityGalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.CommunityGalleryImagesClientImpl$CommunityGalleryImagesService"],["com.azure.resourcemanager.compute.implementation.DedicatedHostGroupsClientImpl$DedicatedHostGroupsService"],["com.azure.resourcemanager.compute.implementation.DedicatedHostsClientImpl$DedicatedHostsService"],["com.azure.resourcemanager.compute.implementation.DiskAccessesClientImpl$DiskAccessesService"],["com.azure.resourcemanager.compute.implementation.DiskEncryptionSetsClientImpl$DiskEncryptionSetsService"],["com.azure.resourcemanager.compute.implementation.DiskRestorePointsClientImpl$DiskRestorePointsService"],["com.azure.resourcemanager.compute.implementation.DisksClientImpl$DisksService"],["com.azure.resourcemanager.compute.implementation.GalleriesClientImpl$GalleriesService"],["com.azure.resourcemanager.compute.implementation.GalleryApplicationVersionsClientImpl$GalleryApplicationVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryApplicationsClientImpl$GalleryApplicationsService"],["com.azure.resourcemanager.compute.implementation.GalleryImageVersionsClientImpl$GalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryImagesClientImpl$GalleryImagesService"],["com.azure.resourcemanager.compute.implementation.GalleryInVMAccessControlProfileVersionsClientImpl$GalleryInVMAccessControlProfileVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryInVMAccessControlProfilesClientImpl$GalleryInVMAccessControlProfilesService"],["com.azure.resourcemanager.compute.implementation.GalleryScriptVersionsClientImpl$GalleryScriptVersionsService"],["com.azure.resourcemanager.compute.implementation.GalleryScriptsClientImpl$GalleryScriptsService"],["com.azure.resourcemanager.compute.implementation.GallerySharingProfilesClientImpl$GallerySharingProfilesService"],["com.azure.resourcemanager.compute.implementation.ImagesClientImpl$ImagesService"],["com.azure.resourcemanager.compute.implementation.LogAnalyticsClientImpl$LogAnalyticsService"],["com.azure.resourcemanager.compute.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.compute.implementation.ProximityPlacementGroupsClientImpl$ProximityPlacementGroupsService"],["com.azure.resourcemanager.compute.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.compute.implementation.RestorePointCollectionsClientImpl$RestorePointCollectionsService"],["com.azure.resourcemanager.compute.implementation.RestorePointsClientImpl$RestorePointsService"],["com.azure.resourcemanager.compute.implementation.SharedGalleriesClientImpl$SharedGalleriesService"],["com.azure.resourcemanager.compute.implementation.SharedGalleryImageVersionsClientImpl$SharedGalleryImageVersionsService"],["com.azure.resourcemanager.compute.implementation.SharedGalleryImagesClientImpl$SharedGalleryImagesService"],["com.azure.resourcemanager.compute.implementation.SnapshotsClientImpl$SnapshotsService"],["com.azure.resourcemanager.compute.implementation.SoftDeletedResourcesClientImpl$SoftDeletedResourcesService"],["com.azure.resourcemanager.compute.implementation.SshPublicKeysClientImpl$SshPublicKeysService"],["com.azure.resourcemanager.compute.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineExtensionImagesClientImpl$VirtualMachineExtensionImagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineExtensionsClientImpl$VirtualMachineExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineImagesClientImpl$VirtualMachineImagesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineImagesEdgeZonesClientImpl$VirtualMachineImagesEdgeZonesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineRunCommandsClientImpl$VirtualMachineRunCommandsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetExtensionsClientImpl$VirtualMachineScaleSetExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetRollingUpgradesClientImpl$VirtualMachineScaleSetRollingUpgradesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMExtensionsClientImpl$VirtualMachineScaleSetVMExtensionsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMRunCommandsClientImpl$VirtualMachineScaleSetVMRunCommandsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetVMsClientImpl$VirtualMachineScaleSetVMsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineScaleSetsClientImpl$VirtualMachineScaleSetsService"],["com.azure.resourcemanager.compute.implementation.VirtualMachineSizesClientImpl$VirtualMachineSizesService"],["com.azure.resourcemanager.compute.implementation.VirtualMachinesClientImpl$VirtualMachinesService"]] \ No newline at end of file diff --git a/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java b/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java index 53179df9d359..3013abb24a17 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java +++ b/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/SharedGalleryImageTests.java @@ -222,6 +222,7 @@ public void canCreateUpdateGetDeleteGalleryImageVersion() { .withLocation(region) .withIdentifier("JavaSDKTeam", "JDK", "Jdk-9") .withGeneralizedLinux() + .withHyperVGeneration(HyperVGeneration.V1) .create(); // // Create a custom image to base the version on diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index 6ef93ae0e91f..69a2cfc8c354 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -27,7 +27,7 @@ "dir": "../compute/azure-resourcemanager-compute", "source": "specification/compute/resource-manager/readme.md", "package": "com.azure.resourcemanager.compute", - "args": "--tag=package-2025-04-01 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --remove-inner=StorageProfile --enable-sync-stack=false" + "args": "--tag=package-2025-03-03 --modelerfour.lenient-model-deduplication=true --rename-model=UserAssignedIdentitiesValue:VirtualMachineIdentityUserAssignedIdentities,VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue:VirtualMachineScaleSetIdentityUserAssignedIdentities --preserve-model=AvailabilitySetSkuTypes --remove-inner=StorageProfile --enable-sync-stack=false" }, "containerinstance": { "dir": "../containerinstance/azure-resourcemanager-containerinstance", diff --git a/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md index 286bf5209860..c615f27ebaa1 100644 --- a/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md @@ -10,6 +10,14 @@ ### Other Changes +### azure-resourcemanager-compute + +#### Dependency Updates + +- Updated `GalleryRP api-version` to `2025-03-03`. + +### Other Changes + ## 2.58.0 (2025-12-22) ### azure-resourcemanager-containerservice diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index 3978e068999e..b74b6e8f9468 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -102,7 +102,7 @@ com.azure.resourcemanager azure-resourcemanager-compute - 2.55.1 + 2.56.0 com.azure.resourcemanager diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java index 8cdd3e40f392..f69c535d06cf 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java @@ -10,7 +10,7 @@ public final class CommunityGalleriesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * communityGalleryExamples/CommunityGallery_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java index 202219d8f5ad..270878e77e1d 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java @@ -10,7 +10,7 @@ public final class CommunityGalleryImageVersionsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * communityGalleryExamples/CommunityGalleryImageVersion_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsListSamples.java index bcca3988f0b2..543ebd9f4c62 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsListSamples.java @@ -10,7 +10,7 @@ public final class CommunityGalleryImageVersionsListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * communityGalleryExamples/CommunityGalleryImageVersion_List.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java index 677088793d38..c9ad279aea00 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java @@ -10,7 +10,7 @@ public final class CommunityGalleryImagesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * communityGalleryExamples/CommunityGalleryImage_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesListSamples.java index 104c1e73007d..d011010238c1 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesListSamples.java @@ -10,7 +10,7 @@ public final class CommunityGalleryImagesListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * communityGalleryExamples/CommunityGalleryImage_List.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java index feb178d02a7d..2bf0446caabc 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java @@ -21,7 +21,7 @@ public final class GalleriesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * CommunityGallery_Create.json */ /** @@ -47,7 +47,7 @@ public static void createACommunityGallery(com.azure.resourcemanager.AzureResour /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Create_WithManagedIdentity.json */ /** @@ -71,7 +71,7 @@ public static void createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssigned /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Create_WithSharingProfile.json */ /** @@ -94,7 +94,7 @@ public static void createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssigned /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Create.json */ /** @@ -114,7 +114,7 @@ public static void createOrUpdateASimpleGallery(com.azure.resourcemanager.AzureR /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Create_SoftDeletionEnabled.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java index a46ac760732e..ac07cffa2424 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleriesDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java index d4b39bb1bb92..7a32dbfcd7a4 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java @@ -13,7 +13,7 @@ public final class GalleriesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * CommunityGallery_Get.json */ /** @@ -32,7 +32,7 @@ public static void getACommunityGallery(com.azure.resourcemanager.AzureResourceM /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Get_WithSelectPermissions.json */ /** @@ -51,7 +51,7 @@ public static void getAGalleryWithSelectPermissions(com.azure.resourcemanager.Az /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Get.json */ /** @@ -70,7 +70,7 @@ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager az /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Get_WithExpandSharingProfileGroups.json */ /** @@ -89,7 +89,7 @@ public static void getAGalleryWithExpandSharingProfileGroups(com.azure.resourcem /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Get_WithManagedIdentity.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java index 1362bf3ab2ca..23f496c7aad0 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class GalleriesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_ListByResourceGroup.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java index b03c483c26a2..bb812f3d2c3f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java @@ -10,7 +10,7 @@ public final class GalleriesListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_ListBySubscription.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java index 29e5b7b161b5..036890d06720 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java @@ -12,7 +12,7 @@ public final class GalleriesUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java index 6251a5396133..fa7d838e851f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java @@ -23,7 +23,7 @@ public final class GalleryApplicationVersionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_Create.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java index 480a122b0dc6..12eff8c389c0 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryApplicationVersionsDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java index f31fb8b68085..c5ce61045084 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java @@ -12,7 +12,7 @@ public final class GalleryApplicationVersionsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_Get.json */ /** @@ -31,7 +31,7 @@ public static void getAGalleryApplicationVersion(com.azure.resourcemanager.Azure /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_Get_WithReplicationStatus.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java index 6dbdb3319674..7b119b7b1336 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java @@ -10,7 +10,7 @@ public final class GalleryApplicationVersionsListByGalleryApplicationSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_ListByGalleryApplication.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java index ad5eb4cc46b5..85419908c034 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java @@ -20,7 +20,7 @@ public final class GalleryApplicationVersionsUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplicationVersion_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java index 9043dfe5ae8b..d91a84f0d436 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java @@ -17,7 +17,7 @@ public final class GalleryApplicationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplication_Create.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java index e70cf58a9913..c70c2b321972 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryApplicationsDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplication_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java index 068f41153cc4..17fe352c708f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java @@ -10,7 +10,7 @@ public final class GalleryApplicationsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplication_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java index 221e65a3168c..898a2c903558 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java @@ -10,7 +10,7 @@ public final class GalleryApplicationsListByGallerySamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplication_ListByGallery.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java index 521b641c7c3b..3ad469be44e5 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java @@ -17,7 +17,7 @@ public final class GalleryApplicationsUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryApplication_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java index 234127e96d7a..d21bfd63637a 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java @@ -20,6 +20,7 @@ import com.azure.resourcemanager.compute.models.ImageVersionSecurityProfile; import com.azure.resourcemanager.compute.models.OSDiskImageEncryption; import com.azure.resourcemanager.compute.models.ReplicationMode; +import com.azure.resourcemanager.compute.models.StorageAccountStrategy; import com.azure.resourcemanager.compute.models.StorageAccountType; import com.azure.resourcemanager.compute.models.TargetRegion; import com.azure.resourcemanager.compute.models.UefiKey; @@ -34,7 +35,39 @@ public final class GalleryImageVersionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ + * GalleryImageVersion_Create_WithStorageAccountStrategy.json + */ + /** + * Sample code: Create or update a simple Gallery Image Version with StorageAccountStrategy and regional + * StorageAccountType override. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void + createOrUpdateASimpleGalleryImageVersionWithStorageAccountStrategyAndRegionalStorageAccountTypeOverride( + com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryImageVersions() + .createOrUpdate("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", + new GalleryImageVersionInner().withLocation("West US") + .withPublishingProfile(new GalleryImageVersionPublishingProfile() + .withTargetRegions(Arrays.asList(new TargetRegion().withName("West US"), + new TargetRegion().withName("East US"), + new TargetRegion().withName("East US 2") + .withStorageAccountType(StorageAccountType.PREMIUM_LRS))) + .withStorageAccountStrategy(StorageAccountStrategy.PREFER_STANDARD_ZRS)) + .withStorageProfile(new GalleryImageVersionStorageProfile() + .withSource(new GalleryArtifactVersionFullSource().withVirtualMachineId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithShallowReplicationMode.json */ /** @@ -66,7 +99,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingShallowReplicati /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithVHD.json */ /** @@ -116,7 +149,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource( /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithVmAsSource.json */ /** @@ -169,7 +202,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource( /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithImageVersionAsSource.json */ /** @@ -222,7 +255,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSou /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithVHD_UefiSettings.json */ /** @@ -283,7 +316,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWith /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithSnapshotsAsSource.json */ /** @@ -335,7 +368,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASour /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithTargetExtendedLocations.json */ /** @@ -388,7 +421,7 @@ public static void createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLoc /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json */ /** @@ -441,7 +474,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingCommunityGallery /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create.json */ /** @@ -494,7 +527,7 @@ public static void createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSo /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Create_WithAdditionalReplicaSets.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java index 601327b8b620..42a7ea0db6e9 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryImageVersionsDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java index e3cbc8ff121d..4bc7bc2b4f68 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java @@ -12,7 +12,7 @@ public final class GalleryImageVersionsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get_WithVhdAsSource.json */ /** @@ -31,7 +31,7 @@ public static void getAGalleryImageVersionWithVhdAsASource(com.azure.resourceman /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json */ /** @@ -52,7 +52,7 @@ public static void getAGalleryImageVersionWithValidationProfileAndReplicationSta /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get.json */ /** @@ -71,7 +71,7 @@ public static void getAGalleryImageVersion(com.azure.resourcemanager.AzureResour /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get_WithReplicationStatus.json */ /** @@ -91,7 +91,7 @@ public static void getAGalleryImageVersion(com.azure.resourcemanager.AzureResour /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get_WithSnapshotsAsSource.json */ /** @@ -111,7 +111,7 @@ public static void getAGalleryImageVersion(com.azure.resourcemanager.AzureResour /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Get_WithValidationProfile.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java index 2323ffa60ecf..0b49a2a00631 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java @@ -10,7 +10,7 @@ public final class GalleryImageVersionsListByGalleryImageSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_ListByGalleryImage.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java index 128d5446cf2b..6e8ab02ff5ab 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java @@ -18,7 +18,7 @@ public final class GalleryImageVersionsUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Update.json */ /** @@ -46,7 +46,7 @@ public final class GalleryImageVersionsUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Update_RestoreSoftDeleted.json */ /** @@ -67,7 +67,7 @@ public static void restoreASoftDeletedGalleryImageVersion(com.azure.resourcemana /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImageVersion_Update_WithoutSourceId.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java index a0d7047a3496..57d6e8b3bbb1 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java @@ -16,7 +16,7 @@ public final class GalleryImagesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_Create.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java index 9a9fa436f929..439526720621 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryImagesDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java index 7ee02a823ad5..d57c76ca2bf6 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java @@ -10,7 +10,7 @@ public final class GalleryImagesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java index e629fb392d99..3ad1ffb78258 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java @@ -10,7 +10,7 @@ public final class GalleryImagesListByGallerySamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_ListByGallery.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java index d3b4a4082247..8c1f9318e537 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java @@ -18,7 +18,7 @@ public final class GalleryImagesUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_UpdateFeatures.json */ /** @@ -47,7 +47,7 @@ public static void updateAGalleryImageFeature(com.azure.resourcemanager.AzureRes /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GalleryImage_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsCreateOrUpdateSamples.java index dc09d2e69c0a..550283eed8de 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsCreateOrUpdateSamples.java @@ -23,7 +23,7 @@ public final class GalleryInVMAccessControlProfileVersionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsDeleteSamples.java index 9428e9a96dca..3df11d0a6a6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfileVersionsDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsGetSamples.java index d3baf13ab84a..5deeab7bfb95 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsGetSamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfileVersionsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSamples.java index c87cd340a1a5..42b7fdb8906e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsUpdateSamples.java index d31503e11995..e6168d65458a 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfileVersionsUpdateSamples.java @@ -16,7 +16,7 @@ public final class GalleryInVMAccessControlProfileVersionsUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesCreateOrUpdateSamples.java index 675078aa9549..20fc00849693 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class GalleryInVMAccessControlProfilesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesDeleteSamples.java index 733e2fa72617..17198c0e259d 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesDeleteSamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfilesDeleteSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesGetSamples.java index f7fcabd7b971..2514bd6711ee 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesGetSamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfilesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesListByGallerySamples.java index 776b96279545..1723c5627d12 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesListByGallerySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesListByGallerySamples.java @@ -10,7 +10,7 @@ public final class GalleryInVMAccessControlProfilesListByGallerySamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesUpdateSamples.java index 4c72185e7f41..1bf0fd553383 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryInVMAccessControlProfilesUpdateSamples.java @@ -15,7 +15,7 @@ public final class GalleryInVMAccessControlProfilesUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..88ee9646b365 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsCreateOrUpdateSamples.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionInner; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptVersionProperties; +import com.azure.resourcemanager.compute.models.GalleryScriptParameter; +import com.azure.resourcemanager.compute.models.GalleryScriptParameterType; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionPublishingProfile; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionSafetyProfile; +import com.azure.resourcemanager.compute.models.ScriptSource; +import com.azure.resourcemanager.compute.models.StorageAccountType; +import com.azure.resourcemanager.compute.models.TargetRegion; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for GalleryScriptVersions CreateOrUpdate. + */ +public final class GalleryScriptVersionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_Create.json + */ + /** + * Sample code: Create or update a simple gallery Script Version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void createOrUpdateASimpleGalleryScriptVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .createOrUpdate("myResourceGroup", "myGalleryName", "myGalleryScriptName", "1.0.0", + new GalleryScriptVersionInner().withLocation("West US") + .withProperties( + new GalleryScriptVersionProperties() + .withPublishingProfile(new GalleryScriptVersionPublishingProfile() + .withTargetRegions(Arrays.asList(new TargetRegion().withName("West US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(2) + .withEndOfLifeDate(OffsetDateTime.parse("2027-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource(new ScriptSource().withScriptLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}") + .withParameters(Arrays.asList( + new GalleryScriptParameter().withName("location") + .withRequired(true) + .withDefaultValue("westus") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("myGalleryScriptParameter1") + .withRequired(true) + .withDefaultValue("default value of parameter") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("myGalleryScriptParameter2") + .withRequired(false) + .withDefaultValue("default value of parameter") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("numberOfUnits") + .withRequired(true) + .withDefaultValue("3") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.INT) + .withMinValue("1") + .withMaxValue("5"), + new GalleryScriptParameter().withName("weightOfUnit") + .withRequired(true) + .withDefaultValue("0.6") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.DOUBLE) + .withMinValue("0.1") + .withMaxValue("2"), + new GalleryScriptParameter().withName("typeOfProduct") + .withRequired(false) + .withDefaultValue("Fruit") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.ENUM) + .withEnumValues(Arrays.asList("Fruit", "Vegetable", "Greens", "Nuts")))))) + .withSafetyProfile( + new GalleryScriptVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsDeleteSamples.java new file mode 100644 index 000000000000..48da9d43333a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsDeleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScriptVersions Delete. + */ +public final class GalleryScriptVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_Delete.json + */ + /** + * Sample code: Delete a gallery Script Version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void deleteAGalleryScriptVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .delete("myResourceGroupName", "myGalleryName", "myGalleryScriptName", "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsGetSamples.java new file mode 100644 index 000000000000..3d4fd30c6e51 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsGetSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScriptVersions Get. + */ +public final class GalleryScriptVersionsGetSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_Get.json + */ + /** + * Sample code: Get a gallery Script Version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAGalleryScriptVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .getWithResponse("myResourceGroupName", "myGalleryName", "myGalleryScriptName", "1.0.0", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_Get_WithReplicationStatus.json + */ + /** + * Sample code: Get a gallery Script Version with replication status. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void + getAGalleryScriptVersionWithReplicationStatus(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .getWithResponse("myResourceGroupName", "myGalleryName", "myGalleryScriptName", "1.0.0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsListByGalleryScriptSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsListByGalleryScriptSamples.java new file mode 100644 index 000000000000..dbd56e6dbc6c --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsListByGalleryScriptSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScriptVersions ListByGalleryScript. + */ +public final class GalleryScriptVersionsListByGalleryScriptSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_ListByGalleryScript.json + */ + /** + * Sample code: List gallery Script Versions in a gallery Script Definition. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void + listGalleryScriptVersionsInAGalleryScriptDefinition(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .listByGalleryScript("myResourceGroupName", "myGalleryName", "myGalleryScriptName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsUpdateSamples.java new file mode 100644 index 000000000000..470fe2e13613 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptVersionsUpdateSamples.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +import com.azure.resourcemanager.compute.models.GalleryScriptParameter; +import com.azure.resourcemanager.compute.models.GalleryScriptParameterType; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionPublishingProfile; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionSafetyProfile; +import com.azure.resourcemanager.compute.models.GalleryScriptVersionUpdate; +import com.azure.resourcemanager.compute.models.ScriptSource; +import com.azure.resourcemanager.compute.models.StorageAccountType; +import com.azure.resourcemanager.compute.models.TargetRegion; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for GalleryScriptVersions Update. + */ +public final class GalleryScriptVersionsUpdateSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScriptVersion_Update.json + */ + /** + * Sample code: Update a simple gallery Script Version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void updateASimpleGalleryScriptVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScriptVersions() + .update("myResourceGroupName", "myGalleryName", "myGalleryScriptName", "1.0.0", + new GalleryScriptVersionUpdate() + .withPublishingProfile(new GalleryScriptVersionPublishingProfile() + .withTargetRegions(Arrays.asList(new TargetRegion().withName("West US") + .withRegionalReplicaCount(2) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withExcludeFromLatest(false))) + .withReplicaCount(2) + .withEndOfLifeDate(OffsetDateTime.parse("2027-07-01T07:00:00Z")) + .withStorageAccountType(StorageAccountType.STANDARD_LRS) + .withSource(new ScriptSource() + .withScriptLink( + "https://mystorageaccount.blob.core.windows.net/mycontainer/myScript.ps1?{sasKey}") + .withParameters(Arrays.asList( + new GalleryScriptParameter().withName("location") + .withRequired(true) + .withDefaultValue("westus") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("myGalleryScriptParameter1") + .withRequired(true) + .withDefaultValue("default value of parameter") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("myGalleryScriptParameter2") + .withRequired(false) + .withDefaultValue("default value of parameter") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.STRING), + new GalleryScriptParameter().withName("numberOfUnits") + .withRequired(true) + .withDefaultValue("3") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.INT) + .withMinValue("1") + .withMaxValue("5"), + new GalleryScriptParameter().withName("weightOfUnit") + .withRequired(true) + .withDefaultValue("0.6") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.DOUBLE) + .withMinValue("0.1") + .withMaxValue("2"), + new GalleryScriptParameter().withName("typeOfProduct") + .withRequired(false) + .withDefaultValue("Fruit") + .withDescription("description of the parameter") + .withType(GalleryScriptParameterType.ENUM) + .withEnumValues(Arrays.asList("Fruit", "Vegetable", "Greens", "Nuts")))))) + .withSafetyProfile( + new GalleryScriptVersionSafetyProfile().withAllowDeletionOfReplicatedLocations(false)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c8b2ef574e09 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptInner; +import com.azure.resourcemanager.compute.fluent.models.GalleryScriptProperties; +import com.azure.resourcemanager.compute.models.OperatingSystemTypes; + +/** + * Samples for GalleryScripts CreateOrUpdate. + */ +public final class GalleryScriptsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScript_Create.json + */ + /** + * Sample code: Create or update a simple gallery Script. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void createOrUpdateASimpleGalleryScript(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScripts() + .createOrUpdate("myResourceGroup", "myGalleryName", "myGalleryScriptName", new GalleryScriptInner() + .withLocation("West US") + .withProperties(new GalleryScriptProperties().withDescription("This is the gallery script description.") + .withEula("This is the gallery script EULA.") + .withPrivacyStatementUri("{myPrivacyStatementUri}") + .withReleaseNoteUri("{myReleaseNoteUri}") + .withSupportedOSType(OperatingSystemTypes.WINDOWS)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsDeleteSamples.java new file mode 100644 index 000000000000..49ba43ccce08 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScripts Delete. + */ +public final class GalleryScriptsDeleteSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScript_Delete.json + */ + /** + * Sample code: Delete a gallery Script. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void deleteAGalleryScript(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScripts() + .delete("myResourceGroup", "myGalleryName", "myGalleryScriptName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsGetSamples.java new file mode 100644 index 000000000000..6f5421cc35c1 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScripts Get. + */ +public final class GalleryScriptsGetSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScript_Get.json + */ + /** + * Sample code: Get a gallery Script. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAGalleryScript(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScripts() + .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryScriptName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsListByGallerySamples.java new file mode 100644 index 000000000000..12a2526f1d07 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsListByGallerySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +/** + * Samples for GalleryScripts ListByGallery. + */ +public final class GalleryScriptsListByGallerySamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScript_ListByGallery.json + */ + /** + * Sample code: List gallery Scripts in a gallery. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listGalleryScriptsInAGallery(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScripts() + .listByGallery("myResourceGroup", "myGalleryName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsUpdateSamples.java new file mode 100644 index 000000000000..871a6823ce6b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryScriptsUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.compute.generated; + +import com.azure.resourcemanager.compute.models.GalleryScriptUpdate; +import com.azure.resourcemanager.compute.models.OperatingSystemTypes; + +/** + * Samples for GalleryScripts Update. + */ +public final class GalleryScriptsUpdateSamples { + /* + * x-ms-original-file: + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ + * galleryScriptExamples/GalleryScript_Update.json + */ + /** + * Sample code: Update a simple gallery Script. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void updateASimpleGalleryScript(com.azure.resourcemanager.AzureResourceManager azure) { + azure.virtualMachines() + .manager() + .serviceClient() + .getGalleryScripts() + .update("myResourceGroup", "myGalleryName", "myGalleryScriptName", + new GalleryScriptUpdate().withDescription("This is the gallery script description.") + .withEula("This is the gallery script EULA.") + .withPrivacyStatementUri("{myPrivacyStatementUri}") + .withReleaseNoteUri("{myReleaseNoteUri}") + .withSupportedOSType(OperatingSystemTypes.WINDOWS), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java index 72f3173a1c11..d50cb00ed017 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java @@ -16,7 +16,7 @@ public final class GallerySharingProfileUpdateSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_EnableCommunityGallery.json */ /** @@ -36,7 +36,7 @@ public static void shareAGalleryToCommunity(com.azure.resourcemanager.AzureResou /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_ResetSharingProfile.json */ /** @@ -56,7 +56,7 @@ public static void resetSharingProfileOfAGallery(com.azure.resourcemanager.Azure /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * Gallery_AddToSharingProfile.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java index 69f6c8a258d9..6c6500aaa662 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleriesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGallery_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java index 1d3014842108..b164ed8e8062 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleriesListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGallery_List.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java index b7701214adf7..490cc30cc8dd 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleryImageVersionsGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGalleryImageVersion_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java index 4bc0c2f3d422..6bcd80c1de07 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleryImageVersionsListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGalleryImageVersions_List.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java index 6032d81f2790..5d2dc1a08460 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleryImagesGetSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGalleryImage_Get.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java index 18a4a02a59af..5089dffd695e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java @@ -10,7 +10,7 @@ public final class SharedGalleryImagesListSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/ * sharedGalleryExamples/SharedGalleryImages_List.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SoftDeletedResourceListByArtifactNameSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SoftDeletedResourceListByArtifactNameSamples.java index 48f2b93f0147..b644d9f37654 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SoftDeletedResourceListByArtifactNameSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SoftDeletedResourceListByArtifactNameSamples.java @@ -10,7 +10,7 @@ public final class SoftDeletedResourceListByArtifactNameSamples { /* * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/ + * specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2025-03-03/examples/galleryExamples/ * GallerySoftDeletedResource_ListByArtifactName.json */ /** diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java index ab0d23cf3330..d986dc0a2518 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java @@ -58,7 +58,6 @@ import com.azure.resourcemanager.compute.models.SecurityPostureReference; import com.azure.resourcemanager.compute.models.SecurityProfile; import com.azure.resourcemanager.compute.models.SecurityTypes; -import com.azure.resourcemanager.compute.models.ServiceArtifactReference; import com.azure.resourcemanager.compute.models.Sku; import com.azure.resourcemanager.compute.models.SkuProfile; import com.azure.resourcemanager.compute.models.SkuProfileVMSize; @@ -1537,52 +1536,6 @@ public static void createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsing null, null, com.azure.core.util.Context.NONE); } - /* - * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ - * virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json - */ - /** - * Sample code: Create a scale set with Service Artifact Reference. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void - createAScaleSetWithServiceArtifactReference(com.azure.resourcemanager.AzureResourceManager azure) { - azure.virtualMachines() - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .createOrUpdate("myResourceGroup", "{vmss-name}", new VirtualMachineScaleSetInner() - .withLocation("eastus2euap") - .withSku(new Sku().withName("Standard_A1").withTier("Standard").withCapacity(3L)) - .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC) - .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) - .withVirtualMachineProfile(new VirtualMachineScaleSetVMProfile() - .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("{vmss-name}") - .withAdminUsername("{your-username}") - .withAdminPassword("fakeTokenPlaceholder")) - .withStorageProfile(new VirtualMachineScaleSetStorageProfile() - .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") - .withOffer("WindowsServer") - .withSku("2022-Datacenter") - .withVersion("latest")) - .withOsDisk(new VirtualMachineScaleSetOSDisk().withName("osDisk") - .withCaching(CachingTypes.READ_WRITE) - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))) - .withNetworkProfile(new VirtualMachineScaleSetNetworkProfile().withNetworkInterfaceConfigurations( - Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("{vmss-name}") - .withPrimary(true) - .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() - .withName("{vmss-name}") - .withSubnet(new ApiEntityReference().withId( - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) - .withEnableIpForwarding(true)))) - .withServiceArtifactReference(new ServiceArtifactReference().withId( - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"))) - .withOverprovision(true), null, null, com.azure.core.util.Context.NONE); - } - /* * x-ms-original-file: * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ @@ -2630,61 +2583,6 @@ public static void createAScaleSetWithSpotRestorePolicy(com.azure.resourcemanage null, null, com.azure.core.util.Context.NONE); } - /* - * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ - * virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM. - * json - */ - /** - * Sample code: Create a scale set with SecurityType as ConfidentialVM and NonPersistedTPM securityEncryptionType. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void createAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType( - com.azure.resourcemanager.AzureResourceManager azure) { - azure.virtualMachines() - .manager() - .serviceClient() - .getVirtualMachineScaleSets() - .createOrUpdate("myResourceGroup", "{vmss-name}", - new VirtualMachineScaleSetInner().withLocation("westus") - .withSku(new Sku().withName("Standard_DC2es_v5").withTier("Standard").withCapacity(3L)) - .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL)) - .withVirtualMachineProfile(new VirtualMachineScaleSetVMProfile() - .withOsProfile(new VirtualMachineScaleSetOSProfile().withComputerNamePrefix("{vmss-name}") - .withAdminUsername("{your-username}") - .withAdminPassword("fakeTokenPlaceholder")) - .withStorageProfile(new VirtualMachineScaleSetStorageProfile() - .withImageReference(new ImageReference().withPublisher("UbuntuServer") - .withOffer("2022-datacenter-cvm") - .withSku("linux-cvm") - .withVersion("17763.2183.2109130127")) - .withOsDisk( - new VirtualMachineScaleSetOSDisk().withCaching(CachingTypes.READ_ONLY) - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) - .withManagedDisk( - new VirtualMachineScaleSetManagedDiskParameters() - .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS) - .withSecurityProfile( - new VMDiskSecurityProfile().withSecurityEncryptionType( - SecurityEncryptionTypes.NON_PERSISTED_TPM))))) - .withNetworkProfile( - new VirtualMachineScaleSetNetworkProfile().withNetworkInterfaceConfigurations( - Arrays.asList(new VirtualMachineScaleSetNetworkConfiguration().withName("{vmss-name}") - .withPrimary(true) - .withIpConfigurations(Arrays.asList(new VirtualMachineScaleSetIpConfiguration() - .withName("{vmss-name}") - .withSubnet(new ApiEntityReference().withId( - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}")))) - .withEnableIpForwarding(true)))) - .withSecurityProfile(new SecurityProfile() - .withUefiSettings(new UefiSettings().withSecureBootEnabled(false).withVTpmEnabled(true)) - .withSecurityType(SecurityTypes.CONFIDENTIAL_VM))) - .withOverprovision(true), - null, null, com.azure.core.util.Context.NONE); - } - /* * x-ms-original-file: * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java index 4d36b78581d4..7d9b21ce9e14 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -79,8 +79,6 @@ import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; import com.azure.resourcemanager.compute.models.WindowsConfiguration; import com.azure.resourcemanager.compute.models.WindowsPatchAssessmentMode; -import com.azure.resourcemanager.compute.models.WindowsVMGuestPatchAutomaticByPlatformRebootSetting; -import com.azure.resourcemanager.compute.models.WindowsVMGuestPatchAutomaticByPlatformSettings; import com.azure.resourcemanager.compute.models.WindowsVMGuestPatchMode; import com.azure.resourcemanager.compute.models.ZonePlacementPolicyType; import java.util.Arrays; @@ -1303,54 +1301,6 @@ public static void createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault null, null, com.azure.core.util.Context.NONE); } - /* - * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ - * virtualMachineExamples/ - * VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json - */ - /** - * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set - * to true. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue( - com.azure.resourcemanager.AzureResourceManager azure) { - azure.virtualMachines() - .manager() - .serviceClient() - .getVirtualMachines() - .createOrUpdate("myResourceGroup", "myVM", - new VirtualMachineInner().withLocation("westus") - .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) - .withStorageProfile( - new StorageProfile() - .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") - .withOffer("WindowsServer") - .withSku("2016-Datacenter") - .withVersion("latest")) - .withOsDisk(new OSDisk().withName("myVMosdisk") - .withCaching(CachingTypes.READ_WRITE) - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) - .withManagedDisk(new ManagedDiskParameters() - .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) - .withOsProfile( - new OSProfile().withComputerName("myVM") - .withAdminUsername("{your-username}") - .withAdminPassword("fakeTokenPlaceholder") - .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) - .withEnableAutomaticUpdates(true) - .withPatchSettings(new PatchSettings() - .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) - .withEnableHotpatching(true)))) - .withNetworkProfile( - new NetworkProfile().withNetworkInterfaces(Arrays.asList(new NetworkInterfaceReference().withId( - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") - .withPrimary(true)))), - null, null, com.azure.core.util.Context.NONE); - } - /* * x-ms-original-file: * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ @@ -2317,56 +2267,6 @@ public static void createAVMWithAutomaticZonePlacement(com.azure.resourcemanager null, null, com.azure.core.util.Context.NONE); } - /* - * x-ms-original-file: - * specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2025-04-01/examples/ - * virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json - */ - /** - * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and - * AutomaticByPlatformSettings. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings( - com.azure.resourcemanager.AzureResourceManager azure) { - azure.virtualMachines() - .manager() - .serviceClient() - .getVirtualMachines() - .createOrUpdate("myResourceGroup", "myVM", - new VirtualMachineInner().withLocation("westus") - .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2)) - .withStorageProfile( - new StorageProfile() - .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") - .withOffer("WindowsServer") - .withSku("2016-Datacenter") - .withVersion("latest")) - .withOsDisk(new OSDisk().withName("myVMosdisk") - .withCaching(CachingTypes.READ_WRITE) - .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE) - .withManagedDisk(new ManagedDiskParameters() - .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS)))) - .withOsProfile(new OSProfile().withComputerName("myVM") - .withAdminUsername("{your-username}") - .withAdminPassword("fakeTokenPlaceholder") - .withWindowsConfiguration(new WindowsConfiguration().withProvisionVMAgent(true) - .withEnableAutomaticUpdates(true) - .withPatchSettings(new PatchSettings() - .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM) - .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM) - .withAutomaticByPlatformSettings( - new WindowsVMGuestPatchAutomaticByPlatformSettings() - .withRebootSetting(WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER) - .withBypassPlatformSafetyChecksOnUserSchedule(false))))) - .withNetworkProfile( - new NetworkProfile().withNetworkInterfaces(Arrays.asList(new NetworkInterfaceReference().withId( - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}") - .withPrimary(true)))), - null, null, com.azure.core.util.Context.NONE); - } - // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) {