Skip to content

Commit ac60ff8

Browse files
author
SDKAuto
committed
CodeGen from PR 28896 in Azure/azure-rest-api-specs
Merge 933d7ea926e53e952aea780c31eaca480d18bd9e into dc27f9b32787533cd4d07fe0de5245f2f8354dbe
1 parent ca4f681 commit ac60ff8

109 files changed

Lines changed: 1346 additions & 1997 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/imagebuilder/azure-resourcemanager-imagebuilder/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.1.0-beta.1 (Unreleased)
3+
## 1.0.0-beta.1 (2024-05-30)
4+
5+
- 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).
46

57
### Features Added
68

sdk/imagebuilder/azure-resourcemanager-imagebuilder/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager ImageBuilder client library for Java.
44

5-
This package contains Microsoft Azure SDK for ImageBuilder Management SDK. Azure Virtual Machine Image Builder Client. Package tag package-2023-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
5+
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).
66

77
## We'd love to hear your feedback
88

@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-imagebuilder</artifactId>
35-
<version>1.0.0</version>
35+
<version>1.1.0-beta.1</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/imagebuilder/azure-resourcemanager-imagebuilder/SAMPLE.md

Lines changed: 162 additions & 39 deletions
Large diffs are not rendered by default.

sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<packaging>jar</packaging>
1919

2020
<name>Microsoft Azure SDK for ImageBuilder Management</name>
21-
<description>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-2023-07.</description>
21+
<description>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.</description>
2222
<url>https://github.com/Azure/azure-sdk-for-java</url>
2323

2424
<licenses>
@@ -45,6 +45,7 @@
4545
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4646
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
4747
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
48+
<revapi.skip>true</revapi.skip>
4849
</properties>
4950
<dependencies>
5051
<dependency>
@@ -60,7 +61,7 @@
6061
<dependency>
6162
<groupId>com.azure</groupId>
6263
<artifactId>azure-core-test</artifactId>
63-
<version>1.26.0-beta.1</version> <!-- {x-version-update;unreleased_com.azure:azure-core-test;dependency} -->
64+
<version>1.25.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
6465
<scope>test</scope>
6566
</dependency>
6667
<dependency>

sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/ImageBuilderManager.java

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
1313
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
14-
import com.azure.core.http.policy.HttpLogOptions;
1514
import com.azure.core.http.policy.HttpLoggingPolicy;
15+
import com.azure.core.http.policy.HttpLogOptions;
1616
import com.azure.core.http.policy.HttpPipelinePolicy;
1717
import com.azure.core.http.policy.HttpPolicyProviders;
1818
import com.azure.core.http.policy.RequestIdPolicy;
@@ -55,8 +55,10 @@ private ImageBuilderManager(HttpPipeline httpPipeline, AzureProfile profile, Dur
5555
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
5656
Objects.requireNonNull(profile, "'profile' cannot be null.");
5757
this.clientObject = new ImageBuilderClientBuilder().pipeline(httpPipeline)
58-
.endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
59-
.defaultPollInterval(defaultPollInterval).buildClient();
58+
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
59+
.subscriptionId(profile.getSubscriptionId())
60+
.defaultPollInterval(defaultPollInterval)
61+
.buildClient();
6062
}
6163

6264
/**
@@ -207,12 +209,19 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile
207209
Objects.requireNonNull(profile, "'profile' cannot be null.");
208210

209211
StringBuilder userAgentBuilder = new StringBuilder();
210-
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.imagebuilder")
211-
.append("/").append("1.0.0");
212+
userAgentBuilder.append("azsdk-java")
213+
.append("-")
214+
.append("com.azure.resourcemanager.imagebuilder")
215+
.append("/")
216+
.append("1.0.0-beta.1");
212217
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
213-
userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
214-
.append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")
215-
.append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)");
218+
userAgentBuilder.append(" (")
219+
.append(Configuration.getGlobalConfiguration().get("java.version"))
220+
.append("; ")
221+
.append(Configuration.getGlobalConfiguration().get("os.name"))
222+
.append("; ")
223+
.append(Configuration.getGlobalConfiguration().get("os.version"))
224+
.append("; auto-generated)");
216225
} else {
217226
userAgentBuilder.append(" (auto-generated)");
218227
}
@@ -231,18 +240,21 @@ public ImageBuilderManager authenticate(TokenCredential credential, AzureProfile
231240
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
232241
policies.add(new AddHeadersFromContextPolicy());
233242
policies.add(new RequestIdPolicy());
234-
policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
243+
policies.addAll(this.policies.stream()
244+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
235245
.collect(Collectors.toList()));
236246
HttpPolicyProviders.addBeforeRetryPolicies(policies);
237247
policies.add(retryPolicy);
238248
policies.add(new AddDatePolicy());
239249
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
240250
policies.addAll(this.policies.stream()
241-
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList()));
251+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
252+
.collect(Collectors.toList()));
242253
HttpPolicyProviders.addAfterRetryPolicies(policies);
243254
policies.add(new HttpLoggingPolicy(httpLogOptions));
244255
HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
245-
.policies(policies.toArray(new HttpPipelinePolicy[0])).build();
256+
.policies(policies.toArray(new HttpPipelinePolicy[0]))
257+
.build();
246258
return new ImageBuilderManager(httpPipeline, profile, defaultPollInterval);
247259
}
248260
}

sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateInner.java

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.azure.core.management.Resource;
99
import com.azure.core.management.SystemData;
1010
import com.azure.core.util.logging.ClientLogger;
11+
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateAutoRun;
1112
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer;
1213
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor;
1314
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateIdentity;
@@ -371,6 +372,56 @@ public String exactStagingResourceGroup() {
371372
return this.innerProperties() == null ? null : this.innerProperties().exactStagingResourceGroup();
372373
}
373374

375+
/**
376+
* Get the autoRun property: Indicates whether or not to automatically run the image template build on template
377+
* creation or update.
378+
*
379+
* @return the autoRun value.
380+
*/
381+
public ImageTemplateAutoRun autoRun() {
382+
return this.innerProperties() == null ? null : this.innerProperties().autoRun();
383+
}
384+
385+
/**
386+
* Set the autoRun property: Indicates whether or not to automatically run the image template build on template
387+
* creation or update.
388+
*
389+
* @param autoRun the autoRun value to set.
390+
* @return the ImageTemplateInner object itself.
391+
*/
392+
public ImageTemplateInner withAutoRun(ImageTemplateAutoRun autoRun) {
393+
if (this.innerProperties() == null) {
394+
this.innerProperties = new ImageTemplateProperties();
395+
}
396+
this.innerProperties().withAutoRun(autoRun);
397+
return this;
398+
}
399+
400+
/**
401+
* Get the managedResourceTags property: Tags that will be applied to the resource group and/or resources created by
402+
* the service.
403+
*
404+
* @return the managedResourceTags value.
405+
*/
406+
public Map<String, String> managedResourceTags() {
407+
return this.innerProperties() == null ? null : this.innerProperties().managedResourceTags();
408+
}
409+
410+
/**
411+
* Set the managedResourceTags property: Tags that will be applied to the resource group and/or resources created by
412+
* the service.
413+
*
414+
* @param managedResourceTags the managedResourceTags value to set.
415+
* @return the ImageTemplateInner object itself.
416+
*/
417+
public ImageTemplateInner withManagedResourceTags(Map<String, String> managedResourceTags) {
418+
if (this.innerProperties() == null) {
419+
this.innerProperties = new ImageTemplateProperties();
420+
}
421+
this.innerProperties().withManagedResourceTags(managedResourceTags);
422+
return this;
423+
}
424+
374425
/**
375426
* Validates the instance.
376427
*
@@ -381,8 +432,8 @@ public void validate() {
381432
innerProperties().validate();
382433
}
383434
if (identity() == null) {
384-
throw LOGGER.logExceptionAsError(
385-
new IllegalArgumentException("Missing required property identity in model ImageTemplateInner"));
435+
throw LOGGER.atError()
436+
.log(new IllegalArgumentException("Missing required property identity in model ImageTemplateInner"));
386437
} else {
387438
identity().validate();
388439
}

sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/fluent/models/ImageTemplateProperties.java

Lines changed: 71 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.util.logging.ClientLogger;
9+
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateAutoRun;
910
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer;
1011
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateDistributor;
1112
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateLastRunStatus;
@@ -16,8 +17,10 @@
1617
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateVmProfile;
1718
import com.azure.resourcemanager.imagebuilder.models.ProvisioningError;
1819
import com.azure.resourcemanager.imagebuilder.models.ProvisioningState;
20+
import com.fasterxml.jackson.annotation.JsonInclude;
1921
import com.fasterxml.jackson.annotation.JsonProperty;
2022
import java.util.List;
23+
import java.util.Map;
2124

2225
/**
2326
* Describes the properties of an image template.
@@ -79,8 +82,7 @@ public final class ImageTemplateProperties {
7982
private ImageTemplateLastRunStatus lastRunStatus;
8083

8184
/*
82-
* Maximum duration to wait while building the image template (includes all customizations, optimization,
83-
* validations, and distributions). Omit or specify 0 to use the default (4 hours).
85+
* Maximum duration to wait while building the image template (includes all customizations, optimization, validations, and distributions). Omit or specify 0 to use the default (4 hours).
8486
*/
8587
@JsonProperty(value = "buildTimeoutInMinutes")
8688
private Integer buildTimeoutInMinutes;
@@ -92,25 +94,30 @@ public final class ImageTemplateProperties {
9294
private ImageTemplateVmProfile vmProfile;
9395

9496
/*
95-
* The staging resource group id in the same subscription as the image template that will be used to build the
96-
* image. If this field is empty, a resource group with a random name will be created. If the resource group
97-
* specified in this field doesn't exist, it will be created with the same name. If the resource group specified
98-
* exists, it must be empty and in the same region as the image template. The resource group created will be
99-
* deleted during template deletion if this field is empty or the resource group specified doesn't exist, but if
100-
* the resource group specified exists the resources created in the resource group will be deleted during template
101-
* deletion and the resource group itself will remain.
97+
* The staging resource group id in the same subscription as the image template that will be used to build the image. If this field is empty, a resource group with a random name will be created. If the resource group specified in this field doesn't exist, it will be created with the same name. If the resource group specified exists, it must be empty and in the same region as the image template. The resource group created will be deleted during template deletion if this field is empty or the resource group specified doesn't exist, but if the resource group specified exists the resources created in the resource group will be deleted during template deletion and the resource group itself will remain.
10298
*/
10399
@JsonProperty(value = "stagingResourceGroup")
104100
private String stagingResourceGroup;
105101

106102
/*
107-
* The staging resource group id in the same subscription as the image template that will be used to build the
108-
* image. This read-only field differs from 'stagingResourceGroup' only if the value specified in the
109-
* 'stagingResourceGroup' field is empty.
103+
* The staging resource group id in the same subscription as the image template that will be used to build the image. This read-only field differs from 'stagingResourceGroup' only if the value specified in the 'stagingResourceGroup' field is empty.
110104
*/
111105
@JsonProperty(value = "exactStagingResourceGroup", access = JsonProperty.Access.WRITE_ONLY)
112106
private String exactStagingResourceGroup;
113107

108+
/*
109+
* Indicates whether or not to automatically run the image template build on template creation or update.
110+
*/
111+
@JsonProperty(value = "autoRun")
112+
private ImageTemplateAutoRun autoRun;
113+
114+
/*
115+
* Tags that will be applied to the resource group and/or resources created by the service.
116+
*/
117+
@JsonProperty(value = "managedResourceTags")
118+
@JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
119+
private Map<String, String> managedResourceTags;
120+
114121
/**
115122
* Creates an instance of ImageTemplateProperties class.
116123
*/
@@ -353,15 +360,59 @@ public String exactStagingResourceGroup() {
353360
return this.exactStagingResourceGroup;
354361
}
355362

363+
/**
364+
* Get the autoRun property: Indicates whether or not to automatically run the image template build on template
365+
* creation or update.
366+
*
367+
* @return the autoRun value.
368+
*/
369+
public ImageTemplateAutoRun autoRun() {
370+
return this.autoRun;
371+
}
372+
373+
/**
374+
* Set the autoRun property: Indicates whether or not to automatically run the image template build on template
375+
* creation or update.
376+
*
377+
* @param autoRun the autoRun value to set.
378+
* @return the ImageTemplateProperties object itself.
379+
*/
380+
public ImageTemplateProperties withAutoRun(ImageTemplateAutoRun autoRun) {
381+
this.autoRun = autoRun;
382+
return this;
383+
}
384+
385+
/**
386+
* Get the managedResourceTags property: Tags that will be applied to the resource group and/or resources created by
387+
* the service.
388+
*
389+
* @return the managedResourceTags value.
390+
*/
391+
public Map<String, String> managedResourceTags() {
392+
return this.managedResourceTags;
393+
}
394+
395+
/**
396+
* Set the managedResourceTags property: Tags that will be applied to the resource group and/or resources created by
397+
* the service.
398+
*
399+
* @param managedResourceTags the managedResourceTags value to set.
400+
* @return the ImageTemplateProperties object itself.
401+
*/
402+
public ImageTemplateProperties withManagedResourceTags(Map<String, String> managedResourceTags) {
403+
this.managedResourceTags = managedResourceTags;
404+
return this;
405+
}
406+
356407
/**
357408
* Validates the instance.
358409
*
359410
* @throws IllegalArgumentException thrown if the instance is not valid.
360411
*/
361412
public void validate() {
362413
if (source() == null) {
363-
throw LOGGER.logExceptionAsError(
364-
new IllegalArgumentException("Missing required property source in model ImageTemplateProperties"));
414+
throw LOGGER.atError()
415+
.log(new IllegalArgumentException("Missing required property source in model ImageTemplateProperties"));
365416
} else {
366417
source().validate();
367418
}
@@ -375,8 +426,9 @@ public void validate() {
375426
validation().validate();
376427
}
377428
if (distribute() == null) {
378-
throw LOGGER.logExceptionAsError(
379-
new IllegalArgumentException("Missing required property distribute in model ImageTemplateProperties"));
429+
throw LOGGER.atError()
430+
.log(new IllegalArgumentException(
431+
"Missing required property distribute in model ImageTemplateProperties"));
380432
} else {
381433
distribute().forEach(e -> e.validate());
382434
}
@@ -392,6 +444,9 @@ public void validate() {
392444
if (vmProfile() != null) {
393445
vmProfile().validate();
394446
}
447+
if (autoRun() != null) {
448+
autoRun().validate();
449+
}
395450
}
396451

397452
private static final ClientLogger LOGGER = new ClientLogger(ImageTemplateProperties.class);

sdk/imagebuilder/azure-resourcemanager-imagebuilder/src/main/java/com/azure/resourcemanager/imagebuilder/implementation/ImageBuilderClientBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
@ServiceClientBuilder(serviceClients = { ImageBuilderClientImpl.class })
2121
public final class ImageBuilderClientBuilder {
2222
/*
23-
* Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of
24-
* the URI for every service call.
23+
* Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription Id forms part of the URI for every service call.
2524
*/
2625
private String subscriptionId;
2726

@@ -125,11 +124,13 @@ public ImageBuilderClientBuilder serializerAdapter(SerializerAdapter serializerA
125124
public ImageBuilderClientImpl buildClient() {
126125
String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
127126
AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
128-
HttpPipeline localPipeline = (pipeline != null) ? pipeline
127+
HttpPipeline localPipeline = (pipeline != null)
128+
? pipeline
129129
: new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
130130
Duration localDefaultPollInterval
131131
= (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
132-
SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter
132+
SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
133+
? serializerAdapter
133134
: SerializerFactory.createDefaultManagementSerializerAdapter();
134135
ImageBuilderClientImpl client = new ImageBuilderClientImpl(localPipeline, localSerializerAdapter,
135136
localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);

0 commit comments

Comments
 (0)