Skip to content

Commit f554255

Browse files
author
SDKAuto
committed
CodeGen from PR 33408 in Azure/azure-rest-api-specs
Merge 4479426207813402ff7e3454fbee3023330b2875 into 7fc6689d84858b1c71b786526b04c014c4589968
1 parent fb5612f commit f554255

File tree

152 files changed

+21602
-6105
lines changed

Some content is hidden

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

152 files changed

+21602
-6105
lines changed

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java

Lines changed: 2440 additions & 2431 deletions
Large diffs are not rendered by default.

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java

Lines changed: 2195 additions & 2190 deletions
Large diffs are not rendered by default.

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java

Lines changed: 307 additions & 301 deletions
Large diffs are not rendered by default.

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AuthenticationTokenSettings.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public final class AuthenticationTokenSettings implements JsonSerializable<Authe
2525
* access to all operations related to the Job which contains the Task.
2626
*/
2727
@Generated
28-
private List<AccessScope> access;
28+
private List<BatchAccessScope> access;
2929

3030
/**
3131
* Creates an instance of AuthenticationTokenSettings class.
@@ -42,7 +42,7 @@ public AuthenticationTokenSettings() {
4242
* @return the access value.
4343
*/
4444
@Generated
45-
public List<AccessScope> getAccess() {
45+
public List<BatchAccessScope> getAccess() {
4646
return this.access;
4747
}
4848

@@ -55,7 +55,7 @@ public List<AccessScope> getAccess() {
5555
* @return the AuthenticationTokenSettings object itself.
5656
*/
5757
@Generated
58-
public AuthenticationTokenSettings setAccess(List<AccessScope> access) {
58+
public AuthenticationTokenSettings setAccess(List<BatchAccessScope> access) {
5959
this.access = access;
6060
return this;
6161
}
@@ -88,7 +88,8 @@ public static AuthenticationTokenSettings fromJson(JsonReader jsonReader) throws
8888
String fieldName = reader.getFieldName();
8989
reader.nextToken();
9090
if ("access".equals(fieldName)) {
91-
List<AccessScope> access = reader.readArray(reader1 -> AccessScope.fromString(reader1.getString()));
91+
List<BatchAccessScope> access
92+
= reader.readArray(reader1 -> BatchAccessScope.fromString(reader1.getString()));
9293
deserializedAuthenticationTokenSettings.access = access;
9394
} else {
9495
reader.skipChildren();

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/AzureFileShareConfiguration.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ public final class AzureFileShareConfiguration implements JsonSerializable<Azure
5353
* Creates an instance of AzureFileShareConfiguration class.
5454
*
5555
* @param accountName the accountName value to set.
56-
* @param azureFileUrl the azureFileUrl value to set.
5756
* @param accountKey the accountKey value to set.
57+
* @param azureFileUrl the azureFileUrl value to set.
5858
* @param relativeMountPath the relativeMountPath value to set.
5959
*/
6060
@Generated
61-
public AzureFileShareConfiguration(String accountName, String azureFileUrl, String accountKey,
61+
public AzureFileShareConfiguration(String accountName, String accountKey, String azureFileUrl,
6262
String relativeMountPath) {
6363
this.accountName = accountName;
64-
this.azureFileUrl = azureFileUrl;
6564
this.accountKey = accountKey;
65+
this.azureFileUrl = azureFileUrl;
6666
this.relativeMountPath = relativeMountPath;
6767
}
6868

@@ -141,8 +141,8 @@ public AzureFileShareConfiguration setMountOptions(String mountOptions) {
141141
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
142142
jsonWriter.writeStartObject();
143143
jsonWriter.writeStringField("accountName", this.accountName);
144-
jsonWriter.writeStringField("azureFileUrl", this.azureFileUrl);
145144
jsonWriter.writeStringField("accountKey", this.accountKey);
145+
jsonWriter.writeStringField("azureFileUrl", this.azureFileUrl);
146146
jsonWriter.writeStringField("relativeMountPath", this.relativeMountPath);
147147
jsonWriter.writeStringField("mountOptions", this.mountOptions);
148148
return jsonWriter.writeEndObject();
@@ -161,19 +161,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
161161
public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws IOException {
162162
return jsonReader.readObject(reader -> {
163163
String accountName = null;
164-
String azureFileUrl = null;
165164
String accountKey = null;
165+
String azureFileUrl = null;
166166
String relativeMountPath = null;
167167
String mountOptions = null;
168168
while (reader.nextToken() != JsonToken.END_OBJECT) {
169169
String fieldName = reader.getFieldName();
170170
reader.nextToken();
171171
if ("accountName".equals(fieldName)) {
172172
accountName = reader.getString();
173-
} else if ("azureFileUrl".equals(fieldName)) {
174-
azureFileUrl = reader.getString();
175173
} else if ("accountKey".equals(fieldName)) {
176174
accountKey = reader.getString();
175+
} else if ("azureFileUrl".equals(fieldName)) {
176+
azureFileUrl = reader.getString();
177177
} else if ("relativeMountPath".equals(fieldName)) {
178178
relativeMountPath = reader.getString();
179179
} else if ("mountOptions".equals(fieldName)) {
@@ -183,7 +183,7 @@ public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws
183183
}
184184
}
185185
AzureFileShareConfiguration deserializedAzureFileShareConfiguration
186-
= new AzureFileShareConfiguration(accountName, azureFileUrl, accountKey, relativeMountPath);
186+
= new AzureFileShareConfiguration(accountName, accountKey, azureFileUrl, relativeMountPath);
187187
deserializedAzureFileShareConfiguration.mountOptions = mountOptions;
188188
return deserializedAzureFileShareConfiguration;
189189
});
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.compute.batch.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.util.ExpandableStringEnum;
9+
import java.util.Collection;
10+
11+
/**
12+
* BatchAccessScope enums.
13+
*/
14+
public final class BatchAccessScope extends ExpandableStringEnum<BatchAccessScope> {
15+
/**
16+
* Grants access to perform all operations on the Job containing the Task.
17+
*/
18+
@Generated
19+
public static final BatchAccessScope JOB = fromString("job");
20+
21+
/**
22+
* Creates a new instance of BatchAccessScope value.
23+
*
24+
* @deprecated Use the {@link #fromString(String)} factory method.
25+
*/
26+
@Generated
27+
@Deprecated
28+
public BatchAccessScope() {
29+
}
30+
31+
/**
32+
* Creates or finds a BatchAccessScope from its string representation.
33+
*
34+
* @param name a name to look for.
35+
* @return the corresponding BatchAccessScope.
36+
*/
37+
@Generated
38+
public static BatchAccessScope fromString(String name) {
39+
return fromString(name, BatchAccessScope.class);
40+
}
41+
42+
/**
43+
* Gets known BatchAccessScope values.
44+
*
45+
* @return known BatchAccessScope values.
46+
*/
47+
@Generated
48+
public static Collection<BatchAccessScope> values() {
49+
return values(BatchAccessScope.class);
50+
}
51+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.compute.batch.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
15+
/**
16+
* A locality hint that can be used by the Batch service to select a Compute Node
17+
* on which to start a Task.
18+
*/
19+
@Immutable
20+
public final class BatchAffinityInfo implements JsonSerializable<BatchAffinityInfo> {
21+
/*
22+
* An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the
23+
* affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft
24+
* affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will
25+
* be scheduled elsewhere.
26+
*/
27+
@Generated
28+
private final String affinityId;
29+
30+
/**
31+
* Creates an instance of BatchAffinityInfo class.
32+
*
33+
* @param affinityId the affinityId value to set.
34+
*/
35+
@Generated
36+
public BatchAffinityInfo(String affinityId) {
37+
this.affinityId = affinityId;
38+
}
39+
40+
/**
41+
* Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run
42+
* previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node.
43+
* Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is
44+
* scheduled, then the Task will be scheduled elsewhere.
45+
*
46+
* @return the affinityId value.
47+
*/
48+
@Generated
49+
public String getAffinityId() {
50+
return this.affinityId;
51+
}
52+
53+
/**
54+
* {@inheritDoc}
55+
*/
56+
@Generated
57+
@Override
58+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
59+
jsonWriter.writeStartObject();
60+
jsonWriter.writeStringField("affinityId", this.affinityId);
61+
return jsonWriter.writeEndObject();
62+
}
63+
64+
/**
65+
* Reads an instance of BatchAffinityInfo from the JsonReader.
66+
*
67+
* @param jsonReader The JsonReader being read.
68+
* @return An instance of BatchAffinityInfo if the JsonReader was pointing to an instance of it, or null if it was
69+
* pointing to JSON null.
70+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
71+
* @throws IOException If an error occurs while reading the BatchAffinityInfo.
72+
*/
73+
@Generated
74+
public static BatchAffinityInfo fromJson(JsonReader jsonReader) throws IOException {
75+
return jsonReader.readObject(reader -> {
76+
String affinityId = null;
77+
while (reader.nextToken() != JsonToken.END_OBJECT) {
78+
String fieldName = reader.getFieldName();
79+
reader.nextToken();
80+
81+
if ("affinityId".equals(fieldName)) {
82+
affinityId = reader.getString();
83+
} else {
84+
reader.skipChildren();
85+
}
86+
}
87+
return new BatchAffinityInfo(affinityId);
88+
});
89+
}
90+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.compute.batch.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.util.ExpandableStringEnum;
9+
import java.util.Collection;
10+
11+
/**
12+
* The action the Batch service should take when all Tasks in the Job are in the completed state.
13+
*/
14+
public final class BatchAllTasksCompleteMode extends ExpandableStringEnum<BatchAllTasksCompleteMode> {
15+
/**
16+
* Do nothing. The Job remains active unless terminated or disabled by some other means.
17+
*/
18+
@Generated
19+
public static final BatchAllTasksCompleteMode NO_ACTION = fromString("noaction");
20+
21+
/**
22+
* Terminate the Job. The Job's terminationReason is set to 'AllTasksComplete'.
23+
*/
24+
@Generated
25+
public static final BatchAllTasksCompleteMode TERMINATE_JOB = fromString("terminatejob");
26+
27+
/**
28+
* Creates a new instance of BatchAllTasksCompleteMode value.
29+
*
30+
* @deprecated Use the {@link #fromString(String)} factory method.
31+
*/
32+
@Generated
33+
@Deprecated
34+
public BatchAllTasksCompleteMode() {
35+
}
36+
37+
/**
38+
* Creates or finds a BatchAllTasksCompleteMode from its string representation.
39+
*
40+
* @param name a name to look for.
41+
* @return the corresponding BatchAllTasksCompleteMode.
42+
*/
43+
@Generated
44+
public static BatchAllTasksCompleteMode fromString(String name) {
45+
return fromString(name, BatchAllTasksCompleteMode.class);
46+
}
47+
48+
/**
49+
* Gets known BatchAllTasksCompleteMode values.
50+
*
51+
* @return known BatchAllTasksCompleteMode values.
52+
*/
53+
@Generated
54+
public static Collection<BatchAllTasksCompleteMode> values() {
55+
return values(BatchAllTasksCompleteMode.class);
56+
}
57+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.compute.batch.models;
6+
7+
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.annotation.Generated;
9+
import java.time.Duration;
10+
11+
/**
12+
* Optional parameters for Get Application operation.
13+
*/
14+
@Fluent
15+
public final class BatchApplicationGetOptions {
16+
/*
17+
* The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the
18+
* value is larger than 30, the default will be used instead.".
19+
*/
20+
@Generated
21+
private Long timeOutInSeconds;
22+
23+
/**
24+
* Creates an instance of BatchApplicationGetOptions class.
25+
*/
26+
@Generated
27+
public BatchApplicationGetOptions() {
28+
}
29+
30+
/**
31+
* Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds.
32+
* The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
33+
*
34+
* @return the timeOutInSeconds value.
35+
*/
36+
@Generated
37+
public Duration getTimeOutInSeconds() {
38+
if (this.timeOutInSeconds == null) {
39+
return null;
40+
}
41+
return Duration.ofSeconds(this.timeOutInSeconds);
42+
}
43+
44+
/**
45+
* Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds.
46+
* The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
47+
*
48+
* @param timeOutInSeconds the timeOutInSeconds value to set.
49+
* @return the BatchApplicationGetOptions object itself.
50+
*/
51+
@Generated
52+
public BatchApplicationGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) {
53+
if (timeOutInSeconds == null) {
54+
this.timeOutInSeconds = null;
55+
} else {
56+
this.timeOutInSeconds = timeOutInSeconds.getSeconds();
57+
}
58+
return this;
59+
}
60+
}

0 commit comments

Comments
 (0)