Skip to content

Commit 0ecb511

Browse files
author
SDKAuto
committed
CodeGen from PR 33408 in Azure/azure-rest-api-specs
Merge c7efb84970ee4aefc931e932b8813f8004bf9851 into a8f625201b3611ee65a832522dba59ae1c287f10
1 parent 3540a6e commit 0ecb511

24 files changed

+1242
-586
lines changed

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

Lines changed: 33 additions & 31 deletions
Large diffs are not rendered by default.

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

Lines changed: 32 additions & 30 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: 63 additions & 57 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+
}

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public final class BatchCertificate implements JsonSerializable<BatchCertificate
8282
* The base64-encoded contents of the Certificate. The maximum size is 10KB.
8383
*/
8484
@Generated
85-
private final String data;
85+
private final byte[] data;
8686

8787
/*
8888
* The format of the Certificate data.
@@ -96,20 +96,6 @@ public final class BatchCertificate implements JsonSerializable<BatchCertificate
9696
@Generated
9797
private String password;
9898

99-
/**
100-
* Creates an instance of BatchCertificate class.
101-
*
102-
* @param thumbprint the thumbprint value to set.
103-
* @param thumbprintAlgorithm the thumbprintAlgorithm value to set.
104-
* @param data the data value to set.
105-
*/
106-
@Generated
107-
public BatchCertificate(String thumbprint, String thumbprintAlgorithm, String data) {
108-
this.thumbprint = thumbprint;
109-
this.thumbprintAlgorithm = thumbprintAlgorithm;
110-
this.data = data;
111-
}
112-
11399
/**
114100
* Get the thumbprint property: The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits
115101
* (it may include spaces but these are removed).
@@ -210,8 +196,8 @@ public DeleteBatchCertificateError getDeleteCertificateError() {
210196
* @return the data value.
211197
*/
212198
@Generated
213-
public String getData() {
214-
return this.data;
199+
public byte[] getData() {
200+
return CoreUtils.clone(this.data);
215201
}
216202

217203
/**
@@ -269,7 +255,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
269255
jsonWriter.writeStartObject();
270256
jsonWriter.writeStringField("thumbprint", this.thumbprint);
271257
jsonWriter.writeStringField("thumbprintAlgorithm", this.thumbprintAlgorithm);
272-
jsonWriter.writeStringField("data", this.data);
258+
jsonWriter.writeBinaryField("data", this.data);
273259
jsonWriter.writeStringField("certificateFormat",
274260
this.certificateFormat == null ? null : this.certificateFormat.toString());
275261
jsonWriter.writeStringField("password", this.password);
@@ -290,7 +276,7 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio
290276
return jsonReader.readObject(reader -> {
291277
String thumbprint = null;
292278
String thumbprintAlgorithm = null;
293-
String data = null;
279+
byte[] data = null;
294280
String url = null;
295281
BatchCertificateState state = null;
296282
OffsetDateTime stateTransitionTime = null;
@@ -308,7 +294,7 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio
308294
} else if ("thumbprintAlgorithm".equals(fieldName)) {
309295
thumbprintAlgorithm = reader.getString();
310296
} else if ("data".equals(fieldName)) {
311-
data = reader.getString();
297+
data = reader.getBinary();
312298
} else if ("url".equals(fieldName)) {
313299
url = reader.getString();
314300
} else if ("state".equals(fieldName)) {
@@ -346,4 +332,18 @@ public static BatchCertificate fromJson(JsonReader jsonReader) throws IOExceptio
346332
return deserializedBatchCertificate;
347333
});
348334
}
335+
336+
/**
337+
* Creates an instance of BatchCertificate class.
338+
*
339+
* @param thumbprint the thumbprint value to set.
340+
* @param thumbprintAlgorithm the thumbprintAlgorithm value to set.
341+
* @param data the data value to set.
342+
*/
343+
@Generated
344+
public BatchCertificate(String thumbprint, String thumbprintAlgorithm, byte[] data) {
345+
this.thumbprint = thumbprint;
346+
this.thumbprintAlgorithm = thumbprintAlgorithm;
347+
this.data = data;
348+
}
349349
}

0 commit comments

Comments
 (0)