diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 08ab9c42f953..328c88cd7dba 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -379,7 +379,7 @@ com.azure.resourcemanager:azure-resourcemanager-iotcentral;1.0.0;1.1.0-beta.3
com.azure.resourcemanager:azure-resourcemanager-labservices;1.0.0;1.1.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-vmwarecloudsimple;1.0.0-beta.3;1.0.0-beta.4
com.azure.resourcemanager:azure-resourcemanager-managedapplications;1.0.0;1.1.0-beta.1
-com.azure.resourcemanager:azure-resourcemanager-imagebuilder;1.2.0;1.3.0-beta.1
+com.azure.resourcemanager:azure-resourcemanager-imagebuilder;1.2.0;1.3.0
com.azure.resourcemanager:azure-resourcemanager-maps;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0;1.1.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.6.0;1.7.0-beta.2
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md
index ed85eaea1050..7b5dd6d92ced 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md
@@ -1,14 +1,221 @@
# Release History
-## 1.3.0-beta.1 (Unreleased)
+## 1.3.0 (2026-05-20)
-### Features Added
+- Azure Resource Manager ImageBuilder client library for Java. This package contains Microsoft Azure SDK for ImageBuilder Management SDK. Virtual Machine Image Template. Package api-version 2025-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
### Breaking Changes
-### Bugs Fixed
+#### `models.RunOutputCollection` was removed
+
+#### `models.TriggerCollection` was removed
+
+#### `models.ImageTemplateListResult` was removed
+
+#### `models.OperationListResult` was removed
+
+#### `models.ImageTemplateVhdDistributor` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateUpdateParametersProperties` was modified
+
+* `validate()` was removed
+
+#### `models.VirtualNetworkConfig` was modified
+
+* `validate()` was removed
+
+#### `models.DistributeVersioner` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateIdentity` was modified
+
+* `validate()` was removed
+
+#### `models.OperationDisplay` was modified
+
+* `OperationDisplay()` was changed to private access
+* `withDescription(java.lang.String)` was removed
+* `validate()` was removed
+* `withProvider(java.lang.String)` was removed
+* `withResource(java.lang.String)` was removed
+* `withOperation(java.lang.String)` was removed
+
+#### `models.ImageTemplateInVMValidator` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePropertiesOptimize` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePropertiesOptimizeVmBoot` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateShellCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateAutoRun` was modified
+
+* `validate()` was removed
+
+#### `models.UserAssignedIdentity` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePropertiesValidate` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateSource` was modified
+
+* `validate()` was removed
+
+#### `models.ProvisioningError` was modified
+
+* `ProvisioningError()` was changed to private access
+* `withProvisioningErrorCode(models.ProvisioningErrorCode)` was removed
+* `withMessage(java.lang.String)` was removed
+* `validate()` was removed
+
+#### `models.TriggerProperties` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePropertiesErrorHandling` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateWindowsUpdateCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateDistributor` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateShellValidator` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateFileCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateUpdateParameters` was modified
+
+* `validate()` was removed
+
+#### `models.DistributeVersionerSource` was modified
+
+* `validate()` was removed
+
+#### `models.TargetRegion` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePowerShellCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.PlatformImagePurchasePlan` was modified
+
+* `validate()` was removed
+
+#### `models.DistributeVersionerLatest` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateSharedImageDistributor` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplatePlatformImageSource` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateVmProfile` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateManagedImageDistributor` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateSharedImageVersionSource` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateRestartCustomizer` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateFileValidator` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateManagedImageSource` was modified
+
+* `validate()` was removed
+
+#### `models.ImageTemplateLastRunStatus` was modified
+
+* `ImageTemplateLastRunStatus()` was changed to private access
+* `withRunSubState(models.RunSubState)` was removed
+* `withMessage(java.lang.String)` was removed
+* `withStartTime(java.time.OffsetDateTime)` was removed
+* `validate()` was removed
+* `withEndTime(java.time.OffsetDateTime)` was removed
+* `withRunState(models.RunState)` was removed
+
+#### `models.SourceImageTriggerProperties` was modified
+
+* `validate()` was removed
+
+#### `models.TriggerStatus` was modified
+
+* `TriggerStatus()` was changed to private access
+* `validate()` was removed
+
+#### `models.ImageTemplatePowerShellValidator` was modified
+
+* `validate()` was removed
+
+### Features Added
+
+* `models.ReplicationMode` was added
+
+* `models.ImageTemplatePropertiesOptimizeWorkload` was added
+
+* `models.WorkloadOptimizationState` was added
+
+* `models.DataDisk` was added
+
+#### `models.ImageTemplatePropertiesOptimize` was modified
+
+* `workload()` was added
+* `withWorkload(models.ImageTemplatePropertiesOptimizeWorkload)` was added
+
+#### `models.ImageTemplateSharedImageDistributor` was modified
+
+* `replicationMode()` was added
+* `withReplicationMode(models.ReplicationMode)` was added
+
+#### `models.ImageTemplate` was modified
+
+* `additionalDataDisks()` was added
+
+#### `models.ImageTemplate$Definition` was modified
-### Other Changes
+* `withAdditionalDataDisks(java.util.List)` was added
## 1.2.0 (2024-12-19)
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md
index 8742dd23b131..2ffd8dee36f4 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-2024-02. 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. Virtual Machine Image Template. Package api-version 2025-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
## We'd love to hear your feedback
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
com.azure.resourcemanager
azure-resourcemanager-imagebuilder
- 1.3.0-beta.1
+ 1.3.0
```
[//]: # ({x-version-update-end})
@@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:
```java
-AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
@@ -60,7 +60,7 @@ ImageBuilderManager manager = ImageBuilderManager
.authenticate(credential, profile);
```
-The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.
See [Authentication][authenticate] for more options.
@@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
-
-
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md
index 4dbec1c7e954..1f89da998f8c 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md
@@ -32,9 +32,7 @@
*/
public final class OperationsListSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * OperationsList.json
+ * x-ms-original-file: 2025-10-01/OperationsList.json
*/
/**
* Sample code: Retrieve operations list.
@@ -57,9 +55,7 @@ import com.azure.resourcemanager.imagebuilder.models.SourceImageTriggerPropertie
*/
public final class TriggersCreateOrUpdateSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * CreateSourceImageTrigger.json
+ * x-ms-original-file: 2025-10-01/CreateSourceImageTrigger.json
*/
/**
* Sample code: Create or update a source image type trigger.
@@ -85,9 +81,7 @@ public final class TriggersCreateOrUpdateSamples {
*/
public final class TriggersDeleteSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * DeleteTrigger.json
+ * x-ms-original-file: 2025-10-01/DeleteTrigger.json
*/
/**
* Sample code: Delete a trigger resource.
@@ -108,9 +102,7 @@ public final class TriggersDeleteSamples {
*/
public final class TriggersGetSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/GetTrigger.
- * json
+ * x-ms-original-file: 2025-10-01/GetTrigger.json
*/
/**
* Sample code: Get a trigger resource.
@@ -132,9 +124,7 @@ public final class TriggersGetSamples {
*/
public final class TriggersListByImageTemplateSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * ListTriggers.json
+ * x-ms-original-file: 2025-10-01/ListTriggers.json
*/
/**
* Sample code: List triggers by image template.
@@ -155,9 +145,7 @@ public final class TriggersListByImageTemplateSamples {
*/
public final class VirtualMachineImageTemplatesCancelSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * CancelImageBuild.json
+ * x-ms-original-file: 2025-10-01/CancelImageBuild.json
*/
/**
* Sample code: Cancel the image build based on the imageTemplate.
@@ -195,9 +183,7 @@ import java.util.Map;
*/
public final class VirtualMachineImageTemplatesCreateOrUpdateSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * CreateImageTemplateLinux.json
+ * x-ms-original-file: 2025-10-01/CreateImageTemplateLinux.json
*/
/**
* Sample code: Create an Image Template for Linux.
@@ -232,9 +218,7 @@ public final class VirtualMachineImageTemplatesCreateOrUpdateSamples {
}
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * CreateImageTemplateWindows.json
+ * x-ms-original-file: 2025-10-01/CreateImageTemplateWindows.json
*/
/**
* Sample code: Create an Image Template for Windows.
@@ -321,9 +305,7 @@ public final class VirtualMachineImageTemplatesCreateOrUpdateSamples {
*/
public final class VirtualMachineImageTemplatesDeleteSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * DeleteImageTemplate.json
+ * x-ms-original-file: 2025-10-01/DeleteImageTemplate.json
*/
/**
* Sample code: Delete an Image Template.
@@ -345,9 +327,7 @@ public final class VirtualMachineImageTemplatesDeleteSamples {
*/
public final class VirtualMachineImageTemplatesGetByResourceGroupSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * GetImageTemplate.json
+ * x-ms-original-file: 2025-10-01/GetImageTemplate.json
*/
/**
* Sample code: Retrieve an Image Template.
@@ -369,9 +349,7 @@ public final class VirtualMachineImageTemplatesGetByResourceGroupSamples {
*/
public final class VirtualMachineImageTemplatesGetRunOutputSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * GetRunOutput.json
+ * x-ms-original-file: 2025-10-01/GetRunOutput.json
*/
/**
* Sample code: Retrieve single runOutput.
@@ -394,9 +372,7 @@ public final class VirtualMachineImageTemplatesGetRunOutputSamples {
*/
public final class VirtualMachineImageTemplatesListSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * ListImageTemplates.json
+ * x-ms-original-file: 2025-10-01/ListImageTemplates.json
*/
/**
* Sample code: List images by subscription.
@@ -417,9 +393,7 @@ public final class VirtualMachineImageTemplatesListSamples {
*/
public final class VirtualMachineImageTemplatesListByResourceGroupSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * ListImageTemplatesByRg.json
+ * x-ms-original-file: 2025-10-01/ListImageTemplatesByRg.json
*/
/**
* Sample code: List images by resource group.
@@ -440,9 +414,7 @@ public final class VirtualMachineImageTemplatesListByResourceGroupSamples {
*/
public final class VirtualMachineImageTemplatesListRunOutputsSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * ListRunOutputs.json
+ * x-ms-original-file: 2025-10-01/ListRunOutputs.json
*/
/**
* Sample code: Retrieve a list of all outputs created by the last run of an Image Template.
@@ -465,9 +437,7 @@ public final class VirtualMachineImageTemplatesListRunOutputsSamples {
*/
public final class VirtualMachineImageTemplatesRunSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * RunImageTemplate.json
+ * x-ms-original-file: 2025-10-01/RunImageTemplate.json
*/
/**
* Sample code: Create image(s) from existing imageTemplate.
@@ -499,9 +469,7 @@ import java.util.Map;
*/
public final class VirtualMachineImageTemplatesUpdateSamples {
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * UpdateImageTemplateToRemoveIdentities.json
+ * x-ms-original-file: 2025-10-01/UpdateImageTemplateToRemoveIdentities.json
*/
/**
* Sample code: Remove identities for an Image Template.
@@ -517,9 +485,7 @@ public final class VirtualMachineImageTemplatesUpdateSamples {
}
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * UpdateImageTemplateVmProfile.json
+ * x-ms-original-file: 2025-10-01/UpdateImageTemplateVmProfile.json
*/
/**
* Sample code: Update parameters for vm profile.
@@ -542,9 +508,7 @@ public final class VirtualMachineImageTemplatesUpdateSamples {
}
/*
- * x-ms-original-file:
- * specification/imagebuilder/resource-manager/Microsoft.VirtualMachineImages/stable/2024-02-01/examples/
- * UpdateImageTemplateTags.json
+ * x-ms-original-file: 2025-10-01/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 1f3afc6ad3cb..adf459b6adc3 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml
@@ -1,9 +1,9 @@
-
+
4.0.0
com.azure
@@ -14,11 +14,11 @@
com.azure.resourcemanager
azure-resourcemanager-imagebuilder
- 1.3.0-beta.1
+ 1.3.0
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-2024-02.
+ 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. Virtual Machine Image Template. Package api-version 2025-10-01.
https://github.com/Azure/azure-sdk-for-java
@@ -45,7 +45,7 @@
UTF-8
0
0
- false
+ true
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 0a5aec6c3345..9982c2e02cd3 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder;
@@ -22,6 +22,7 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.imagebuilder.fluent.ImageBuilderClient;
import com.azure.resourcemanager.imagebuilder.implementation.ImageBuilderClientBuilder;
@@ -35,19 +36,20 @@
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Entry point to ImageBuilderManager.
- * Azure Virtual Machine Image Builder Client.
+ * Virtual Machine Image Template.
*/
public final class ImageBuilderManager {
- private VirtualMachineImageTemplates virtualMachineImageTemplates;
+ private Operations operations;
private Triggers triggers;
- private Operations operations;
+ private VirtualMachineImageTemplates virtualMachineImageTemplates;
private final ImageBuilderClient clientObject;
@@ -101,6 +103,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
+ private static final String SDK_VERSION = "version";
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-resourcemanager-imagebuilder.properties");
private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
@@ -208,12 +213,14 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.imagebuilder")
.append("/")
- .append("1.2.0");
+ .append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -260,16 +267,15 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile
}
/**
- * Gets the resource collection API of VirtualMachineImageTemplates. It manages ImageTemplate.
+ * Gets the resource collection API of Operations.
*
- * @return Resource collection API of VirtualMachineImageTemplates.
+ * @return Resource collection API of Operations.
*/
- public VirtualMachineImageTemplates virtualMachineImageTemplates() {
- if (this.virtualMachineImageTemplates == null) {
- this.virtualMachineImageTemplates
- = new VirtualMachineImageTemplatesImpl(clientObject.getVirtualMachineImageTemplates(), this);
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
- return virtualMachineImageTemplates;
+ return operations;
}
/**
@@ -285,15 +291,16 @@ public Triggers triggers() {
}
/**
- * Gets the resource collection API of Operations.
+ * Gets the resource collection API of VirtualMachineImageTemplates. It manages ImageTemplate.
*
- * @return Resource collection API of Operations.
+ * @return Resource collection API of VirtualMachineImageTemplates.
*/
- public Operations operations() {
- if (this.operations == null) {
- this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ public VirtualMachineImageTemplates virtualMachineImageTemplates() {
+ if (this.virtualMachineImageTemplates == null) {
+ this.virtualMachineImageTemplates
+ = new VirtualMachineImageTemplatesImpl(clientObject.getVirtualMachineImageTemplates(), this);
}
- return operations;
+ return virtualMachineImageTemplates;
}
/**
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/ImageBuilderClient.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/ImageBuilderClient.java
index 8006d065bbc2..46151808b5d7 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/ImageBuilderClient.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/ImageBuilderClient.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent;
@@ -12,27 +12,26 @@
*/
public interface ImageBuilderClient {
/**
- * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms
- * part of the URI for every service call.
- *
- * @return the subscriptionId value.
- */
- String getSubscriptionId();
-
- /**
- * Gets server parameter.
+ * Gets Service host.
*
* @return the endpoint value.
*/
String getEndpoint();
/**
- * Gets Api Version.
+ * Gets Version parameter.
*
* @return the apiVersion value.
*/
String getApiVersion();
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
/**
* Gets The HTTP pipeline to send requests through.
*
@@ -48,11 +47,11 @@ public interface ImageBuilderClient {
Duration getDefaultPollInterval();
/**
- * Gets the VirtualMachineImageTemplatesClient object to access its operations.
+ * Gets the OperationsClient object to access its operations.
*
- * @return the VirtualMachineImageTemplatesClient object.
+ * @return the OperationsClient object.
*/
- VirtualMachineImageTemplatesClient getVirtualMachineImageTemplates();
+ OperationsClient getOperations();
/**
* Gets the TriggersClient object to access its operations.
@@ -62,9 +61,9 @@ public interface ImageBuilderClient {
TriggersClient getTriggers();
/**
- * Gets the OperationsClient object to access its operations.
+ * Gets the VirtualMachineImageTemplatesClient object to access its operations.
*
- * @return the OperationsClient object.
+ * @return the VirtualMachineImageTemplatesClient object.
*/
- OperationsClient getOperations();
+ VirtualMachineImageTemplatesClient getVirtualMachineImageTemplates();
}
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 aa767cd383cc..c103a70ad77e 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent;
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/TriggersClient.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/TriggersClient.java
index 1a069424ba66..3de1058da087 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/TriggersClient.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/TriggersClient.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent;
@@ -17,38 +17,10 @@
* An instance of this class provides access to all the operations defined in TriggersClient.
*/
public interface TriggersClient {
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @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 triggers operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName);
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the result of List triggers operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
- Context context);
-
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
@@ -64,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String imageTem
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -78,7 +50,7 @@ Response getWithResponse(String resourceGroupName, String imageTem
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -94,7 +66,7 @@ SyncPoller, TriggerInner> beginCreateOrUpdate(String re
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -111,7 +83,7 @@ SyncPoller, TriggerInner> beginCreateOrUpdate(String re
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -127,7 +99,7 @@ TriggerInner createOrUpdate(String resourceGroupName, String imageTemplateName,
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -144,7 +116,7 @@ TriggerInner createOrUpdate(String resourceGroupName, String imageTemplateName,
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -159,7 +131,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
@@ -175,7 +147,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -188,7 +160,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
@@ -198,4 +170,32 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String imageTemplateName, String triggerName, Context context);
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @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 triggers operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName);
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of List triggers operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
+ 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 21d30f5c47e4..a450848bec78 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent;
@@ -20,60 +20,37 @@
*/
public interface VirtualMachineImageTemplatesClient {
/**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @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 as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list();
-
- /**
- * Gets information about the VM image templates associated with the subscription.
+ * Get information about a virtual machine image template.
*
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about the VM image templates associated with the subscription as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable list(Context context);
-
- /**
- * Gets information about the VM image templates associated with the specified resource group.
- *
- * @param resourceGroupName The name of the resource group.
- * @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 as paginated
- * response with {@link PagedIterable}.
+ * @return information about a virtual machine image template along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String imageTemplateName,
+ Context context);
/**
- * Gets information about the VM image templates associated with the specified resource group.
+ * Get information about a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
- * @param context The context to associate with this operation.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
* @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 as paginated
- * response with {@link PagedIterable}.
+ * @return information about a virtual machine image template.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ImageTemplateInner getByResourceGroup(String resourceGroupName, String imageTemplateName);
/**
* Create or update a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Parameters supplied to the CreateImageTemplate operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -89,7 +66,7 @@ SyncPoller, ImageTemplateInner> beginCreateOrUpda
/**
* Create or update a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Parameters supplied to the CreateImageTemplate operation.
* @param context The context to associate with this operation.
@@ -106,7 +83,7 @@ SyncPoller, ImageTemplateInner> beginCreateOrUpda
/**
* Create or update a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Parameters supplied to the CreateImageTemplate operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -121,7 +98,7 @@ ImageTemplateInner createOrUpdate(String resourceGroupName, String imageTemplate
/**
* Create or update a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Parameters supplied to the CreateImageTemplate operation.
* @param context The context to associate with this operation.
@@ -137,7 +114,7 @@ ImageTemplateInner createOrUpdate(String resourceGroupName, String imageTemplate
/**
* Update the tags for this Virtual Machine Image Template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Additional parameters for Image Template update.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -153,7 +130,7 @@ SyncPoller, ImageTemplateInner> beginUpdate(Strin
/**
* Update the tags for this Virtual Machine Image Template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Additional parameters for Image Template update.
* @param context The context to associate with this operation.
@@ -170,7 +147,7 @@ SyncPoller, ImageTemplateInner> beginUpdate(Strin
/**
* Update the tags for this Virtual Machine Image Template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Additional parameters for Image Template update.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -185,7 +162,7 @@ ImageTemplateInner update(String resourceGroupName, String imageTemplateName,
/**
* Update the tags for this Virtual Machine Image Template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param parameters Additional parameters for Image Template update.
* @param context The context to associate with this operation.
@@ -199,89 +176,112 @@ ImageTemplateInner update(String resourceGroupName, String imageTemplateName,
ImageTemplateUpdateParameters parameters, Context context);
/**
- * Get information about a virtual machine image template.
+ * Delete a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about a virtual machine image template along with {@link Response}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response getByResourceGroupWithResponse(String resourceGroupName, String imageTemplateName,
- Context context);
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName);
/**
- * Get information about a virtual machine image template.
+ * Delete a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about a virtual machine image template.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- ImageTemplateInner getByResourceGroup(String resourceGroupName, String imageTemplateName);
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName, Context context);
/**
* Delete a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @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 {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String imageTemplateName);
/**
* Delete a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName, Context context);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String imageTemplateName, Context context);
/**
- * Delete a virtual machine image template.
+ * Gets information about the VM image templates associated with the specified resource group.
*
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 as paginated
+ * response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets information about the VM image templates associated with the specified resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the VM image templates associated with the specified resource group as paginated
+ * response with {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- void delete(String resourceGroupName, String imageTemplateName);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
/**
- * Delete a virtual machine image template.
+ * Gets information about the VM image templates associated with the subscription.
+ *
+ * @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 as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets information about the VM image templates associated with the subscription.
*
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the VM image templates associated with the subscription as paginated response with
+ * {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- void delete(String resourceGroupName, String imageTemplateName, Context context);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
/**
* Create artifacts from a existing image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -294,7 +294,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Create artifacts from a existing image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -308,7 +308,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Create artifacts from a existing image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -320,7 +320,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Create artifacts from a existing image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -333,7 +333,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Cancel the long running image build based on the image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -346,7 +346,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Cancel the long running image build based on the image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -360,7 +360,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Cancel the long running image build based on the image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -372,7 +372,7 @@ Response getByResourceGroupWithResponse(String resourceGroup
/**
* Cancel the long running image build based on the image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -383,59 +383,59 @@ Response getByResourceGroupWithResponse(String resourceGroup
void cancel(String resourceGroupName, String imageTemplateName, Context context);
/**
- * List all run outputs for the specified Image Template resource.
+ * Get the specified run output for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
+ * @param runOutputName The name of the run output.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the result of List run outputs operation as paginated response with {@link PagedIterable}.
+ * @return the specified run output for the specified image template resource along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getRunOutputWithResponse(String resourceGroupName, String imageTemplateName,
+ String runOutputName, Context context);
/**
- * List all run outputs for the specified Image Template resource.
+ * Get the specified run output for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
+ * @param runOutputName The name of the run output.
* @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 as paginated response with {@link PagedIterable}.
+ * @return the specified run output for the specified image template resource.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName, Context context);
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RunOutputInner getRunOutput(String resourceGroupName, String imageTemplateName, String runOutputName);
/**
- * Get the specified run output for the specified image template resource.
+ * List all run outputs for the specified Image Template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
- * @param runOutputName The name of the run output.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the specified run output for the specified image template resource along with {@link Response}.
+ * @return the result of List run outputs operation as paginated response with {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- Response getRunOutputWithResponse(String resourceGroupName, String imageTemplateName,
- String runOutputName, Context context);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName);
/**
- * Get the specified run output for the specified image template resource.
+ * List all run outputs for the specified Image Template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
- * @param runOutputName The name of the run output.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the specified run output for the specified image template resource.
+ * @return the result of List run outputs operation as paginated response with {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- RunOutputInner getRunOutput(String resourceGroupName, String imageTemplateName, String runOutputName);
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listRunOutputs(String resourceGroupName, String imageTemplateName, Context context);
}
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 913eecb55781..d875ba948c92 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
@@ -1,16 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent.models;
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.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.imagebuilder.models.DataDisk;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateAutoRun;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor;
@@ -371,6 +371,29 @@ public ImageTemplateInner withVmProfile(ImageTemplateVmProfile vmProfile) {
return this;
}
+ /**
+ * Get the additionalDataDisks property: Optional array of additional data disks to be added to the image.
+ *
+ * @return the additionalDataDisks value.
+ */
+ public List additionalDataDisks() {
+ return this.innerProperties() == null ? null : this.innerProperties().additionalDataDisks();
+ }
+
+ /**
+ * Set the additionalDataDisks property: Optional array of additional data disks to be added to the image.
+ *
+ * @param additionalDataDisks the additionalDataDisks value to set.
+ * @return the ImageTemplateInner object itself.
+ */
+ public ImageTemplateInner withAdditionalDataDisks(List additionalDataDisks) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ImageTemplateProperties();
+ }
+ this.innerProperties().withAdditionalDataDisks(additionalDataDisks);
+ 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
@@ -467,25 +490,6 @@ public ImageTemplateInner withManagedResourceTags(Map managedRes
return this;
}
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (innerProperties() != null) {
- innerProperties().validate();
- }
- if (identity() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException("Missing required property identity in model ImageTemplateInner"));
- } else {
- identity().validate();
- }
- }
-
- private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateInner.class);
-
/**
* {@inheritDoc}
*/
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 b5b5ad197e2b..927c8b5d215b 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
@@ -1,15 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent.models;
import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.imagebuilder.models.DataDisk;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateAutoRun;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor;
@@ -86,6 +86,11 @@ public final class ImageTemplateProperties implements JsonSerializable additionalDataDisks;
+
/*
* 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
@@ -313,6 +318,26 @@ public ImageTemplateProperties withVmProfile(ImageTemplateVmProfile vmProfile) {
return this;
}
+ /**
+ * Get the additionalDataDisks property: Optional array of additional data disks to be added to the image.
+ *
+ * @return the additionalDataDisks value.
+ */
+ public List additionalDataDisks() {
+ return this.additionalDataDisks;
+ }
+
+ /**
+ * Set the additionalDataDisks property: Optional array of additional data disks to be added to the image.
+ *
+ * @param additionalDataDisks the additionalDataDisks value to set.
+ * @return the ImageTemplateProperties object itself.
+ */
+ public ImageTemplateProperties withAdditionalDataDisks(List additionalDataDisks) {
+ this.additionalDataDisks = additionalDataDisks;
+ 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
@@ -400,53 +425,6 @@ public ImageTemplateProperties withManagedResourceTags(Map manag
return this;
}
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (source() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException("Missing required property source in model ImageTemplateProperties"));
- } else {
- source().validate();
- }
- if (customize() != null) {
- customize().forEach(e -> e.validate());
- }
- if (optimize() != null) {
- optimize().validate();
- }
- if (validation() != null) {
- validation().validate();
- }
- if (distribute() == null) {
- throw LOGGER.atError()
- .log(new IllegalArgumentException(
- "Missing required property distribute in model ImageTemplateProperties"));
- } else {
- distribute().forEach(e -> e.validate());
- }
- if (errorHandling() != null) {
- errorHandling().validate();
- }
- if (provisioningError() != null) {
- provisioningError().validate();
- }
- if (lastRunStatus() != null) {
- lastRunStatus().validate();
- }
- if (vmProfile() != null) {
- vmProfile().validate();
- }
- if (autoRun() != null) {
- autoRun().validate();
- }
- }
-
- private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateProperties.class);
-
/**
* {@inheritDoc}
*/
@@ -461,6 +439,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeJsonField("errorHandling", this.errorHandling);
jsonWriter.writeNumberField("buildTimeoutInMinutes", this.buildTimeoutInMinutes);
jsonWriter.writeJsonField("vmProfile", this.vmProfile);
+ jsonWriter.writeArrayField("additionalDataDisks", this.additionalDataDisks,
+ (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("stagingResourceGroup", this.stagingResourceGroup);
jsonWriter.writeJsonField("autoRun", this.autoRun);
jsonWriter.writeMapField("managedResourceTags", this.managedResourceTags,
@@ -512,6 +492,9 @@ public static ImageTemplateProperties fromJson(JsonReader jsonReader) throws IOE
deserializedImageTemplateProperties.buildTimeoutInMinutes = reader.getNullable(JsonReader::getInt);
} else if ("vmProfile".equals(fieldName)) {
deserializedImageTemplateProperties.vmProfile = ImageTemplateVmProfile.fromJson(reader);
+ } else if ("additionalDataDisks".equals(fieldName)) {
+ List additionalDataDisks = reader.readArray(reader1 -> DataDisk.fromJson(reader1));
+ deserializedImageTemplateProperties.additionalDataDisks = additionalDataDisks;
} else if ("stagingResourceGroup".equals(fieldName)) {
deserializedImageTemplateProperties.stagingResourceGroup = reader.getString();
} else if ("exactStagingResourceGroup".equals(fieldName)) {
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 7a672e0f2d41..e10bf77715e2 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent.models;
-import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
@@ -15,7 +15,7 @@
/**
* A REST API operation.
*/
-@Fluent
+@Immutable
public final class OperationInner implements JsonSerializable {
/*
* This is of the format {provider}/{resource}/{operation}
@@ -45,7 +45,7 @@ public final class OperationInner implements JsonSerializable {
/**
* Creates an instance of OperationInner class.
*/
- public OperationInner() {
+ private OperationInner() {
}
/**
@@ -57,17 +57,6 @@ public String name() {
return this.name;
}
- /**
- * Set the name property: This is of the format {provider}/{resource}/{operation}.
- *
- * @param name the name value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withName(String name) {
- this.name = name;
- return this;
- }
-
/**
* Get the display property: The object that describes the operation.
*
@@ -77,17 +66,6 @@ public OperationDisplay display() {
return this.display;
}
- /**
- * Set the display property: The object that describes the operation.
- *
- * @param display the display value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withDisplay(OperationDisplay display) {
- this.display = display;
- return this;
- }
-
/**
* Get the origin property: The intended executor of the operation.
*
@@ -97,17 +75,6 @@ public String origin() {
return this.origin;
}
- /**
- * Set the origin property: The intended executor of the operation.
- *
- * @param origin the origin value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withOrigin(String origin) {
- this.origin = origin;
- return this;
- }
-
/**
* Get the properties property: Properties of the operation.
*
@@ -117,17 +84,6 @@ public Object properties() {
return this.properties;
}
- /**
- * Set the properties property: Properties of the operation.
- *
- * @param properties the properties value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withProperties(Object properties) {
- this.properties = properties;
- return this;
- }
-
/**
* Get the isDataAction property: The flag that indicates whether the operation applies to data plane.
*
@@ -137,28 +93,6 @@ public Boolean isDataAction() {
return this.isDataAction;
}
- /**
- * Set the isDataAction property: The flag that indicates whether the operation applies to data plane.
- *
- * @param isDataAction the isDataAction value to set.
- * @return the OperationInner object itself.
- */
- public OperationInner withIsDataAction(Boolean isDataAction) {
- this.isDataAction = isDataAction;
- return this;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (display() != null) {
- display().validate();
- }
- }
-
/**
* {@inheritDoc}
*/
@@ -168,7 +102,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeJsonField("display", this.display);
jsonWriter.writeStringField("origin", this.origin);
- jsonWriter.writeUntypedField("properties", this.properties);
+ if (this.properties != null) {
+ jsonWriter.writeUntypedField("properties", this.properties);
+ }
jsonWriter.writeBooleanField("isDataAction", this.isDataAction);
return jsonWriter.writeEndObject();
}
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 bb32192f87a6..833caf024cbe 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent.models;
-import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Immutable;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
@@ -16,7 +16,7 @@
/**
* Represents an output that was created by running an image template.
*/
-@Fluent
+@Immutable
public final class RunOutputInner extends ProxyResource {
/*
* The properties of the run output
@@ -46,7 +46,7 @@ public final class RunOutputInner extends ProxyResource {
/**
* Creates an instance of RunOutputInner class.
*/
- public RunOutputInner() {
+ private RunOutputInner() {
}
/**
@@ -106,20 +106,6 @@ public String artifactId() {
return this.innerProperties() == null ? null : this.innerProperties().artifactId();
}
- /**
- * Set the artifactId property: The resource id of the artifact.
- *
- * @param artifactId the artifactId value to set.
- * @return the RunOutputInner object itself.
- */
- public RunOutputInner withArtifactId(String artifactId) {
- if (this.innerProperties() == null) {
- this.innerProperties = new RunOutputProperties();
- }
- this.innerProperties().withArtifactId(artifactId);
- return this;
- }
-
/**
* Get the artifactUri property: The location URI of the artifact.
*
@@ -129,20 +115,6 @@ public String artifactUri() {
return this.innerProperties() == null ? null : this.innerProperties().artifactUri();
}
- /**
- * Set the artifactUri property: The location URI of the artifact.
- *
- * @param artifactUri the artifactUri value to set.
- * @return the RunOutputInner object itself.
- */
- public RunOutputInner withArtifactUri(String artifactUri) {
- if (this.innerProperties() == null) {
- this.innerProperties = new RunOutputProperties();
- }
- this.innerProperties().withArtifactUri(artifactUri);
- return this;
- }
-
/**
* Get the provisioningState property: Provisioning state of the resource.
*
@@ -152,17 +124,6 @@ public ProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- if (innerProperties() != null) {
- innerProperties().validate();
- }
- }
-
/**
* {@inheritDoc}
*/
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 4e6eb0c2f91d..0e1cee42958a 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
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.fluent.models;
-import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
@@ -15,7 +15,7 @@
/**
* Describes the properties of a run output.
*/
-@Fluent
+@Immutable
public final class RunOutputProperties implements JsonSerializable {
/*
* The resource id of the artifact.
@@ -35,7 +35,7 @@ public final class RunOutputProperties implements JsonSerializable PollerFlux, U> getLroResult(Mono type of poll result.
+ * @param type of final result.
+ * @return SyncPoller for poll result and final result.
+ */
+ public SyncPoller, U> getLroResult(Response activationResponse,
+ Type pollResultType, Type finalResultType, Context context) {
+ return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, () -> activationResponse, context);
+ }
+
/**
* Gets the final result, or an error, based on last async poll response.
*
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 bc7d9a1821f6..bf1466d826d6 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
@@ -8,6 +8,7 @@
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.DataDisk;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplate;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateAutoRun;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer;
@@ -119,6 +120,15 @@ public ImageTemplateVmProfile vmProfile() {
return this.innerModel().vmProfile();
}
+ public List additionalDataDisks() {
+ List inner = this.innerModel().additionalDataDisks();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
public String stagingResourceGroup() {
return this.innerModel().stagingResourceGroup();
}
@@ -320,6 +330,11 @@ public ImageTemplateImpl withVmProfile(ImageTemplateVmProfile vmProfile) {
return this;
}
+ public ImageTemplateImpl withAdditionalDataDisks(List additionalDataDisks) {
+ this.innerModel().withAdditionalDataDisks(additionalDataDisks);
+ return this;
+ }
+
public ImageTemplateImpl withStagingResourceGroup(String stagingResourceGroup) {
this.innerModel().withStagingResourceGroup(stagingResourceGroup);
return this;
@@ -341,6 +356,6 @@ public ImageTemplateImpl withProperties(ImageTemplateUpdateParametersProperties
}
private boolean isInCreateMode() {
- return this.innerModel().id() == null;
+ return this.innerModel() == null || this.innerModel().id() == null;
}
}
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationImpl.java
index e3d40bfdfcf9..03f4bd27ff19 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationImpl.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/OperationImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
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 9ec00fb61863..3cb25ad46853 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
@@ -27,7 +27,7 @@
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.imagebuilder.fluent.OperationsClient;
import com.azure.resourcemanager.imagebuilder.fluent.models.OperationInner;
-import com.azure.resourcemanager.imagebuilder.models.OperationListResult;
+import com.azure.resourcemanager.imagebuilder.implementation.models.OperationListResult;
import reactor.core.publisher.Mono;
/**
@@ -59,14 +59,21 @@ public final class OperationsClientImpl implements OperationsClient {
* The interface defining all the services for ImageBuilderClientOperations to be used by the proxy service to
* perform REST calls.
*/
- @Host("{$host}")
- @ServiceInterface(name = "ImageBuilderClientOp")
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ImageBuilderClientOperations")
public interface OperationsService {
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.VirtualMachineImages/operations")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> list(@HostParam("$host") String endpoint,
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.VirtualMachineImages/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@@ -74,7 +81,14 @@ Mono> list(@HostParam("$host") String endpoint,
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -87,10 +101,6 @@ Mono> listNext(@PathParam(value = "nextLink", enco
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
final String accept = "application/json";
return FluxUtil
.withContext(
@@ -103,24 +113,13 @@ private Mono> listSinglePageAsync() {
/**
* Lists available operations for the Microsoft.VirtualMachineImages provider.
*
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return result of the request to list REST API operations along with {@link PagedResponse} on successful
- * completion of {@link Mono}.
+ * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listSinglePageAsync(Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
}
/**
@@ -128,11 +127,15 @@ 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 as paginated response with {@link PagedFlux}.
+ * @return result of the request to list REST API operations along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync() {
- return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -142,12 +145,15 @@ 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 as paginated response with {@link PagedFlux}.
+ * @return result of the request to list REST API operations along with {@link PagedResponse}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync(Context context) {
- return new PagedFlux<>(() -> listSinglePageAsync(context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
/**
@@ -159,7 +165,7 @@ private PagedFlux listAsync(Context context) {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
- return new PagedIterable<>(listAsync());
+ return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink));
}
/**
@@ -173,7 +179,7 @@ public PagedIterable list() {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
- return new PagedIterable<>(listAsync(context));
+ return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context));
}
/**
@@ -188,13 +194,6 @@ public PagedIterable list(Context context) {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
final String accept = "application/json";
return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
@@ -202,6 +201,24 @@ private Mono> listNextSinglePageAsync(String nextL
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return result of the request to list REST API operations along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -210,22 +227,13 @@ 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 along with {@link PagedResponse} on successful
- * completion of {@link Mono}.
+ * @return result of the request to list REST API operations along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listNextSinglePageAsync(String nextLink, Context context) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
}
diff --git a/sdk/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 a843d6d1fa33..6017016ac145 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ResourceManagerUtils.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ResourceManagerUtils.java
index 49c991f40586..5f147e30905e 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ResourceManagerUtils.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ResourceManagerUtils.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/RunOutputImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/RunOutputImpl.java
index 7f935ce7c6a9..4f4b049842c7 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/RunOutputImpl.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/RunOutputImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggerImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggerImpl.java
index c0e09d7f806e..877e4021701e 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggerImpl.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggerImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersClientImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersClientImpl.java
index aefc1282bf23..15b14fe50285 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersClientImpl.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersClientImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
@@ -27,13 +27,14 @@
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.imagebuilder.fluent.TriggersClient;
import com.azure.resourcemanager.imagebuilder.fluent.models.TriggerInner;
-import com.azure.resourcemanager.imagebuilder.models.TriggerCollection;
+import com.azure.resourcemanager.imagebuilder.implementation.models.TriggerCollection;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -66,208 +67,110 @@ public final class TriggersClientImpl implements TriggersClient {
* The interface defining all the services for ImageBuilderClientTriggers to be used by the proxy service to perform
* REST calls.
*/
- @Host("{$host}")
- @ServiceInterface(name = "ImageBuilderClientTr")
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ImageBuilderClientTriggers")
public interface TriggersService {
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listByImageTemplate(@HostParam("$host") String endpoint,
+ Mono> get(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
- Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
+ @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> get(@HostParam("$host") String endpoint,
+ Response getSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
@HeaderParam("Accept") String accept, Context context);
- @Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> createOrUpdate(@HostParam("$host") String endpoint,
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") TriggerInner parameters, Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response createOrUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") TriggerInner parameters, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
- @BodyParam("application/json") TriggerInner parameters, @HeaderParam("Accept") String accept,
Context context);
- @Headers({ "Content-Type: application/json" })
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers/{triggerName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> delete(@HostParam("$host") String endpoint,
+ Response deleteSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("imageTemplateName") String imageTemplateName, @PathParam("triggerName") String triggerName,
- @HeaderParam("Accept") String accept, Context context);
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByImageTemplate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/triggers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByImageTemplateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByImageTemplateNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, Context context);
- }
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @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 triggers operation along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByImageTemplateSinglePageAsync(String resourceGroupName,
- String imageTemplateName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listByImageTemplate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, context))
- .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
- res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the result of List triggers operation along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByImageTemplateSinglePageAsync(String resourceGroupName,
- String imageTemplateName, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listByImageTemplate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @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 triggers operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByImageTemplateAsync(String resourceGroupName, String imageTemplateName) {
- return new PagedFlux<>(() -> listByImageTemplateSinglePageAsync(resourceGroupName, imageTemplateName),
- nextLink -> listByImageTemplateNextSinglePageAsync(nextLink));
- }
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the result of List triggers operation as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByImageTemplateAsync(String resourceGroupName, String imageTemplateName,
- Context context) {
- return new PagedFlux<>(() -> listByImageTemplateSinglePageAsync(resourceGroupName, imageTemplateName, context),
- nextLink -> listByImageTemplateNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @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 triggers operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName) {
- return new PagedIterable<>(listByImageTemplateAsync(resourceGroupName, imageTemplateName));
- }
-
- /**
- * List all triggers for the specified Image Template resource.
- *
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the result of List triggers operation as paginated response with {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
- Context context) {
- return new PagedIterable<>(listByImageTemplateAsync(resourceGroupName, imageTemplateName, context));
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByImageTemplateNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -279,25 +182,6 @@ public PagedIterable listByImageTemplate(String resourceGroupName,
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String imageTemplateName,
String triggerName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
@@ -308,48 +192,7 @@ private Mono> getWithResponseAsync(String resourceGroupNa
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param triggerName The name of the trigger.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the specified trigger for the specified image template resource along with {@link Response} on successful
- * completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getWithResponseAsync(String resourceGroupName, String imageTemplateName,
- String triggerName, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
- resourceGroupName, imageTemplateName, triggerName, accept, context);
- }
-
- /**
- * Get the specified trigger for the specified image template resource.
- *
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -366,7 +209,7 @@ private Mono getAsync(String resourceGroupName, String imageTempla
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
@@ -378,13 +221,15 @@ private Mono getAsync(String resourceGroupName, String imageTempla
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String imageTemplateName,
String triggerName, Context context) {
- return getWithResponseAsync(resourceGroupName, imageTemplateName, triggerName, context).block();
+ final String accept = "application/json";
+ return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, imageTemplateName, triggerName, accept, context);
}
/**
* Get the specified trigger for the specified image template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -400,7 +245,7 @@ public TriggerInner get(String resourceGroupName, String imageTemplateName, Stri
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -413,115 +258,67 @@ public TriggerInner get(String resourceGroupName, String imageTemplateName, Stri
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String imageTemplateName, String triggerName, TriggerInner parameters) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
+ final String contentType = "application/json";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, parameters, accept,
- context))
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, contentType, accept,
+ parameters, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return represents a trigger that can invoke an image template build along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return represents a trigger that can invoke an image template build along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
- String imageTemplateName, String triggerName, TriggerInner parameters, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
- if (parameters == null) {
- return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
- } else {
- parameters.validate();
- }
+ private Response createOrUpdateWithResponse(String resourceGroupName, String imageTemplateName,
+ String triggerName, TriggerInner parameters) {
+ final String contentType = "application/json";
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, parameters, accept,
- context);
+ return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, contentType, accept,
+ parameters, Context.NONE);
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link PollerFlux} for polling of represents a trigger that can invoke an image template build.
+ * @return represents a trigger that can invoke an image template build along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, TriggerInner> beginCreateOrUpdateAsync(String resourceGroupName,
- String imageTemplateName, String triggerName, TriggerInner parameters) {
- Mono>> mono
- = createOrUpdateWithResponseAsync(resourceGroupName, imageTemplateName, triggerName, parameters);
- return this.client.getLroResult(mono, this.client.getHttpPipeline(),
- TriggerInner.class, TriggerInner.class, this.client.getContext());
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createOrUpdateWithResponse(String resourceGroupName, String imageTemplateName,
+ String triggerName, TriggerInner parameters, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, contentType, accept,
+ parameters, context);
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -529,18 +326,17 @@ private PollerFlux, TriggerInner> beginCreateOrUpdateAs
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, TriggerInner> beginCreateOrUpdateAsync(String resourceGroupName,
- String imageTemplateName, String triggerName, TriggerInner parameters, Context context) {
- context = this.client.mergeContext(context);
+ String imageTemplateName, String triggerName, TriggerInner parameters) {
Mono>> mono
- = createOrUpdateWithResponseAsync(resourceGroupName, imageTemplateName, triggerName, parameters, context);
+ = createOrUpdateWithResponseAsync(resourceGroupName, imageTemplateName, triggerName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
- TriggerInner.class, TriggerInner.class, context);
+ TriggerInner.class, TriggerInner.class, this.client.getContext());
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -552,14 +348,16 @@ private PollerFlux, TriggerInner> beginCreateOrUpdateAs
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName,
String imageTemplateName, String triggerName, TriggerInner parameters) {
- return this.beginCreateOrUpdateAsync(resourceGroupName, imageTemplateName, triggerName, parameters)
- .getSyncPoller();
+ Response response
+ = createOrUpdateWithResponse(resourceGroupName, imageTemplateName, triggerName, parameters);
+ return this.client.getLroResult(response, TriggerInner.class, TriggerInner.class,
+ Context.NONE);
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -572,14 +370,16 @@ public SyncPoller, TriggerInner> beginCreateOrUpdate(St
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, TriggerInner> beginCreateOrUpdate(String resourceGroupName,
String imageTemplateName, String triggerName, TriggerInner parameters, Context context) {
- return this.beginCreateOrUpdateAsync(resourceGroupName, imageTemplateName, triggerName, parameters, context)
- .getSyncPoller();
+ Response response
+ = createOrUpdateWithResponse(resourceGroupName, imageTemplateName, triggerName, parameters, context);
+ return this.client.getLroResult(response, TriggerInner.class, TriggerInner.class,
+ context);
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -598,27 +398,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
- * @param imageTemplateName The name of the image Template.
- * @param triggerName The name of the trigger.
- * @param parameters Parameters supplied to the CreateTrigger operation.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return represents a trigger that can invoke an image template build on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono createOrUpdateAsync(String resourceGroupName, String imageTemplateName,
- String triggerName, TriggerInner parameters, Context context) {
- return beginCreateOrUpdateAsync(resourceGroupName, imageTemplateName, triggerName, parameters, context).last()
- .flatMap(this.client::getLroFinalResultOrError);
- }
-
- /**
- * Create or update a trigger for the specified virtual machine image template.
- *
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -630,13 +410,13 @@ private Mono createOrUpdateAsync(String resourceGroupName, String
@ServiceMethod(returns = ReturnType.SINGLE)
public TriggerInner createOrUpdate(String resourceGroupName, String imageTemplateName, String triggerName,
TriggerInner parameters) {
- return createOrUpdateAsync(resourceGroupName, imageTemplateName, triggerName, parameters).block();
+ return beginCreateOrUpdate(resourceGroupName, imageTemplateName, triggerName, parameters).getFinalResult();
}
/**
* Create or update a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param parameters Parameters supplied to the CreateTrigger operation.
@@ -649,13 +429,14 @@ public TriggerInner createOrUpdate(String resourceGroupName, String imageTemplat
@ServiceMethod(returns = ReturnType.SINGLE)
public TriggerInner createOrUpdate(String resourceGroupName, String imageTemplateName, String triggerName,
TriggerInner parameters, Context context) {
- return createOrUpdateAsync(resourceGroupName, imageTemplateName, triggerName, parameters, context).block();
+ return beginCreateOrUpdate(resourceGroupName, imageTemplateName, triggerName, parameters, context)
+ .getFinalResult();
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -666,99 +447,55 @@ public TriggerInner createOrUpdate(String resourceGroupName, String imageTemplat
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String imageTemplateName,
String triggerName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
- final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
- this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, accept, context))
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link Response} on successful completion of {@link Mono}.
+ * @return the response body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono>> deleteWithResponseAsync(String resourceGroupName, String imageTemplateName,
- String triggerName, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (imageTemplateName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter imageTemplateName is required and cannot be null."));
- }
- if (triggerName == null) {
- return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
- resourceGroupName, imageTemplateName, triggerName, accept, context);
+ private Response deleteWithResponse(String resourceGroupName, String imageTemplateName,
+ String triggerName) {
+ return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, Context.NONE);
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link PollerFlux} for polling of long-running operation.
+ * @return the response body along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageTemplateName,
- String triggerName) {
- Mono>> mono
- = deleteWithResponseAsync(resourceGroupName, imageTemplateName, triggerName);
- return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
- this.client.getContext());
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteWithResponse(String resourceGroupName, String imageTemplateName,
+ String triggerName, Context context) {
+ return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, triggerName, context);
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -766,18 +503,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String imageTemplateName,
- String triggerName, Context context) {
- context = this.client.mergeContext(context);
+ String triggerName) {
Mono>> mono
- = deleteWithResponseAsync(resourceGroupName, imageTemplateName, triggerName, context);
+ = deleteWithResponseAsync(resourceGroupName, imageTemplateName, triggerName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
- context);
+ this.client.getContext());
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -788,13 +524,14 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName,
String triggerName) {
- return this.beginDeleteAsync(resourceGroupName, imageTemplateName, triggerName).getSyncPoller();
+ Response response = deleteWithResponse(resourceGroupName, imageTemplateName, triggerName);
+ return this.client.getLroResult(response, Void.class, Void.class, Context.NONE);
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
@@ -806,13 +543,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName,
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String imageTemplateName,
String triggerName, Context context) {
- return this.beginDeleteAsync(resourceGroupName, imageTemplateName, triggerName, context).getSyncPoller();
+ Response response = deleteWithResponse(resourceGroupName, imageTemplateName, triggerName, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -829,51 +567,148 @@ private Mono deleteAsync(String resourceGroupName, String imageTemplateNam
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono deleteAsync(String resourceGroupName, String imageTemplateName, String triggerName,
- Context context) {
- return beginDeleteAsync(resourceGroupName, imageTemplateName, triggerName, context).last()
- .flatMap(this.client::getLroFinalResultOrError);
+ public void delete(String resourceGroupName, String imageTemplateName, String triggerName) {
+ beginDelete(resourceGroupName, imageTemplateName, triggerName).getFinalResult();
}
/**
* Delete a trigger for the specified virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
* @param triggerName The name of the trigger.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void delete(String resourceGroupName, String imageTemplateName, String triggerName) {
- deleteAsync(resourceGroupName, imageTemplateName, triggerName).block();
+ public void delete(String resourceGroupName, String imageTemplateName, String triggerName, Context context) {
+ beginDelete(resourceGroupName, imageTemplateName, triggerName, context).getFinalResult();
}
/**
- * Delete a trigger for the specified virtual machine image template.
+ * List all triggers for the specified Image Template resource.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @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 triggers operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByImageTemplateSinglePageAsync(String resourceGroupName,
+ String imageTemplateName) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByImageTemplate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @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 triggers operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByImageTemplateAsync(String resourceGroupName, String imageTemplateName) {
+ return new PagedFlux<>(() -> listByImageTemplateSinglePageAsync(resourceGroupName, imageTemplateName),
+ nextLink -> listByImageTemplateNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @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 triggers operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByImageTemplateSinglePage(String resourceGroupName,
+ String imageTemplateName) {
+ final String accept = "application/json";
+ Response res
+ = service.listByImageTemplateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param imageTemplateName The name of the image Template.
- * @param triggerName The name of the trigger.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of List triggers operation along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public void delete(String resourceGroupName, String imageTemplateName, String triggerName, Context context) {
- deleteAsync(resourceGroupName, imageTemplateName, triggerName, context).block();
+ private PagedResponse listByImageTemplateSinglePage(String resourceGroupName,
+ String imageTemplateName, Context context) {
+ final String accept = "application/json";
+ Response res
+ = service.listByImageTemplateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @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 triggers operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName) {
+ return new PagedIterable<>(() -> listByImageTemplateSinglePage(resourceGroupName, imageTemplateName),
+ nextLink -> listByImageTemplateNextSinglePage(nextLink));
+ }
+
+ /**
+ * List all triggers for the specified Image Template resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of List triggers operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
+ Context context) {
+ return new PagedIterable<>(() -> listByImageTemplateSinglePage(resourceGroupName, imageTemplateName, context),
+ nextLink -> listByImageTemplateNextSinglePage(nextLink, context));
}
/**
@@ -888,13 +723,6 @@ public void delete(String resourceGroupName, String imageTemplateName, String tr
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByImageTemplateNextSinglePageAsync(String nextLink) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
final String accept = "application/json";
return FluxUtil
.withContext(
@@ -904,6 +732,24 @@ private Mono> listByImageTemplateNextSinglePageAsync
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of List triggers operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByImageTemplateNextSinglePage(String nextLink) {
+ final String accept = "application/json";
+ Response res
+ = service.listByImageTemplateNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
/**
* Get the next page of items.
*
@@ -912,22 +758,14 @@ private Mono> listByImageTemplateNextSinglePageAsync
* @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 triggers operation along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
+ * @return the result of List triggers operation along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByImageTemplateNextSinglePageAsync(String nextLink, Context context) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
+ private PagedResponse listByImageTemplateNextSinglePage(String nextLink, Context context) {
final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service.listByImageTemplateNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
+ Response res
+ = service.listByImageTemplateNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
}
}
diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersImpl.java b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersImpl.java
index 757d3731ccb0..6de3a4e9e1c4 100644
--- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersImpl.java
+++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/TriggersImpl.java
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
@@ -27,29 +27,12 @@ public TriggersImpl(TriggersClient innerClient,
this.serviceManager = serviceManager;
}
- public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName) {
- PagedIterable inner
- = this.serviceClient().listByImageTemplate(resourceGroupName, imageTemplateName);
- return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager()));
- }
-
- public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
- Context context) {
- PagedIterable inner
- = this.serviceClient().listByImageTemplate(resourceGroupName, imageTemplateName, context);
- return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager()));
- }
-
public Response getWithResponse(String resourceGroupName, String imageTemplateName, String triggerName,
Context context) {
Response inner
= this.serviceClient().getWithResponse(resourceGroupName, imageTemplateName, triggerName, context);
- if (inner != null) {
- return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
- new TriggerImpl(inner.getValue(), this.manager()));
- } else {
- return null;
- }
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new TriggerImpl(inner.getValue(), this.manager()));
}
public Trigger get(String resourceGroupName, String imageTemplateName, String triggerName) {
@@ -69,6 +52,19 @@ public void delete(String resourceGroupName, String imageTemplateName, String tr
this.serviceClient().delete(resourceGroupName, imageTemplateName, triggerName, context);
}
+ public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName) {
+ PagedIterable inner
+ = this.serviceClient().listByImageTemplate(resourceGroupName, imageTemplateName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByImageTemplate(String resourceGroupName, String imageTemplateName,
+ Context context) {
+ PagedIterable inner
+ = this.serviceClient().listByImageTemplate(resourceGroupName, imageTemplateName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggerImpl(inner1, this.manager()));
+ }
+
public Trigger getById(String id) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
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 9a73c45938d1..e0b00e77dd4a 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
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.imagebuilder.implementation;
@@ -29,6 +29,7 @@
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
@@ -36,9 +37,9 @@
import com.azure.resourcemanager.imagebuilder.fluent.VirtualMachineImageTemplatesClient;
import com.azure.resourcemanager.imagebuilder.fluent.models.ImageTemplateInner;
import com.azure.resourcemanager.imagebuilder.fluent.models.RunOutputInner;
-import com.azure.resourcemanager.imagebuilder.models.ImageTemplateListResult;
+import com.azure.resourcemanager.imagebuilder.implementation.models.ImageTemplateListResult;
+import com.azure.resourcemanager.imagebuilder.implementation.models.RunOutputCollection;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateUpdateParameters;
-import com.azure.resourcemanager.imagebuilder.models.RunOutputCollection;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -72,381 +73,319 @@ public final class VirtualMachineImageTemplatesClientImpl implements VirtualMach
* The interface defining all the services for ImageBuilderClientVirtualMachineImageTemplates to be used by the
* proxy service to perform REST calls.
*/
- @Host("{$host}")
- @ServiceInterface(name = "ImageBuilderClientVi")
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ImageBuilderClientVirtualMachineImageTemplates")
public interface VirtualMachineImageTemplatesService {
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> list(@HostParam("$host") String endpoint,
- @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
- @HeaderParam("Accept") String accept, Context context);
+ Mono> getByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listByResourceGroup(@HostParam("$host") String endpoint,
+ Response getByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
- @HeaderParam("Accept") String accept, Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
- @Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> createOrUpdate(@HostParam("$host") String endpoint,
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName,
- @BodyParam("application/json") ImageTemplateInner parameters, @HeaderParam("Accept") String accept,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") ImageTemplateInner parameters,
+ Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response createOrUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") ImageTemplateInner parameters,
Context context);
- @Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> update(@HostParam("$host") String endpoint,
- @PathParam("subscriptionId") String subscriptionId,
+ Mono>> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") ImageTemplateUpdateParameters parameters,
- @HeaderParam("Accept") String accept, Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") ImageTemplateUpdateParameters parameters, Context context);
- @Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
- @ExpectedResponses({ 200 })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
+ @ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> getByResourceGroup(@HostParam("$host") String endpoint,
+ Response updateSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
- Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") ImageTemplateUpdateParameters parameters, Context context);
- @Headers({ "Content-Type: application/json" })
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> delete(@HostParam("$host") String endpoint,
+ Mono>> delete(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response deleteSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.VirtualMachineImages/imageTemplates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/run")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> run(@HostParam("$host") String endpoint,
+ Mono>> run(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
- Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
- @Headers({ "Content-Type: application/json" })
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/run")
+ @ExpectedResponses({ 200, 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response runSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/cancel")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono>> cancel(@HostParam("$host") String endpoint,
+ Mono>> cancel(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
- Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/cancel")
+ @ExpectedResponses({ 200, 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response cancelSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, Context context);
@Headers({ "Content-Type: application/json" })
- @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs/{runOutputName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listRunOutputs(@HostParam("$host") String endpoint,
+ Mono> getRunOutput(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
- Context context);
+ @PathParam("imageTemplateName") String imageTemplateName, @PathParam("runOutputName") String runOutputName,
+ @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs/{runOutputName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> getRunOutput(@HostParam("$host") String endpoint,
+ Response getRunOutputSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("imageTemplateName") String imageTemplateName, @PathParam("runOutputName") String runOutputName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
- @Get("{nextLink}")
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ Mono> listRunOutputs(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}/runOutputs")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listRunOutputsSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("imageTemplateName") String imageTemplateName, @HeaderParam("Accept") String accept,
+ Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroupNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listRunOutputsNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
+ Response listByResourceGroupNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("Accept") String accept, Context context);
- }
-
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return 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() {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(),
- this.client.getApiVersion(), accept, context))
- .>map(res -> new PagedResponseBase<>(res.getRequest(),
- res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return 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) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept,
- context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about the VM image templates associated with the subscription as paginated response with
- * {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAsync() {
- return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
- }
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return 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) {
- return new PagedFlux<>(() -> listSinglePageAsync(context),
- nextLink -> listNextSinglePageAsync(nextLink, context));
- }
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about the VM image templates associated with the subscription as paginated response with
- * {@link PagedIterable}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable list() {
- return new PagedIterable<>(listAsync());
- }
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listRunOutputsNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
- /**
- * Gets information about the VM image templates associated with the subscription.
- *
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return 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) {
- return new PagedIterable<>(listAsync(context));
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listRunOutputsNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
- * Gets information about the VM image templates associated with the specified resource group.
+ * Get information about a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
* @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 along with
- * {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return information about a virtual machine image template along with {@link Response} on successful completion
+ * of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String imageTemplateName) {
final String accept = "application/json";
return FluxUtil
- .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName,
- this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context))
- .>map(res -> new PagedResponseBase<>(res.getRequest(),
- res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, imageTemplateName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Gets information about the VM image templates associated with the specified resource group.
+ * Get information about a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
- * @param context The context to associate with this operation.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
* @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 along with
- * {@link PagedResponse} on successful completion of {@link Mono}.
+ * @return information about a virtual machine image template on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
- Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono.error(
- new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono.error(new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(),
- this.client.getApiVersion(), accept, context)
- .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
- res.getValue().value(), res.getValue().nextLink(), null));
- }
-
- /**
- * Gets information about the VM image templates associated with the specified resource group.
- *
- * @param resourceGroupName The name of the resource group.
- * @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 as paginated
- * response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
- return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
- nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ private Mono getByResourceGroupAsync(String resourceGroupName, String imageTemplateName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, imageTemplateName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
- * Gets information about the VM image templates associated with the specified resource group.
+ * Get information about a virtual machine image template.
*
- * @param resourceGroupName The name of the resource group.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param imageTemplateName The name of the image Template.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return information about the VM image templates associated with the specified resource group as paginated
- * response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux