Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

4,385 changes: 2,195 additions & 2,190 deletions sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class AuthenticationTokenSettings implements JsonSerializable<Authe
* access to all operations related to the Job which contains the Task.
*/
@Generated
private List<AccessScope> access;
private List<BatchAccessScope> access;

/**
* Creates an instance of AuthenticationTokenSettings class.
Expand All @@ -42,7 +42,7 @@ public AuthenticationTokenSettings() {
* @return the access value.
*/
@Generated
public List<AccessScope> getAccess() {
public List<BatchAccessScope> getAccess() {
return this.access;
}

Expand All @@ -55,7 +55,7 @@ public List<AccessScope> getAccess() {
* @return the AuthenticationTokenSettings object itself.
*/
@Generated
public AuthenticationTokenSettings setAccess(List<AccessScope> access) {
public AuthenticationTokenSettings setAccess(List<BatchAccessScope> access) {
this.access = access;
return this;
}
Expand Down Expand Up @@ -88,7 +88,8 @@ public static AuthenticationTokenSettings fromJson(JsonReader jsonReader) throws
String fieldName = reader.getFieldName();
reader.nextToken();
if ("access".equals(fieldName)) {
List<AccessScope> access = reader.readArray(reader1 -> AccessScope.fromString(reader1.getString()));
List<BatchAccessScope> access
= reader.readArray(reader1 -> BatchAccessScope.fromString(reader1.getString()));
deserializedAuthenticationTokenSettings.access = access;
} else {
reader.skipChildren();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ public final class AzureFileShareConfiguration implements JsonSerializable<Azure
* Creates an instance of AzureFileShareConfiguration class.
*
* @param accountName the accountName value to set.
* @param azureFileUrl the azureFileUrl value to set.
* @param accountKey the accountKey value to set.
* @param azureFileUrl the azureFileUrl value to set.
* @param relativeMountPath the relativeMountPath value to set.
*/
@Generated
public AzureFileShareConfiguration(String accountName, String azureFileUrl, String accountKey,
public AzureFileShareConfiguration(String accountName, String accountKey, String azureFileUrl,
String relativeMountPath) {
this.accountName = accountName;
this.azureFileUrl = azureFileUrl;
this.accountKey = accountKey;
this.azureFileUrl = azureFileUrl;
this.relativeMountPath = relativeMountPath;
}

Expand Down Expand Up @@ -141,8 +141,8 @@ public AzureFileShareConfiguration setMountOptions(String mountOptions) {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("accountName", this.accountName);
jsonWriter.writeStringField("azureFileUrl", this.azureFileUrl);
jsonWriter.writeStringField("accountKey", this.accountKey);
jsonWriter.writeStringField("azureFileUrl", this.azureFileUrl);
jsonWriter.writeStringField("relativeMountPath", this.relativeMountPath);
jsonWriter.writeStringField("mountOptions", this.mountOptions);
return jsonWriter.writeEndObject();
Expand All @@ -161,19 +161,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
String accountName = null;
String azureFileUrl = null;
String accountKey = null;
String azureFileUrl = null;
String relativeMountPath = null;
String mountOptions = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("accountName".equals(fieldName)) {
accountName = reader.getString();
} else if ("azureFileUrl".equals(fieldName)) {
azureFileUrl = reader.getString();
} else if ("accountKey".equals(fieldName)) {
accountKey = reader.getString();
} else if ("azureFileUrl".equals(fieldName)) {
azureFileUrl = reader.getString();
} else if ("relativeMountPath".equals(fieldName)) {
relativeMountPath = reader.getString();
} else if ("mountOptions".equals(fieldName)) {
Expand All @@ -183,7 +183,7 @@ public static AzureFileShareConfiguration fromJson(JsonReader jsonReader) throws
}
}
AzureFileShareConfiguration deserializedAzureFileShareConfiguration
= new AzureFileShareConfiguration(accountName, azureFileUrl, accountKey, relativeMountPath);
= new AzureFileShareConfiguration(accountName, accountKey, azureFileUrl, relativeMountPath);
deserializedAzureFileShareConfiguration.mountOptions = mountOptions;
return deserializedAzureFileShareConfiguration;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.compute.batch.models;

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import java.util.Collection;

/**
* BatchAccessScope enums.
*/
public final class BatchAccessScope extends ExpandableStringEnum<BatchAccessScope> {
/**
* Grants access to perform all operations on the Job containing the Task.
*/
@Generated
public static final BatchAccessScope JOB = fromString("job");

/**
* Creates a new instance of BatchAccessScope value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Generated
@Deprecated
public BatchAccessScope() {
}

/**
* Creates or finds a BatchAccessScope from its string representation.
*
* @param name a name to look for.
* @return the corresponding BatchAccessScope.
*/
@Generated
public static BatchAccessScope fromString(String name) {
return fromString(name, BatchAccessScope.class);
}

/**
* Gets known BatchAccessScope values.
*
* @return known BatchAccessScope values.
*/
@Generated
public static Collection<BatchAccessScope> values() {
return values(BatchAccessScope.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.compute.batch.models;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* A locality hint that can be used by the Batch service to select a Compute Node
* on which to start a Task.
*/
@Immutable
public final class BatchAffinityInfo implements JsonSerializable<BatchAffinityInfo> {
/*
* An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the
* affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft
* affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will
* be scheduled elsewhere.
*/
@Generated
private final String affinityId;

/**
* Creates an instance of BatchAffinityInfo class.
*
* @param affinityId the affinityId value to set.
*/
@Generated
public BatchAffinityInfo(String affinityId) {
this.affinityId = affinityId;
}

/**
* Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run
* previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node.
* Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is
* scheduled, then the Task will be scheduled elsewhere.
*
* @return the affinityId value.
*/
@Generated
public String getAffinityId() {
return this.affinityId;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("affinityId", this.affinityId);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of BatchAffinityInfo from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BatchAffinityInfo if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the BatchAffinityInfo.
*/
@Generated
public static BatchAffinityInfo fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
String affinityId = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("affinityId".equals(fieldName)) {
affinityId = reader.getString();
} else {
reader.skipChildren();
}
}
return new BatchAffinityInfo(affinityId);
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.compute.batch.models;

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import java.util.Collection;

/**
* The action the Batch service should take when all Tasks in the Job are in the completed state.
*/
public final class BatchAllTasksCompleteMode extends ExpandableStringEnum<BatchAllTasksCompleteMode> {
/**
* Do nothing. The Job remains active unless terminated or disabled by some other means.
*/
@Generated
public static final BatchAllTasksCompleteMode NO_ACTION = fromString("noaction");

/**
* Terminate the Job. The Job's terminationReason is set to 'AllTasksComplete'.
*/
@Generated
public static final BatchAllTasksCompleteMode TERMINATE_JOB = fromString("terminatejob");

/**
* Creates a new instance of BatchAllTasksCompleteMode value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Generated
@Deprecated
public BatchAllTasksCompleteMode() {
}

/**
* Creates or finds a BatchAllTasksCompleteMode from its string representation.
*
* @param name a name to look for.
* @return the corresponding BatchAllTasksCompleteMode.
*/
@Generated
public static BatchAllTasksCompleteMode fromString(String name) {
return fromString(name, BatchAllTasksCompleteMode.class);
}

/**
* Gets known BatchAllTasksCompleteMode values.
*
* @return known BatchAllTasksCompleteMode values.
*/
@Generated
public static Collection<BatchAllTasksCompleteMode> values() {
return values(BatchAllTasksCompleteMode.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.compute.batch.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import java.time.Duration;

/**
* Optional parameters for Get Application operation.
*/
@Fluent
public final class BatchApplicationGetOptions {
/*
* The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the
* value is larger than 30, the default will be used instead.".
*/
@Generated
private Long timeOutInSeconds;

/**
* Creates an instance of BatchApplicationGetOptions class.
*/
@Generated
public BatchApplicationGetOptions() {
}

/**
* Get the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds.
* The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
*
* @return the timeOutInSeconds value.
*/
@Generated
public Duration getTimeOutInSeconds() {
if (this.timeOutInSeconds == null) {
return null;
}
return Duration.ofSeconds(this.timeOutInSeconds);
}

/**
* Set the timeOutInSeconds property: The maximum time that the server can spend processing the request, in seconds.
* The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
*
* @param timeOutInSeconds the timeOutInSeconds value to set.
* @return the BatchApplicationGetOptions object itself.
*/
@Generated
public BatchApplicationGetOptions setTimeOutInSeconds(Duration timeOutInSeconds) {
if (timeOutInSeconds == null) {
this.timeOutInSeconds = null;
} else {
this.timeOutInSeconds = timeOutInSeconds.getSeconds();
}
return this;
}
}
Loading