From 574b1f997667997a8e1dcc12c2927bcb0c9f7336 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 27 May 2022 09:40:01 +0000 Subject: [PATCH] [Automation] Generate Fluent Lite from imagebuilder#package-2022-02 --- .../CHANGELOG.md | 38 +++- .../README.md | 4 +- .../SAMPLE.md | 26 +-- .../pom.xml | 2 +- .../imagebuilder/ImageBuilderManager.java | 58 ++++- .../imagebuilder/fluent/OperationsClient.java | 4 +- .../VirtualMachineImageTemplatesClient.java | 44 ++-- .../fluent/models/ImageTemplateInner.java | 103 +++++++-- .../models/ImageTemplateProperties.java | 123 ++++++++++- .../fluent/models/OperationInner.java | 10 +- .../fluent/models/RunOutputInner.java | 61 +----- .../fluent/models/RunOutputProperties.java | 4 - .../ImageBuilderClientBuilder.java | 34 ++- .../ImageBuilderClientImpl.java | 15 +- .../implementation/ImageTemplateImpl.java | 32 ++- .../implementation/OperationsClientImpl.java | 23 +- .../implementation/OperationsImpl.java | 3 +- ...irtualMachineImageTemplatesClientImpl.java | 206 ++++++++++-------- .../VirtualMachineImageTemplatesImpl.java | 19 +- .../imagebuilder/models/ImageTemplate.java | 97 +++++++-- .../models/ImageTemplateCustomizer.java | 4 - .../models/ImageTemplateDistributor.java | 7 +- .../models/ImageTemplateFileCustomizer.java | 4 - .../models/ImageTemplateIdentity.java | 4 - ...emplateIdentityUserAssignedIdentities.java | 4 - .../models/ImageTemplateInVMValidator.java | 59 +++++ .../models/ImageTemplateLastRunStatus.java | 4 - .../models/ImageTemplateListResult.java | 4 - .../ImageTemplateManagedImageDistributor.java | 9 +- .../ImageTemplateManagedImageSource.java | 12 +- .../ImageTemplatePlatformImageSource.java | 4 - .../ImageTemplatePowerShellCustomizer.java | 4 - .../ImageTemplatePowerShellValidator.java | 201 +++++++++++++++++ .../ImageTemplatePropertiesValidate.java | 121 ++++++++++ .../ImageTemplateRestartCustomizer.java | 4 - .../ImageTemplateSharedImageDistributor.java | 9 +- ...ImageTemplateSharedImageVersionSource.java | 7 +- .../models/ImageTemplateShellCustomizer.java | 4 - .../models/ImageTemplateShellValidator.java | 118 ++++++++++ .../models/ImageTemplateSource.java | 4 - .../models/ImageTemplateUpdateParameters.java | 4 - .../models/ImageTemplateVhdDistributor.java | 4 - .../models/ImageTemplateVmProfile.java | 31 ++- .../ImageTemplateWindowsUpdateCustomizer.java | 4 - .../imagebuilder/models/Operation.java | 2 +- .../imagebuilder/models/OperationDisplay.java | 4 - .../models/OperationListResult.java | 4 - .../imagebuilder/models/Operations.java | 4 +- .../models/PlatformImagePurchasePlan.java | 11 +- .../models/ProvisioningError.java | 4 - .../models/ProvisioningErrorCode.java | 18 +- .../imagebuilder/models/RunOutput.java | 4 +- .../models/RunOutputCollection.java | 4 - .../imagebuilder/models/RunSubState.java | 3 + .../models/SharedImageStorageAccountType.java | 6 +- .../models/VirtualMachineImageTemplates.java | 24 +- .../models/VirtualNetworkConfig.java | 18 +- .../generated/OperationsListSamples.java | 2 +- ...ualMachineImageTemplatesCancelSamples.java | 2 +- ...neImageTemplatesCreateOrUpdateSamples.java | 4 +- ...ualMachineImageTemplatesDeleteSamples.java | 2 +- ...ageTemplatesGetByResourceGroupSamples.java | 2 +- ...hineImageTemplatesGetRunOutputSamples.java | 2 +- ...geTemplatesListByResourceGroupSamples.java | 2 +- ...neImageTemplatesListRunOutputsSamples.java | 2 +- ...rtualMachineImageTemplatesListSamples.java | 2 +- ...irtualMachineImageTemplatesRunSamples.java | 2 +- ...ualMachineImageTemplatesUpdateSamples.java | 4 +- 68 files changed, 1195 insertions(+), 473 deletions(-) create mode 100644 sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateInVMValidator.java create mode 100644 sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellValidator.java create mode 100644 sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePropertiesValidate.java create mode 100644 sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellValidator.java diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md index 00f2e439fc1a..b4b94ab06447 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md @@ -1,14 +1,44 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2022-05-27) -### Features Added +- Azure Resource Manager ImageBuilder client library for Java. This package contains Microsoft Azure SDK for ImageBuilder Management SDK. Azure Virtual Machine Image Builder Client. Package tag package-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ImageTemplate` was modified + +* `systemData()` was removed + +### Features Added + +* `models.ImageTemplateShellValidator` was added + +* `models.ImageTemplateInVMValidator` was added + +* `models.ImageTemplatePropertiesValidate` was added + +* `models.ImageTemplatePowerShellValidator` was added + +#### `ImageBuilderManager` was modified + +* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added + +#### `ImageBuilderManager$Configurable` was modified + +* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added + +#### `models.ImageTemplate` was modified + +* `resourceGroupName()` was added +* `stagingResourceGroup()` was added +* `validation()` was added +* `exactStagingResourceGroup()` was added + +#### `models.ImageTemplate$Definition` was modified -### Other Changes +* `withStagingResourceGroup(java.lang.String)` was added +* `withValidation(models.ImageTemplatePropertiesValidate)` was added ## 1.0.0-beta.2 (2021-12-07) diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md index a6f6f91dee04..f4f104eee7b0 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ImageBuilder client library for Java. -This package contains Microsoft Azure SDK for ImageBuilder Management SDK. Azure Virtual Machine Image Builder Client. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ImageBuilder Management SDK. Azure Virtual Machine Image Builder Client. Package tag package-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-imagebuilder - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md index 42cd9ed0bdad..97064990e2eb 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md @@ -25,7 +25,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/OperationsList.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/OperationsList.json */ /** * Sample code: Retrieve operations list. @@ -46,7 +46,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates Cancel. */ public final class VirtualMachineImageTemplatesCancelSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CancelImageBuild.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CancelImageBuild.json */ /** * Sample code: Cancel the image build based on the imageTemplate. @@ -81,7 +81,7 @@ import java.util.Map; /** Samples for VirtualMachineImageTemplates CreateOrUpdate. */ public final class VirtualMachineImageTemplatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CreateImageTemplateLinux.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateLinux.json */ /** * Sample code: Create an Image Template for Linux. @@ -134,7 +134,7 @@ public final class VirtualMachineImageTemplatesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CreateImageTemplateWindows.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateWindows.json */ /** * Sample code: Create an Image Template for Windows. @@ -244,7 +244,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates Delete. */ public final class VirtualMachineImageTemplatesDeleteSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/DeleteImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/DeleteImageTemplate.json */ /** * Sample code: Delete an Image Template. @@ -265,7 +265,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates GetByResourceGroup. */ public final class VirtualMachineImageTemplatesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/GetImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetImageTemplate.json */ /** * Sample code: Retrieve an Image Template. @@ -288,7 +288,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates GetRunOutput. */ public final class VirtualMachineImageTemplatesGetRunOutputSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/GetRunOutput.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetRunOutput.json */ /** * Sample code: Retrieve single runOutput. @@ -311,7 +311,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates List. */ public final class VirtualMachineImageTemplatesListSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListImageTemplates.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplates.json */ /** * Sample code: List images by subscription. @@ -332,7 +332,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates ListByResourceGroup. */ public final class VirtualMachineImageTemplatesListByResourceGroupSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListImageTemplatesByRg.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplatesByRg.json */ /** * Sample code: List images by resource group. @@ -353,7 +353,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates ListRunOutputs. */ public final class VirtualMachineImageTemplatesListRunOutputsSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListRunOutputs.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListRunOutputs.json */ /** * Sample code: Retrieve a list of all outputs created by the last run of an Image Template. @@ -375,7 +375,7 @@ import com.azure.core.util.Context; /** Samples for VirtualMachineImageTemplates Run. */ public final class VirtualMachineImageTemplatesRunSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/RunImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/RunImageTemplate.json */ /** * Sample code: Create image(s) from existing imageTemplate. @@ -402,7 +402,7 @@ import java.util.Map; /** Samples for VirtualMachineImageTemplates Update. */ public final class VirtualMachineImageTemplatesUpdateSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/UpdateImageTemplateToRemoveIdentities.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateToRemoveIdentities.json */ /** * Sample code: Remove identities for an Image Template. @@ -420,7 +420,7 @@ public final class VirtualMachineImageTemplatesUpdateSamples { } /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/UpdateImageTemplateTags.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateTags.json */ /** * Sample code: Update the tags for an Image Template. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml index e4b04a3ba0b1..9c6a44c1e342 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for ImageBuilder Management - This package contains Microsoft Azure SDK for ImageBuilder Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Virtual Machine Image Builder Client. Package tag package-2021-10. + This package contains Microsoft Azure SDK for ImageBuilder Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Virtual Machine Image Builder Client. Package tag package-2022-02. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManager.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManager.java index 24f87e4840a7..a24552fe533f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManager.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -67,6 +69,19 @@ public static ImageBuilderManager authenticate(TokenCredential credential, Azure return configure().authenticate(credential, profile); } + /** + * Creates an instance of ImageBuilder service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ImageBuilder service API instance. + */ + public static ImageBuilderManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ImageBuilderManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create ImageBuilderManager with optional configuration. * @@ -78,13 +93,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -145,6 +161,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -152,9 +181,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -176,7 +207,7 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.imagebuilder") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.3"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -194,10 +225,15 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( @@ -228,7 +264,11 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile } } - /** @return Resource collection API of VirtualMachineImageTemplates. */ + /** + * Gets the resource collection API of VirtualMachineImageTemplates. It manages ImageTemplate. + * + * @return Resource collection API of VirtualMachineImageTemplates. + */ public VirtualMachineImageTemplates virtualMachineImageTemplates() { if (this.virtualMachineImageTemplates == null) { this.virtualMachineImageTemplates = @@ -237,7 +277,11 @@ public VirtualMachineImageTemplates virtualMachineImageTemplates() { return virtualMachineImageTemplates; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/OperationsClient.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/OperationsClient.java index 3d3f28dc0f86..021f83aaeca9 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/OperationsClient.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/VirtualMachineImageTemplatesClient.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/VirtualMachineImageTemplatesClient.java index ace1175b055f..03a310d3f57b 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/VirtualMachineImageTemplatesClient.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/VirtualMachineImageTemplatesClient.java @@ -22,7 +22,8 @@ public interface VirtualMachineImageTemplatesClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -34,7 +35,8 @@ public interface VirtualMachineImageTemplatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -46,7 +48,8 @@ public interface VirtualMachineImageTemplatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -59,7 +62,8 @@ public interface VirtualMachineImageTemplatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -73,7 +77,8 @@ public interface VirtualMachineImageTemplatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ImageTemplateInner> beginCreateOrUpdate( @@ -89,7 +94,8 @@ SyncPoller, ImageTemplateInner> beginCreateOrUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ImageTemplateInner> beginCreateOrUpdate( @@ -135,7 +141,8 @@ ImageTemplateInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ImageTemplateInner> beginUpdate( @@ -151,7 +158,8 @@ SyncPoller, ImageTemplateInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ImageTemplateInner> beginUpdate( @@ -210,7 +218,7 @@ ImageTemplateInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -224,7 +232,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName); @@ -238,7 +246,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName, Context context); @@ -276,7 +284,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRun(String resourceGroupName, String imageTemplateName); @@ -290,7 +298,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginRun(String resourceGroupName, String imageTemplateName, Context context); @@ -328,7 +336,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCancel(String resourceGroupName, String imageTemplateName); @@ -342,7 +350,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginCancel(String resourceGroupName, String imageTemplateName, Context context); @@ -380,7 +388,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName); @@ -394,7 +402,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName, Context context); @@ -423,7 +431,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getRunOutputWithResponse( diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateInner.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateInner.java index 6ae25b95a993..1bad2baa84ba 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateInner.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateInner.java @@ -6,17 +6,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateIdentity; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateLastRunStatus; +import com.azure.resourcemanager.imagebuilder.models.ImageTemplatePropertiesValidate; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateSource; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateVmProfile; import com.azure.resourcemanager.imagebuilder.models.ProvisioningError; import com.azure.resourcemanager.imagebuilder.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -24,8 +23,6 @@ /** Image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. */ @Fluent public final class ImageTemplateInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateInner.class); - /* * The properties of the image template */ @@ -38,12 +35,6 @@ public final class ImageTemplateInner extends Resource { @JsonProperty(value = "identity", required = true) private ImageTemplateIdentity identity; - /* - * Metadata pertaining to creation and last modification of the resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /** * Get the innerProperties property: The properties of the image template. * @@ -73,15 +64,6 @@ public ImageTemplateInner withIdentity(ImageTemplateIdentity identity) { return this; } - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - /** {@inheritDoc} */ @Override public ImageTemplateInner withLocation(String location) { @@ -144,6 +126,31 @@ public ImageTemplateInner withCustomize(List customize) return this; } + /** + * Get the validation property: Configuration options and list of validations to be performed on the resulting + * image. + * + * @return the validation value. + */ + public ImageTemplatePropertiesValidate validation() { + return this.innerProperties() == null ? null : this.innerProperties().validation(); + } + + /** + * Set the validation property: Configuration options and list of validations to be performed on the resulting + * image. + * + * @param validation the validation value to set. + * @return the ImageTemplateInner object itself. + */ + public ImageTemplateInner withValidation(ImageTemplatePropertiesValidate validation) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageTemplateProperties(); + } + this.innerProperties().withValidation(validation); + return this; + } + /** * Get the distribute property: The distribution targets where the image output needs to go to. * @@ -195,8 +202,8 @@ public ImageTemplateLastRunStatus lastRunStatus() { } /** - * Get the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Get the buildTimeoutInMinutes property: Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * * @return the buildTimeoutInMinutes value. */ @@ -205,8 +212,8 @@ public Integer buildTimeoutInMinutes() { } /** - * Set the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Set the buildTimeoutInMinutes property: Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * * @param buildTimeoutInMinutes the buildTimeoutInMinutes value to set. * @return the ImageTemplateInner object itself. @@ -242,6 +249,52 @@ public ImageTemplateInner withVmProfile(ImageTemplateVmProfile vmProfile) { return this; } + /** + * Get the stagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a resource group with a random name will + * be created. If the resource group specified in this field doesn't exist, it will be created with the same name. + * If the resource group specified exists, it must be empty and in the same region as the image template. The + * resource group created will be deleted during template deletion if this field is empty or the resource group + * specified doesn't exist, but if the resource group specified exists the resources created in the resource group + * will be deleted during template deletion and the resource group itself will remain. + * + * @return the stagingResourceGroup value. + */ + public String stagingResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().stagingResourceGroup(); + } + + /** + * Set the stagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a resource group with a random name will + * be created. If the resource group specified in this field doesn't exist, it will be created with the same name. + * If the resource group specified exists, it must be empty and in the same region as the image template. The + * resource group created will be deleted during template deletion if this field is empty or the resource group + * specified doesn't exist, but if the resource group specified exists the resources created in the resource group + * will be deleted during template deletion and the resource group itself will remain. + * + * @param stagingResourceGroup the stagingResourceGroup value to set. + * @return the ImageTemplateInner object itself. + */ + public ImageTemplateInner withStagingResourceGroup(String stagingResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ImageTemplateProperties(); + } + this.innerProperties().withStagingResourceGroup(stagingResourceGroup); + return this; + } + + /** + * Get the exactStagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. This read-only field differs from 'stagingResourceGroup' only if + * the value specified in the 'stagingResourceGroup' field is empty. + * + * @return the exactStagingResourceGroup value. + */ + public String exactStagingResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().exactStagingResourceGroup(); + } + /** * Validates the instance. * @@ -252,11 +305,13 @@ public void validate() { innerProperties().validate(); } if (identity() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property identity in model ImageTemplateInner")); } else { identity().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateInner.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateProperties.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateProperties.java index 9c4436f47b77..91830493194d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateProperties.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateProperties.java @@ -9,19 +9,17 @@ import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateLastRunStatus; +import com.azure.resourcemanager.imagebuilder.models.ImageTemplatePropertiesValidate; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateSource; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateVmProfile; import com.azure.resourcemanager.imagebuilder.models.ProvisioningError; import com.azure.resourcemanager.imagebuilder.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes the properties of an image template. */ @Fluent public final class ImageTemplateProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateProperties.class); - /* * Specifies the properties used to describe the source image. */ @@ -35,6 +33,13 @@ public final class ImageTemplateProperties { @JsonProperty(value = "customize") private List customize; + /* + * Configuration options and list of validations to be performed on the + * resulting image. + */ + @JsonProperty(value = "validate") + private ImageTemplatePropertiesValidate validation; + /* * The distribution targets where the image output needs to go to. */ @@ -60,8 +65,9 @@ public final class ImageTemplateProperties { private ImageTemplateLastRunStatus lastRunStatus; /* - * Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to + * use the default (4 hours). */ @JsonProperty(value = "buildTimeoutInMinutes") private Integer buildTimeoutInMinutes; @@ -72,6 +78,31 @@ public final class ImageTemplateProperties { @JsonProperty(value = "vmProfile") private ImageTemplateVmProfile vmProfile; + /* + * The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a + * resource group with a random name will be created. If the resource group + * specified in this field doesn't exist, it will be created with the same + * name. If the resource group specified exists, it must be empty and in + * the same region as the image template. The resource group created will + * be deleted during template deletion if this field is empty or the + * resource group specified doesn't exist, but if the resource group + * specified exists the resources created in the resource group will be + * deleted during template deletion and the resource group itself will + * remain. + */ + @JsonProperty(value = "stagingResourceGroup") + private String stagingResourceGroup; + + /* + * The staging resource group id in the same subscription as the image + * template that will be used to build the image. This read-only field + * differs from 'stagingResourceGroup' only if the value specified in the + * 'stagingResourceGroup' field is empty. + */ + @JsonProperty(value = "exactStagingResourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String exactStagingResourceGroup; + /** * Get the source property: Specifies the properties used to describe the source image. * @@ -114,6 +145,28 @@ public ImageTemplateProperties withCustomize(List custo return this; } + /** + * Get the validation property: Configuration options and list of validations to be performed on the resulting + * image. + * + * @return the validation value. + */ + public ImageTemplatePropertiesValidate validation() { + return this.validation; + } + + /** + * Set the validation property: Configuration options and list of validations to be performed on the resulting + * image. + * + * @param validation the validation value to set. + * @return the ImageTemplateProperties object itself. + */ + public ImageTemplateProperties withValidation(ImageTemplatePropertiesValidate validation) { + this.validation = validation; + return this; + } + /** * Get the distribute property: The distribution targets where the image output needs to go to. * @@ -162,8 +215,8 @@ public ImageTemplateLastRunStatus lastRunStatus() { } /** - * Get the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Get the buildTimeoutInMinutes property: Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * * @return the buildTimeoutInMinutes value. */ @@ -172,8 +225,8 @@ public Integer buildTimeoutInMinutes() { } /** - * Set the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Set the buildTimeoutInMinutes property: Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * * @param buildTimeoutInMinutes the buildTimeoutInMinutes value to set. * @return the ImageTemplateProperties object itself. @@ -203,6 +256,49 @@ public ImageTemplateProperties withVmProfile(ImageTemplateVmProfile vmProfile) { return this; } + /** + * Get the stagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a resource group with a random name will + * be created. If the resource group specified in this field doesn't exist, it will be created with the same name. + * If the resource group specified exists, it must be empty and in the same region as the image template. The + * resource group created will be deleted during template deletion if this field is empty or the resource group + * specified doesn't exist, but if the resource group specified exists the resources created in the resource group + * will be deleted during template deletion and the resource group itself will remain. + * + * @return the stagingResourceGroup value. + */ + public String stagingResourceGroup() { + return this.stagingResourceGroup; + } + + /** + * Set the stagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a resource group with a random name will + * be created. If the resource group specified in this field doesn't exist, it will be created with the same name. + * If the resource group specified exists, it must be empty and in the same region as the image template. The + * resource group created will be deleted during template deletion if this field is empty or the resource group + * specified doesn't exist, but if the resource group specified exists the resources created in the resource group + * will be deleted during template deletion and the resource group itself will remain. + * + * @param stagingResourceGroup the stagingResourceGroup value to set. + * @return the ImageTemplateProperties object itself. + */ + public ImageTemplateProperties withStagingResourceGroup(String stagingResourceGroup) { + this.stagingResourceGroup = stagingResourceGroup; + return this; + } + + /** + * Get the exactStagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. This read-only field differs from 'stagingResourceGroup' only if + * the value specified in the 'stagingResourceGroup' field is empty. + * + * @return the exactStagingResourceGroup value. + */ + public String exactStagingResourceGroup() { + return this.exactStagingResourceGroup; + } + /** * Validates the instance. * @@ -210,7 +306,7 @@ public ImageTemplateProperties withVmProfile(ImageTemplateVmProfile vmProfile) { */ public void validate() { if (source() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property source in model ImageTemplateProperties")); } else { @@ -219,8 +315,11 @@ public void validate() { if (customize() != null) { customize().forEach(e -> e.validate()); } + if (validation() != null) { + validation().validate(); + } if (distribute() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property distribute in model ImageTemplateProperties")); @@ -237,4 +336,6 @@ public void validate() { vmProfile().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateProperties.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/OperationInner.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/OperationInner.java index 13ece2445da0..2de6f1f08218 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/OperationInner.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/OperationInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.imagebuilder.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A REST API operation. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The operation name. This is of the format * {provider}/{resource}/{operation} @@ -35,7 +31,7 @@ public final class OperationInner { private String origin; /* - * Any object + * Properties of the operation. */ @JsonProperty(value = "properties") private Object properties; @@ -107,7 +103,7 @@ public OperationInner withOrigin(String origin) { } /** - * Get the properties property: Any object. + * Get the properties property: Properties of the operation. * * @return the properties value. */ @@ -116,7 +112,7 @@ public Object properties() { } /** - * Set the properties property: Any object. + * Set the properties property: Properties of the operation. * * @param properties the properties value to set. * @return the OperationInner object itself. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputInner.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputInner.java index bf9d034812cb..d223b646a971 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputInner.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputInner.java @@ -5,35 +5,19 @@ package com.azure.resourcemanager.imagebuilder.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.ProxyResource; import com.azure.resourcemanager.imagebuilder.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Represents an output that was created by running an image template. */ @Fluent -public final class RunOutputInner extends SubResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunOutputInner.class); - +public final class RunOutputInner extends ProxyResource { /* * The properties of the run output */ @JsonProperty(value = "properties") private RunOutputProperties innerProperties; - /* - * Resource name - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Resource type - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - /** * Get the innerProperties property: The properties of the run output. * @@ -43,42 +27,6 @@ private RunOutputProperties innerProperties() { return this.innerProperties; } - /** - * Get the name property: Resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Resource name. - * - * @param name the name value to set. - * @return the RunOutputInner object itself. - */ - public RunOutputInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** {@inheritDoc} */ - @Override - public RunOutputInner withId(String id) { - super.withId(id); - return this; - } - /** * Get the artifactId property: The resource id of the artifact. * @@ -143,10 +91,5 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (name() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model RunOutputInner")); - } } } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputProperties.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputProperties.java index 78c6ab075389..c3648ea34ab5 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputProperties.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/RunOutputProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.imagebuilder.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the properties of a run output. */ @Fluent public final class RunOutputProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunOutputProperties.class); - /* * The resource id of the artifact. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientBuilder.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientBuilder.java index 5187865e2291..d6f0148718ab 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientBuilder.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -70,34 +69,34 @@ public ImageBuilderClientBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the ImageBuilderClientBuilder. */ - public ImageBuilderClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public ImageBuilderClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the ImageBuilderClientBuilder. */ - public ImageBuilderClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public ImageBuilderClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -129,15 +128,12 @@ public ImageBuilderClientImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientImpl.java index 5a225b0b20a9..a8f9829611f0 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -30,15 +31,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the ImageBuilderClientImpl type. */ @ServiceClient(builder = ImageBuilderClientBuilder.class) public final class ImageBuilderClientImpl implements ImageBuilderClient { - private final ClientLogger logger = new ClientLogger(ImageBuilderClientImpl.class); - /** * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of * the URI for every service call. @@ -162,7 +160,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-10-01"; + this.apiVersion = "2022-02-14"; this.virtualMachineImageTemplates = new VirtualMachineImageTemplatesClientImpl(this); this.operations = new OperationsClientImpl(this); } @@ -183,10 +181,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -250,7 +245,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -309,4 +304,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageBuilderClientImpl.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageTemplateImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageTemplateImpl.java index 0391bc037b1b..bf00821358ba 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageTemplateImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageTemplateImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.imagebuilder.implementation; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.imagebuilder.fluent.models.ImageTemplateInner; import com.azure.resourcemanager.imagebuilder.models.ImageTemplate; @@ -13,6 +12,7 @@ import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateIdentity; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateLastRunStatus; +import com.azure.resourcemanager.imagebuilder.models.ImageTemplatePropertiesValidate; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateSource; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateUpdateParameters; import com.azure.resourcemanager.imagebuilder.models.ImageTemplateVmProfile; @@ -56,10 +56,6 @@ public ImageTemplateIdentity identity() { return this.innerModel().identity(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - public ImageTemplateSource source() { return this.innerModel().source(); } @@ -73,6 +69,10 @@ public List customize() { } } + public ImageTemplatePropertiesValidate validation() { + return this.innerModel().validation(); + } + public List distribute() { List inner = this.innerModel().distribute(); if (inner != null) { @@ -102,6 +102,14 @@ public ImageTemplateVmProfile vmProfile() { return this.innerModel().vmProfile(); } + public String stagingResourceGroup() { + return this.innerModel().stagingResourceGroup(); + } + + public String exactStagingResourceGroup() { + return this.innerModel().exactStagingResourceGroup(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -110,6 +118,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public ImageTemplateInner innerModel() { return this.innerObject; } @@ -260,6 +272,11 @@ public ImageTemplateImpl withCustomize(List customize) return this; } + public ImageTemplateImpl withValidation(ImageTemplatePropertiesValidate validation) { + this.innerModel().withValidation(validation); + return this; + } + public ImageTemplateImpl withDistribute(List distribute) { this.innerModel().withDistribute(distribute); return this; @@ -275,6 +292,11 @@ public ImageTemplateImpl withVmProfile(ImageTemplateVmProfile vmProfile) { return this; } + public ImageTemplateImpl withStagingResourceGroup(String stagingResourceGroup) { + this.innerModel().withStagingResourceGroup(stagingResourceGroup); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsClientImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsClientImpl.java index aa2162684c3d..70918a46dc35 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsClientImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.fluent.OperationsClient; import com.azure.resourcemanager.imagebuilder.fluent.models.OperationInner; import com.azure.resourcemanager.imagebuilder.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +161,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +174,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +188,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +202,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsImpl.java index 445cd9285eea..b726946320cd 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.imagebuilder.fluent.models.OperationInner; import com.azure.resourcemanager.imagebuilder.models.Operation; import com.azure.resourcemanager.imagebuilder.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesClientImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesClientImpl.java index cf8fe1500569..4b04e262f639 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesClientImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesClientImpl.java @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.imagebuilder.fluent.VirtualMachineImageTemplatesClient; @@ -46,8 +45,6 @@ /** An instance of this class provides access to all the operations defined in VirtualMachineImageTemplatesClient. */ public final class VirtualMachineImageTemplatesClientImpl implements VirtualMachineImageTemplatesClient { - private final ClientLogger logger = new ClientLogger(VirtualMachineImageTemplatesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final VirtualMachineImageTemplatesService service; @@ -258,7 +255,8 @@ Mono> listRunOutputsNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -304,7 +302,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -345,7 +344,8 @@ private Mono> listSinglePageAsync(Context cont * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -359,7 +359,8 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -372,7 +373,8 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -386,7 +388,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -400,7 +403,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -452,7 +456,8 @@ private Mono> listByResourceGroupSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -501,7 +506,8 @@ private Mono> listByResourceGroupSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -518,7 +524,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -534,7 +541,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -549,7 +557,8 @@ public PagedIterable listByResourceGroup(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -565,7 +574,8 @@ public PagedIterable listByResourceGroup(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -622,7 +632,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -675,7 +686,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link PollerFlux} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ImageTemplateInner> beginCreateOrUpdateAsync( @@ -702,7 +714,8 @@ private PollerFlux, ImageTemplateInner> beginCrea * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link PollerFlux} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ImageTemplateInner> beginCreateOrUpdateAsync( @@ -725,7 +738,8 @@ private PollerFlux, ImageTemplateInner> beginCrea * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageTemplateInner> beginCreateOrUpdate( @@ -743,7 +757,8 @@ public SyncPoller, ImageTemplateInner> beginCreat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageTemplateInner> beginCreateOrUpdate( @@ -760,7 +775,8 @@ public SyncPoller, ImageTemplateInner> beginCreat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -780,7 +796,8 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -834,7 +851,8 @@ public ImageTemplateInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -891,7 +909,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -944,7 +963,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link PollerFlux} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ImageTemplateInner> beginUpdateAsync( @@ -971,7 +991,8 @@ private PollerFlux, ImageTemplateInner> beginUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link PollerFlux} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ImageTemplateInner> beginUpdateAsync( @@ -994,7 +1015,8 @@ private PollerFlux, ImageTemplateInner> beginUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageTemplateInner> beginUpdate( @@ -1012,7 +1034,8 @@ public SyncPoller, ImageTemplateInner> beginUpdat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return the {@link SyncPoller} for polling of image template is an ARM resource managed by + * Microsoft.VirtualMachineImages provider. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ImageTemplateInner> beginUpdate( @@ -1029,7 +1052,8 @@ public SyncPoller, ImageTemplateInner> beginUpdat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1049,7 +1073,8 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider. + * @return image template is an ARM resource managed by Microsoft.VirtualMachineImages provider on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1102,7 +1127,8 @@ public ImageTemplateInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1152,7 +1178,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -1198,19 +1225,12 @@ private Mono> getByResourceGroupWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String imageTemplateName) { return getByResourceGroupWithResponseAsync(resourceGroupName, imageTemplateName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1237,7 +1257,7 @@ public ImageTemplateInner getByResourceGroup(String resourceGroupName, String im * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -1253,7 +1273,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1303,7 +1323,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1349,7 +1369,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageTemplateName) { @@ -1369,7 +1389,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( @@ -1389,7 +1409,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName) { @@ -1405,7 +1425,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( @@ -1421,7 +1441,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String imageTemplateName) { @@ -1439,7 +1459,7 @@ private Mono deleteAsync(String resourceGroupName, String imageTemplateNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String imageTemplateName, Context context) { @@ -1485,7 +1505,7 @@ public void delete(String resourceGroupName, String imageTemplateName, Context c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runWithResponseAsync(String resourceGroupName, String imageTemplateName) { @@ -1534,7 +1554,7 @@ private Mono>> runWithResponseAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> runWithResponseAsync( @@ -1580,7 +1600,7 @@ private Mono>> runWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRunAsync(String resourceGroupName, String imageTemplateName) { @@ -1600,7 +1620,7 @@ private PollerFlux, Void> beginRunAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRunAsync( @@ -1620,7 +1640,7 @@ private PollerFlux, Void> beginRunAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRun(String resourceGroupName, String imageTemplateName) { @@ -1636,7 +1656,7 @@ public SyncPoller, Void> beginRun(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRun( @@ -1652,7 +1672,7 @@ public SyncPoller, Void> beginRun( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono runAsync(String resourceGroupName, String imageTemplateName) { @@ -1670,7 +1690,7 @@ private Mono runAsync(String resourceGroupName, String imageTemplateName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono runAsync(String resourceGroupName, String imageTemplateName, Context context) { @@ -1716,7 +1736,7 @@ public void run(String resourceGroupName, String imageTemplateName, Context cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> cancelWithResponseAsync( @@ -1766,7 +1786,7 @@ private Mono>> cancelWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> cancelWithResponseAsync( @@ -1812,7 +1832,7 @@ private Mono>> cancelWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String imageTemplateName) { @@ -1832,7 +1852,7 @@ private PollerFlux, Void> beginCancelAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginCancelAsync( @@ -1852,7 +1872,7 @@ private PollerFlux, Void> beginCancelAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCancel(String resourceGroupName, String imageTemplateName) { @@ -1868,7 +1888,7 @@ public SyncPoller, Void> beginCancel(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginCancel( @@ -1884,7 +1904,7 @@ public SyncPoller, Void> beginCancel( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String imageTemplateName) { @@ -1902,7 +1922,7 @@ private Mono cancelAsync(String resourceGroupName, String imageTemplateNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync(String resourceGroupName, String imageTemplateName, Context context) { @@ -1948,7 +1968,8 @@ public void cancel(String resourceGroupName, String imageTemplateName, Context c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRunOutputsSinglePageAsync( @@ -2007,7 +2028,8 @@ private Mono> listRunOutputsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRunOutputsSinglePageAsync( @@ -2062,7 +2084,7 @@ private Mono> listRunOutputsSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listRunOutputsAsync(String resourceGroupName, String imageTemplateName) { @@ -2080,7 +2102,7 @@ private PagedFlux listRunOutputsAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listRunOutputsAsync( @@ -2098,7 +2120,7 @@ private PagedFlux listRunOutputsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName) { @@ -2114,7 +2136,7 @@ public PagedIterable listRunOutputs(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRunOutputs( @@ -2131,7 +2153,8 @@ public PagedIterable listRunOutputs( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRunOutputWithResponseAsync( @@ -2186,7 +2209,8 @@ private Mono> getRunOutputWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getRunOutputWithResponseAsync( @@ -2237,20 +2261,14 @@ private Mono> getRunOutputWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getRunOutputAsync( String resourceGroupName, String imageTemplateName, String runOutputName) { return getRunOutputWithResponseAsync(resourceGroupName, imageTemplateName, runOutputName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2279,7 +2297,7 @@ public RunOutputInner getRunOutput(String resourceGroupName, String imageTemplat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getRunOutputWithResponse( @@ -2294,7 +2312,8 @@ public Response getRunOutputWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List image templates operation. + * @return the result of List image templates operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2330,7 +2349,8 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List image templates operation. + * @return the result of List image templates operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2365,7 +2385,8 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List image templates operation. + * @return the result of List image templates operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2402,7 +2423,8 @@ private Mono> listByResourceGroupNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List image templates operation. + * @return the result of List image templates operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -2438,7 +2460,8 @@ private Mono> listByResourceGroupNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRunOutputsNextSinglePageAsync(String nextLink) { @@ -2474,7 +2497,8 @@ private Mono> listRunOutputsNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listRunOutputsNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesImpl.java index 8fc04c326977..94f22523fb2f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesImpl.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/VirtualMachineImageTemplatesImpl.java @@ -15,10 +15,9 @@ import com.azure.resourcemanager.imagebuilder.models.ImageTemplate; import com.azure.resourcemanager.imagebuilder.models.RunOutput; import com.azure.resourcemanager.imagebuilder.models.VirtualMachineImageTemplates; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class VirtualMachineImageTemplatesImpl implements VirtualMachineImageTemplates { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachineImageTemplatesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineImageTemplatesImpl.class); private final VirtualMachineImageTemplatesClient innerClient; @@ -138,7 +137,7 @@ public Response getRunOutputWithResponse( public ImageTemplate getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -146,7 +145,7 @@ public ImageTemplate getById(String id) { } String imageTemplateName = Utils.getValueFromIdByName(id, "imageTemplates"); if (imageTemplateName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -158,7 +157,7 @@ public ImageTemplate getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -166,7 +165,7 @@ public Response getByIdWithResponse(String id, Context context) { } String imageTemplateName = Utils.getValueFromIdByName(id, "imageTemplates"); if (imageTemplateName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -178,7 +177,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -186,7 +185,7 @@ public void deleteById(String id) { } String imageTemplateName = Utils.getValueFromIdByName(id, "imageTemplates"); if (imageTemplateName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -198,7 +197,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -206,7 +205,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String imageTemplateName = Utils.getValueFromIdByName(id, "imageTemplates"); if (imageTemplateName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplate.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplate.java index 291089ba4d00..947470d5a31b 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplate.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplate.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.management.Region; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.imagebuilder.fluent.models.ImageTemplateInner; import java.util.List; @@ -55,13 +54,6 @@ public interface ImageTemplate { */ ImageTemplateIdentity identity(); - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - /** * Gets the source property: Specifies the properties used to describe the source image. * @@ -77,6 +69,14 @@ public interface ImageTemplate { */ List customize(); + /** + * Gets the validation property: Configuration options and list of validations to be performed on the resulting + * image. + * + * @return the validation value. + */ + ImageTemplatePropertiesValidate validation(); + /** * Gets the distribute property: The distribution targets where the image output needs to go to. * @@ -106,8 +106,8 @@ public interface ImageTemplate { ImageTemplateLastRunStatus lastRunStatus(); /** - * Gets the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. Omit or - * specify 0 to use the default (4 hours). + * Gets the buildTimeoutInMinutes property: Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * * @return the buildTimeoutInMinutes value. */ @@ -120,6 +120,28 @@ public interface ImageTemplate { */ ImageTemplateVmProfile vmProfile(); + /** + * Gets the stagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. If this field is empty, a resource group with a random name will + * be created. If the resource group specified in this field doesn't exist, it will be created with the same name. + * If the resource group specified exists, it must be empty and in the same region as the image template. The + * resource group created will be deleted during template deletion if this field is empty or the resource group + * specified doesn't exist, but if the resource group specified exists the resources created in the resource group + * will be deleted during template deletion and the resource group itself will remain. + * + * @return the stagingResourceGroup value. + */ + String stagingResourceGroup(); + + /** + * Gets the exactStagingResourceGroup property: The staging resource group id in the same subscription as the image + * template that will be used to build the image. This read-only field differs from 'stagingResourceGroup' only if + * the value specified in the 'stagingResourceGroup' field is empty. + * + * @return the exactStagingResourceGroup value. + */ + String exactStagingResourceGroup(); + /** * Gets the region of the resource. * @@ -134,6 +156,13 @@ public interface ImageTemplate { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.imagebuilder.fluent.models.ImageTemplateInner object. * @@ -200,9 +229,11 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSource, DefinitionStages.WithCustomize, + DefinitionStages.WithValidation, DefinitionStages.WithDistribute, DefinitionStages.WithBuildTimeoutInMinutes, - DefinitionStages.WithVmProfile { + DefinitionStages.WithVmProfile, + DefinitionStages.WithStagingResourceGroup { /** * Executes the create request. * @@ -250,6 +281,17 @@ interface WithCustomize { */ WithCreate withCustomize(List customize); } + /** The stage of the ImageTemplate definition allowing to specify validation. */ + interface WithValidation { + /** + * Specifies the validation property: Configuration options and list of validations to be performed on the + * resulting image.. + * + * @param validation Configuration options and list of validations to be performed on the resulting image. + * @return the next definition stage. + */ + WithCreate withValidation(ImageTemplatePropertiesValidate validation); + } /** The stage of the ImageTemplate definition allowing to specify distribute. */ interface WithDistribute { /** @@ -263,11 +305,12 @@ interface WithDistribute { /** The stage of the ImageTemplate definition allowing to specify buildTimeoutInMinutes. */ interface WithBuildTimeoutInMinutes { /** - * Specifies the buildTimeoutInMinutes property: Maximum duration to wait while building the image template. - * Omit or specify 0 to use the default (4 hours).. + * Specifies the buildTimeoutInMinutes property: Maximum duration to wait while building the image template + * (includes all customizations, validations, and distributions). Omit or specify 0 to use the default (4 + * hours).. * - * @param buildTimeoutInMinutes Maximum duration to wait while building the image template. Omit or specify - * 0 to use the default (4 hours). + * @param buildTimeoutInMinutes Maximum duration to wait while building the image template (includes all + * customizations, validations, and distributions). Omit or specify 0 to use the default (4 hours). * @return the next definition stage. */ WithCreate withBuildTimeoutInMinutes(Integer buildTimeoutInMinutes); @@ -282,6 +325,30 @@ interface WithVmProfile { */ WithCreate withVmProfile(ImageTemplateVmProfile vmProfile); } + /** The stage of the ImageTemplate definition allowing to specify stagingResourceGroup. */ + interface WithStagingResourceGroup { + /** + * Specifies the stagingResourceGroup property: The staging resource group id in the same subscription as + * the image template that will be used to build the image. If this field is empty, a resource group with a + * random name will be created. If the resource group specified in this field doesn't exist, it will be + * created with the same name. If the resource group specified exists, it must be empty and in the same + * region as the image template. The resource group created will be deleted during template deletion if this + * field is empty or the resource group specified doesn't exist, but if the resource group specified exists + * the resources created in the resource group will be deleted during template deletion and the resource + * group itself will remain.. + * + * @param stagingResourceGroup The staging resource group id in the same subscription as the image template + * that will be used to build the image. If this field is empty, a resource group with a random name + * will be created. If the resource group specified in this field doesn't exist, it will be created with + * the same name. If the resource group specified exists, it must be empty and in the same region as the + * image template. The resource group created will be deleted during template deletion if this field is + * empty or the resource group specified doesn't exist, but if the resource group specified exists the + * resources created in the resource group will be deleted during template deletion and the resource + * group itself will remain. + * @return the next definition stage. + */ + WithCreate withStagingResourceGroup(String stagingResourceGroup); + } } /** * Begins update for the ImageTemplate resource. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateCustomizer.java index 105adfb37d01..5dc1fd935e50 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -28,8 +26,6 @@ }) @Fluent public class ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateCustomizer.class); - /* * Friendly Name to provide context on what this customization step does */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateDistributor.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateDistributor.java index d3b3286b3400..c350a71a957c 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateDistributor.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateDistributor.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -28,8 +27,6 @@ }) @Fluent public class ImageTemplateDistributor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateDistributor.class); - /* * The name to be used for the associated RunOutput. */ @@ -93,10 +90,12 @@ public ImageTemplateDistributor withArtifactTags(Map artifactTag */ public void validate() { if (runOutputName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property runOutputName in model ImageTemplateDistributor")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateDistributor.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateFileCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateFileCustomizer.java index d0579e773285..b918ff30b7bc 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateFileCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateFileCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("File") @Fluent public final class ImageTemplateFileCustomizer extends ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateFileCustomizer.class); - /* * The URI of the file to be uploaded for customizing the VM. It can be a * github link, SAS URI for Azure Storage, etc diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentity.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentity.java index 2e6e0fd9fa6d..b84ddf26538d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentity.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentity.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -14,8 +12,6 @@ /** Identity for the image template. */ @Fluent public class ImageTemplateIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateIdentity.class); - /* * The type of identity used for the image template. The type 'None' will * remove any identities from the image template. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentityUserAssignedIdentities.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentityUserAssignedIdentities.java index c69ffb68355a..0c675615d41d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentityUserAssignedIdentities.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateIdentityUserAssignedIdentities.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The ImageTemplateIdentityUserAssignedIdentities model. */ @Immutable public final class ImageTemplateIdentityUserAssignedIdentities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateIdentityUserAssignedIdentities.class); - /* * The principal id of user assigned identity. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateInVMValidator.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateInVMValidator.java new file mode 100644 index 000000000000..172b64747063 --- /dev/null +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateInVMValidator.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.imagebuilder.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes a unit of in-VM validation of image. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ImageTemplateInVMValidator.class) +@JsonTypeName("ImageTemplateInVMValidator") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Shell", value = ImageTemplateShellValidator.class), + @JsonSubTypes.Type(name = "PowerShell", value = ImageTemplatePowerShellValidator.class) +}) +@Fluent +public class ImageTemplateInVMValidator { + /* + * Friendly Name to provide context on what this validation step does + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Friendly Name to provide context on what this validation step does. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Friendly Name to provide context on what this validation step does. + * + * @param name the name value to set. + * @return the ImageTemplateInVMValidator object itself. + */ + public ImageTemplateInVMValidator withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateLastRunStatus.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateLastRunStatus.java index 22a3ab040564..55a9542f28c1 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateLastRunStatus.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateLastRunStatus.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Describes the latest status of running an image template. */ @Fluent public final class ImageTemplateLastRunStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateLastRunStatus.class); - /* * Start time of the last run (UTC) */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateListResult.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateListResult.java index ced8554b6a8e..55c2da37ef45 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateListResult.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.fluent.models.ImageTemplateInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The result of List image templates operation. */ @Fluent public final class ImageTemplateListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateListResult.class); - /* * An array of image templates */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageDistributor.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageDistributor.java index 71e04e31eddb..fc1a61e64002 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageDistributor.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageDistributor.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +16,6 @@ @JsonTypeName("ManagedImage") @Fluent public final class ImageTemplateManagedImageDistributor extends ImageTemplateDistributor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateManagedImageDistributor.class); - /* * Resource Id of the Managed Disk Image */ @@ -94,16 +91,18 @@ public ImageTemplateManagedImageDistributor withArtifactTags(Map public void validate() { super.validate(); if (imageId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property imageId in model ImageTemplateManagedImageDistributor")); } if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property location in model ImageTemplateManagedImageDistributor")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateManagedImageDistributor.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageSource.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageSource.java index 8a615ead6125..bab05729f8aa 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageSource.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateManagedImageSource.java @@ -6,18 +6,18 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Describes an image source that is a managed image in customer subscription. */ +/** + * Describes an image source that is a managed image in customer subscription. This image must reside in the same + * subscription and region as the Image Builder template. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("ManagedImage") @Fluent public final class ImageTemplateManagedImageSource extends ImageTemplateSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateManagedImageSource.class); - /* * ARM resource id of the managed image in customer subscription */ @@ -53,10 +53,12 @@ public ImageTemplateManagedImageSource withImageId(String imageId) { public void validate() { super.validate(); if (imageId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property imageId in model ImageTemplateManagedImageSource")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateManagedImageSource.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePlatformImageSource.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePlatformImageSource.java index dd55f652f0f3..5c6df9c1c74e 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePlatformImageSource.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePlatformImageSource.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -19,8 +17,6 @@ @JsonTypeName("PlatformImage") @Fluent public final class ImageTemplatePlatformImageSource extends ImageTemplateSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplatePlatformImageSource.class); - /* * Image Publisher in [Azure Gallery * Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages). diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellCustomizer.java index cb7f5e696920..eccc06ff2ab3 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,8 +18,6 @@ @JsonTypeName("PowerShell") @Fluent public final class ImageTemplatePowerShellCustomizer extends ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplatePowerShellCustomizer.class); - /* * URI of the PowerShell script to be run for customizing. It can be a * github link, SAS URI for Azure Storage, etc diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellValidator.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellValidator.java new file mode 100644 index 000000000000..bab9861135c9 --- /dev/null +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePowerShellValidator.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.imagebuilder.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell + * provisioner. Exactly one of 'scriptUri' or 'inline' can be specified. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("PowerShell") +@Fluent +public final class ImageTemplatePowerShellValidator extends ImageTemplateInVMValidator { + /* + * URI of the PowerShell script to be run for validation. It can be a + * github link, Azure Storage URI, etc + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /* + * SHA256 checksum of the power shell script provided in the scriptUri + * field above + */ + @JsonProperty(value = "sha256Checksum") + private String sha256Checksum; + + /* + * Array of PowerShell commands to execute + */ + @JsonProperty(value = "inline") + private List inline; + + /* + * If specified, the PowerShell script will be run with elevated privileges + */ + @JsonProperty(value = "runElevated") + private Boolean runElevated; + + /* + * If specified, the PowerShell script will be run with elevated privileges + * using the Local System user. Can only be true when the runElevated field + * above is set to true. + */ + @JsonProperty(value = "runAsSystem") + private Boolean runAsSystem; + + /* + * Valid exit codes for the PowerShell script. [Default: 0] + */ + @JsonProperty(value = "validExitCodes") + private List validExitCodes; + + /** + * Get the scriptUri property: URI of the PowerShell script to be run for validation. It can be a github link, Azure + * Storage URI, etc. + * + * @return the scriptUri value. + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set the scriptUri property: URI of the PowerShell script to be run for validation. It can be a github link, Azure + * Storage URI, etc. + * + * @param scriptUri the scriptUri value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withScriptUri(String scriptUri) { + this.scriptUri = scriptUri; + return this; + } + + /** + * Get the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above. + * + * @return the sha256Checksum value. + */ + public String sha256Checksum() { + return this.sha256Checksum; + } + + /** + * Set the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above. + * + * @param sha256Checksum the sha256Checksum value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withSha256Checksum(String sha256Checksum) { + this.sha256Checksum = sha256Checksum; + return this; + } + + /** + * Get the inline property: Array of PowerShell commands to execute. + * + * @return the inline value. + */ + public List inline() { + return this.inline; + } + + /** + * Set the inline property: Array of PowerShell commands to execute. + * + * @param inline the inline value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withInline(List inline) { + this.inline = inline; + return this; + } + + /** + * Get the runElevated property: If specified, the PowerShell script will be run with elevated privileges. + * + * @return the runElevated value. + */ + public Boolean runElevated() { + return this.runElevated; + } + + /** + * Set the runElevated property: If specified, the PowerShell script will be run with elevated privileges. + * + * @param runElevated the runElevated value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withRunElevated(Boolean runElevated) { + this.runElevated = runElevated; + return this; + } + + /** + * Get the runAsSystem property: If specified, the PowerShell script will be run with elevated privileges using the + * Local System user. Can only be true when the runElevated field above is set to true. + * + * @return the runAsSystem value. + */ + public Boolean runAsSystem() { + return this.runAsSystem; + } + + /** + * Set the runAsSystem property: If specified, the PowerShell script will be run with elevated privileges using the + * Local System user. Can only be true when the runElevated field above is set to true. + * + * @param runAsSystem the runAsSystem value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withRunAsSystem(Boolean runAsSystem) { + this.runAsSystem = runAsSystem; + return this; + } + + /** + * Get the validExitCodes property: Valid exit codes for the PowerShell script. [Default: 0]. + * + * @return the validExitCodes value. + */ + public List validExitCodes() { + return this.validExitCodes; + } + + /** + * Set the validExitCodes property: Valid exit codes for the PowerShell script. [Default: 0]. + * + * @param validExitCodes the validExitCodes value to set. + * @return the ImageTemplatePowerShellValidator object itself. + */ + public ImageTemplatePowerShellValidator withValidExitCodes(List validExitCodes) { + this.validExitCodes = validExitCodes; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageTemplatePowerShellValidator withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePropertiesValidate.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePropertiesValidate.java new file mode 100644 index 000000000000..1c13dadf701f --- /dev/null +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplatePropertiesValidate.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.imagebuilder.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configuration options and list of validations to be performed on the resulting image. */ +@Fluent +public final class ImageTemplatePropertiesValidate { + /* + * If validation fails and this field is set to false, output image(s) will + * not be distributed. This is the default behavior. If validation fails + * and this field is set to true, output image(s) will still be + * distributed. Please use this option with caution as it may result in bad + * images being distributed for use. In either case (true or false), the + * end to end image run will be reported as having failed in case of a + * validation failure. [Note: This field has no effect if validation + * succeeds.] + */ + @JsonProperty(value = "continueDistributeOnFailure") + private Boolean continueDistributeOnFailure; + + /* + * If this field is set to true, the image specified in the 'source' + * section will directly be validated. No separate build will be run to + * generate and then validate a customized image. + */ + @JsonProperty(value = "sourceValidationOnly") + private Boolean sourceValidationOnly; + + /* + * List of validations to be performed. + */ + @JsonProperty(value = "inVMValidations") + private List inVMValidations; + + /** + * Get the continueDistributeOnFailure property: If validation fails and this field is set to false, output image(s) + * will not be distributed. This is the default behavior. If validation fails and this field is set to true, output + * image(s) will still be distributed. Please use this option with caution as it may result in bad images being + * distributed for use. In either case (true or false), the end to end image run will be reported as having failed + * in case of a validation failure. [Note: This field has no effect if validation succeeds.]. + * + * @return the continueDistributeOnFailure value. + */ + public Boolean continueDistributeOnFailure() { + return this.continueDistributeOnFailure; + } + + /** + * Set the continueDistributeOnFailure property: If validation fails and this field is set to false, output image(s) + * will not be distributed. This is the default behavior. If validation fails and this field is set to true, output + * image(s) will still be distributed. Please use this option with caution as it may result in bad images being + * distributed for use. In either case (true or false), the end to end image run will be reported as having failed + * in case of a validation failure. [Note: This field has no effect if validation succeeds.]. + * + * @param continueDistributeOnFailure the continueDistributeOnFailure value to set. + * @return the ImageTemplatePropertiesValidate object itself. + */ + public ImageTemplatePropertiesValidate withContinueDistributeOnFailure(Boolean continueDistributeOnFailure) { + this.continueDistributeOnFailure = continueDistributeOnFailure; + return this; + } + + /** + * Get the sourceValidationOnly property: If this field is set to true, the image specified in the 'source' section + * will directly be validated. No separate build will be run to generate and then validate a customized image. + * + * @return the sourceValidationOnly value. + */ + public Boolean sourceValidationOnly() { + return this.sourceValidationOnly; + } + + /** + * Set the sourceValidationOnly property: If this field is set to true, the image specified in the 'source' section + * will directly be validated. No separate build will be run to generate and then validate a customized image. + * + * @param sourceValidationOnly the sourceValidationOnly value to set. + * @return the ImageTemplatePropertiesValidate object itself. + */ + public ImageTemplatePropertiesValidate withSourceValidationOnly(Boolean sourceValidationOnly) { + this.sourceValidationOnly = sourceValidationOnly; + return this; + } + + /** + * Get the inVMValidations property: List of validations to be performed. + * + * @return the inVMValidations value. + */ + public List inVMValidations() { + return this.inVMValidations; + } + + /** + * Set the inVMValidations property: List of validations to be performed. + * + * @param inVMValidations the inVMValidations value to set. + * @return the ImageTemplatePropertiesValidate object itself. + */ + public ImageTemplatePropertiesValidate withInVMValidations(List inVMValidations) { + this.inVMValidations = inVMValidations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inVMValidations() != null) { + inVMValidations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateRestartCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateRestartCustomizer.java index 85f3b1892337..b0f4f6b7b1c6 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateRestartCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateRestartCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("WindowsRestart") @Fluent public final class ImageTemplateRestartCustomizer extends ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateRestartCustomizer.class); - /* * Command to execute the restart [Default: 'shutdown /r /f /t 0 /c "packer * restart"'] diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageDistributor.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageDistributor.java index fe1311572e6f..8def22a8da6c 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageDistributor.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageDistributor.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +17,6 @@ @JsonTypeName("SharedImage") @Fluent public final class ImageTemplateSharedImageDistributor extends ImageTemplateDistributor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateSharedImageDistributor.class); - /* * Resource Id of the Shared Image Gallery image */ @@ -154,16 +151,18 @@ public ImageTemplateSharedImageDistributor withArtifactTags(Map public void validate() { super.validate(); if (galleryImageId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property galleryImageId in model ImageTemplateSharedImageDistributor")); } if (replicationRegions() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property replicationRegions in model ImageTemplateSharedImageDistributor")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateSharedImageDistributor.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageVersionSource.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageVersionSource.java index c200049a33a7..9d7f1882f7a8 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageVersionSource.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSharedImageVersionSource.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("SharedImageVersion") @Fluent public final class ImageTemplateSharedImageVersionSource extends ImageTemplateSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateSharedImageVersionSource.class); - /* * ARM resource id of the image version in the shared image gallery */ @@ -53,10 +50,12 @@ public ImageTemplateSharedImageVersionSource withImageVersionId(String imageVers public void validate() { super.validate(); if (imageVersionId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property imageVersionId in model ImageTemplateSharedImageVersionSource")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateSharedImageVersionSource.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellCustomizer.java index b91b12174159..3f142ca0ae5d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,8 +18,6 @@ @JsonTypeName("Shell") @Fluent public final class ImageTemplateShellCustomizer extends ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateShellCustomizer.class); - /* * URI of the shell script to be run for customizing. It can be a github * link, SAS URI for Azure Storage, etc diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellValidator.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellValidator.java new file mode 100644 index 000000000000..6a981017531c --- /dev/null +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateShellValidator.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.imagebuilder.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Runs the specified shell script during the validation phase (Linux). Corresponds to Packer shell provisioner. Exactly + * one of 'scriptUri' or 'inline' can be specified. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Shell") +@Fluent +public final class ImageTemplateShellValidator extends ImageTemplateInVMValidator { + /* + * URI of the shell script to be run for validation. It can be a github + * link, Azure Storage URI, etc + */ + @JsonProperty(value = "scriptUri") + private String scriptUri; + + /* + * SHA256 checksum of the shell script provided in the scriptUri field + */ + @JsonProperty(value = "sha256Checksum") + private String sha256Checksum; + + /* + * Array of shell commands to execute + */ + @JsonProperty(value = "inline") + private List inline; + + /** + * Get the scriptUri property: URI of the shell script to be run for validation. It can be a github link, Azure + * Storage URI, etc. + * + * @return the scriptUri value. + */ + public String scriptUri() { + return this.scriptUri; + } + + /** + * Set the scriptUri property: URI of the shell script to be run for validation. It can be a github link, Azure + * Storage URI, etc. + * + * @param scriptUri the scriptUri value to set. + * @return the ImageTemplateShellValidator object itself. + */ + public ImageTemplateShellValidator withScriptUri(String scriptUri) { + this.scriptUri = scriptUri; + return this; + } + + /** + * Get the sha256Checksum property: SHA256 checksum of the shell script provided in the scriptUri field. + * + * @return the sha256Checksum value. + */ + public String sha256Checksum() { + return this.sha256Checksum; + } + + /** + * Set the sha256Checksum property: SHA256 checksum of the shell script provided in the scriptUri field. + * + * @param sha256Checksum the sha256Checksum value to set. + * @return the ImageTemplateShellValidator object itself. + */ + public ImageTemplateShellValidator withSha256Checksum(String sha256Checksum) { + this.sha256Checksum = sha256Checksum; + return this; + } + + /** + * Get the inline property: Array of shell commands to execute. + * + * @return the inline value. + */ + public List inline() { + return this.inline; + } + + /** + * Set the inline property: Array of shell commands to execute. + * + * @param inline the inline value to set. + * @return the ImageTemplateShellValidator object itself. + */ + public ImageTemplateShellValidator withInline(List inline) { + this.inline = inline; + return this; + } + + /** {@inheritDoc} */ + @Override + public ImageTemplateShellValidator withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSource.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSource.java index 4b0ebca3152f..e5166c8f0727 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSource.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateSource.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -25,8 +23,6 @@ }) @Immutable public class ImageTemplateSource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateSource.class); - /** * Validates the instance. * diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateUpdateParameters.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateUpdateParameters.java index fc7f2c23755e..d4ba1c32a452 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateUpdateParameters.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateUpdateParameters.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -14,8 +12,6 @@ /** Parameters for updating an image template. */ @Fluent public final class ImageTemplateUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateUpdateParameters.class); - /* * The identity of the image template, if configured. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVhdDistributor.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVhdDistributor.java index 0a4b93ca201b..4eb5b06618dd 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVhdDistributor.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVhdDistributor.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; @@ -16,8 +14,6 @@ @JsonTypeName("VHD") @Fluent public final class ImageTemplateVhdDistributor extends ImageTemplateDistributor { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateVhdDistributor.class); - /** {@inheritDoc} */ @Override public ImageTemplateVhdDistributor withRunOutputName(String runOutputName) { diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVmProfile.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVmProfile.java index a62bd5dc9db3..63e8c5eec72c 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVmProfile.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateVmProfile.java @@ -5,19 +5,16 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes the virtual machine used to build, customize and capture images. */ +/** Describes the virtual machines used to build and validate images. */ @Fluent public final class ImageTemplateVmProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateVmProfile.class); - /* * Size of the virtual machine used to build, customize and capture images. - * Omit or specify empty string to use the default (Standard_D2ds_v4). + * Omit or specify empty string to use the default (Standard_D1_v2 for Gen1 + * images and Standard_D2ds_v4 for Gen2 images). */ @JsonProperty(value = "vmSize") private String vmSize; @@ -31,15 +28,15 @@ public final class ImageTemplateVmProfile { /* * Optional array of resource IDs of user assigned managed identities to be - * configured on the build VM. This may include the identity of the image - * template. + * configured on the build VM and validation VM. This may include the + * identity of the image template. */ @JsonProperty(value = "userAssignedIdentities") private List userAssignedIdentities; /* * Optional configuration of the virtual network to use to deploy the build - * virtual machine in. Omit if no specific virtual network needs to be + * VM and validation VM in. Omit if no specific virtual network needs to be * used. */ @JsonProperty(value = "vnetConfig") @@ -47,7 +44,7 @@ public final class ImageTemplateVmProfile { /** * Get the vmSize property: Size of the virtual machine used to build, customize and capture images. Omit or specify - * empty string to use the default (Standard_D2ds_v4). + * empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images). * * @return the vmSize value. */ @@ -57,7 +54,7 @@ public String vmSize() { /** * Set the vmSize property: Size of the virtual machine used to build, customize and capture images. Omit or specify - * empty string to use the default (Standard_D2ds_v4). + * empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images). * * @param vmSize the vmSize value to set. * @return the ImageTemplateVmProfile object itself. @@ -89,7 +86,7 @@ public ImageTemplateVmProfile withOsDiskSizeGB(Integer osDiskSizeGB) { /** * Get the userAssignedIdentities property: Optional array of resource IDs of user assigned managed identities to be - * configured on the build VM. This may include the identity of the image template. + * configured on the build VM and validation VM. This may include the identity of the image template. * * @return the userAssignedIdentities value. */ @@ -99,7 +96,7 @@ public List userAssignedIdentities() { /** * Set the userAssignedIdentities property: Optional array of resource IDs of user assigned managed identities to be - * configured on the build VM. This may include the identity of the image template. + * configured on the build VM and validation VM. This may include the identity of the image template. * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ImageTemplateVmProfile object itself. @@ -110,8 +107,8 @@ public ImageTemplateVmProfile withUserAssignedIdentities(List userAssign } /** - * Get the vnetConfig property: Optional configuration of the virtual network to use to deploy the build virtual - * machine in. Omit if no specific virtual network needs to be used. + * Get the vnetConfig property: Optional configuration of the virtual network to use to deploy the build VM and + * validation VM in. Omit if no specific virtual network needs to be used. * * @return the vnetConfig value. */ @@ -120,8 +117,8 @@ public VirtualNetworkConfig vnetConfig() { } /** - * Set the vnetConfig property: Optional configuration of the virtual network to use to deploy the build virtual - * machine in. Omit if no specific virtual network needs to be used. + * Set the vnetConfig property: Optional configuration of the virtual network to use to deploy the build VM and + * validation VM in. Omit if no specific virtual network needs to be used. * * @param vnetConfig the vnetConfig value to set. * @return the ImageTemplateVmProfile object itself. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateWindowsUpdateCustomizer.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateWindowsUpdateCustomizer.java index cb6808ebf140..9cc4570081b1 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateWindowsUpdateCustomizer.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ImageTemplateWindowsUpdateCustomizer.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,8 +18,6 @@ @JsonTypeName("WindowsUpdate") @Fluent public final class ImageTemplateWindowsUpdateCustomizer extends ImageTemplateCustomizer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageTemplateWindowsUpdateCustomizer.class); - /* * Criteria to search updates. Omit or specify empty string to use the * default (search all). Refer to above link for examples and detailed diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operation.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operation.java index bbbed0cf2829..5c81fc45e660 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operation.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operation.java @@ -30,7 +30,7 @@ public interface Operation { String origin(); /** - * Gets the properties property: Any object. + * Gets the properties property: Properties of the operation. * * @return the properties value. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationDisplay.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationDisplay.java index 80988ae99e9c..7543dce8f5cc 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationDisplay.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that describes the operation. */ @Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Friendly name of the resource provider. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationListResult.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationListResult.java index 4389425585a4..dfb262972eeb 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationListResult.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/OperationListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Fluent public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * The list of operations supported by the resource provider. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operations.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operations.java index 8d9a88c6a229..629a0e345e04 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operations.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations. + * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/PlatformImagePurchasePlan.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/PlatformImagePurchasePlan.java index e5fe44fd545a..ca53d7d0e4f4 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/PlatformImagePurchasePlan.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/PlatformImagePurchasePlan.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Purchase plan configuration for platform image. */ @Fluent public final class PlatformImagePurchasePlan { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PlatformImagePurchasePlan.class); - /* * Name of the purchase plan. */ @@ -99,22 +96,24 @@ public PlatformImagePurchasePlan withPlanPublisher(String planPublisher) { */ public void validate() { if (planName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property planName in model PlatformImagePurchasePlan")); } if (planProduct() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property planProduct in model PlatformImagePurchasePlan")); } if (planPublisher() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property planPublisher in model PlatformImagePurchasePlan")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PlatformImagePurchasePlan.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningError.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningError.java index 4e895b080278..b4f227d1c6a0 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningError.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningError.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the error happened when create or update an image template. */ @Fluent public final class ProvisioningError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProvisioningError.class); - /* * Error code of the provisioning failure */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningErrorCode.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningErrorCode.java index 7853ddbeacea..134a631e5885 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningErrorCode.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/ProvisioningErrorCode.java @@ -32,12 +32,24 @@ public final class ProvisioningErrorCode extends ExpandableStringEnum values() { return values(ProvisioningErrorCode.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutput.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutput.java index f2c9f5785034..6661b50cca2f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutput.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutput.java @@ -16,14 +16,14 @@ public interface RunOutput { String id(); /** - * Gets the name property: Resource name. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: Resource type. + * Gets the type property: The type of the resource. * * @return the type value. */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutputCollection.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutputCollection.java index b25506e8265c..2f895a55781d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutputCollection.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunOutputCollection.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.imagebuilder.fluent.models.RunOutputInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The result of List run outputs operation. */ @Fluent public final class RunOutputCollection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RunOutputCollection.class); - /* * An array of run outputs */ diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunSubState.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunSubState.java index 450643be266d..0ad52ca6e018 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunSubState.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/RunSubState.java @@ -18,6 +18,9 @@ public enum RunSubState { /** Enum value Customizing. */ CUSTOMIZING("Customizing"), + /** Enum value Validating. */ + VALIDATING("Validating"), + /** Enum value Distributing. */ DISTRIBUTING("Distributing"); diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/SharedImageStorageAccountType.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/SharedImageStorageAccountType.java index 3a1877104df5..5ac5475e487f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/SharedImageStorageAccountType.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/SharedImageStorageAccountType.java @@ -27,7 +27,11 @@ public static SharedImageStorageAccountType fromString(String name) { return fromString(name, SharedImageStorageAccountType.class); } - /** @return known SharedImageStorageAccountType values. */ + /** + * Gets known SharedImageStorageAccountType values. + * + * @return known SharedImageStorageAccountType values. + */ public static Collection values() { return values(SharedImageStorageAccountType.class); } diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualMachineImageTemplates.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualMachineImageTemplates.java index aecb920e3f3f..1f0aea0e1d8d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualMachineImageTemplates.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualMachineImageTemplates.java @@ -15,7 +15,8 @@ public interface VirtualMachineImageTemplates { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +27,8 @@ public interface VirtualMachineImageTemplates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the subscription. + * @return information about the VM image templates associated with the subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); @@ -37,7 +39,8 @@ public interface VirtualMachineImageTemplates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -49,7 +52,8 @@ public interface VirtualMachineImageTemplates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the VM image templates associated with the specified resource group. + * @return information about the VM image templates associated with the specified resource group as paginated + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -74,7 +78,7 @@ public interface VirtualMachineImageTemplates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String imageTemplateName, Context context); @@ -156,7 +160,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName); @@ -169,7 +173,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of List run outputs operation. + * @return the result of List run outputs operation as paginated response with {@link PagedIterable}. */ PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName, Context context); @@ -196,7 +200,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified run output for the specified image template resource. + * @return the specified run output for the specified image template resource along with {@link Response}. */ Response getRunOutputWithResponse( String resourceGroupName, String imageTemplateName, String runOutputName, Context context); @@ -208,7 +212,7 @@ Response getRunOutputWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response}. */ ImageTemplate getById(String id); @@ -220,7 +224,7 @@ Response getRunOutputWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a virtual machine image template. + * @return information about a virtual machine image template along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualNetworkConfig.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualNetworkConfig.java index bad2c64aa27e..4f4faa7360e5 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualNetworkConfig.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/models/VirtualNetworkConfig.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.imagebuilder.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Virtual Network configuration. */ @Fluent public final class VirtualNetworkConfig { - @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkConfig.class); - /* * Resource id of a pre-existing subnet. */ @@ -21,9 +17,9 @@ public final class VirtualNetworkConfig { private String subnetId; /* - * Size of the virtual machine used to build, customize and capture images. - * Omit or specify empty string to use the default (Standard_D1_v2 for Gen1 - * images and Standard_D2ds_v4 for Gen2 images). + * Size of the proxy virtual machine used to pass traffic to the build VM + * and validation VM. Omit or specify empty string to use the default + * (Standard_A1_v2). */ @JsonProperty(value = "proxyVmSize") private String proxyVmSize; @@ -49,8 +45,8 @@ public VirtualNetworkConfig withSubnetId(String subnetId) { } /** - * Get the proxyVmSize property: Size of the virtual machine used to build, customize and capture images. Omit or - * specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images). + * Get the proxyVmSize property: Size of the proxy virtual machine used to pass traffic to the build VM and + * validation VM. Omit or specify empty string to use the default (Standard_A1_v2). * * @return the proxyVmSize value. */ @@ -59,8 +55,8 @@ public String proxyVmSize() { } /** - * Set the proxyVmSize property: Size of the virtual machine used to build, customize and capture images. Omit or - * specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4 for Gen2 images). + * Set the proxyVmSize property: Size of the proxy virtual machine used to pass traffic to the build VM and + * validation VM. Omit or specify empty string to use the default (Standard_A1_v2). * * @param proxyVmSize the proxyVmSize value to set. * @return the VirtualNetworkConfig object itself. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/OperationsListSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/OperationsListSamples.java index e5520c3a9b19..925a516a8a5f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/OperationsListSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/OperationsList.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/OperationsList.json */ /** * Sample code: Retrieve operations list. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCancelSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCancelSamples.java index e7d14c7977c4..170c62d90945 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCancelSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCancelSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates Cancel. */ public final class VirtualMachineImageTemplatesCancelSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CancelImageBuild.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CancelImageBuild.json */ /** * Sample code: Cancel the image build based on the imageTemplate. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCreateOrUpdateSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCreateOrUpdateSamples.java index e9b9cf65f86a..42a568e83315 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCreateOrUpdateSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesCreateOrUpdateSamples.java @@ -22,7 +22,7 @@ /** Samples for VirtualMachineImageTemplates CreateOrUpdate. */ public final class VirtualMachineImageTemplatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CreateImageTemplateLinux.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateLinux.json */ /** * Sample code: Create an Image Template for Linux. @@ -75,7 +75,7 @@ public static void createAnImageTemplateForLinux( } /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/CreateImageTemplateWindows.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/CreateImageTemplateWindows.json */ /** * Sample code: Create an Image Template for Windows. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesDeleteSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesDeleteSamples.java index 112ca4d2cbc2..95c2b0f25542 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesDeleteSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates Delete. */ public final class VirtualMachineImageTemplatesDeleteSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/DeleteImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/DeleteImageTemplate.json */ /** * Sample code: Delete an Image Template. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetByResourceGroupSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetByResourceGroupSamples.java index 356b8b9a0adf..d94370c14b8d 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetByResourceGroupSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates GetByResourceGroup. */ public final class VirtualMachineImageTemplatesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/GetImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetImageTemplate.json */ /** * Sample code: Retrieve an Image Template. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetRunOutputSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetRunOutputSamples.java index dd323253bb14..599bebc425e0 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetRunOutputSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesGetRunOutputSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates GetRunOutput. */ public final class VirtualMachineImageTemplatesGetRunOutputSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/GetRunOutput.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/GetRunOutput.json */ /** * Sample code: Retrieve single runOutput. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListByResourceGroupSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListByResourceGroupSamples.java index 627dc69e2b0a..67fe04a98ebd 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListByResourceGroupSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates ListByResourceGroup. */ public final class VirtualMachineImageTemplatesListByResourceGroupSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListImageTemplatesByRg.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplatesByRg.json */ /** * Sample code: List images by resource group. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListRunOutputsSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListRunOutputsSamples.java index 276c45e5aa2c..38e4a3f7f71a 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListRunOutputsSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListRunOutputsSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates ListRunOutputs. */ public final class VirtualMachineImageTemplatesListRunOutputsSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListRunOutputs.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListRunOutputs.json */ /** * Sample code: Retrieve a list of all outputs created by the last run of an Image Template. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListSamples.java index 034f764405d5..558dc463e1c6 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesListSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates List. */ public final class VirtualMachineImageTemplatesListSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/ListImageTemplates.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/ListImageTemplates.json */ /** * Sample code: List images by subscription. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesRunSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesRunSamples.java index 8436d42b221d..b41c973752c1 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesRunSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesRunSamples.java @@ -9,7 +9,7 @@ /** Samples for VirtualMachineImageTemplates Run. */ public final class VirtualMachineImageTemplatesRunSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/RunImageTemplate.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/RunImageTemplate.json */ /** * Sample code: Create image(s) from existing imageTemplate. diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesUpdateSamples.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesUpdateSamples.java index eb957f3419a4..d1fa7ee3b85f 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesUpdateSamples.java +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/samples/java/com/azure/resourcemanager/imagebuilder/generated/VirtualMachineImageTemplatesUpdateSamples.java @@ -14,7 +14,7 @@ /** Samples for VirtualMachineImageTemplates Update. */ public final class VirtualMachineImageTemplatesUpdateSamples { /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/UpdateImageTemplateToRemoveIdentities.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateToRemoveIdentities.json */ /** * Sample code: Remove identities for an Image Template. @@ -32,7 +32,7 @@ public static void removeIdentitiesForAnImageTemplate( } /* - * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2021-10-01/examples/UpdateImageTemplateTags.json + * x-ms-original-file: specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2022-02-14/examples/UpdateImageTemplateTags.json */ /** * Sample code: Update the tags for an Image Template.