Skip to content

Commit

Permalink
CodeGen from PR 15371 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Fixed breaking change due to order (Azure#15371)
  • Loading branch information
SDKAuto committed Jul 27, 2021
1 parent f5b1f58 commit 9c0c923
Show file tree
Hide file tree
Showing 27 changed files with 1,840 additions and 111 deletions.
2 changes: 1 addition & 1 deletion sdk/batch/batch/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Microsoft
Copyright (c) 2021 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 12 additions & 5 deletions sdk/batch/batch/src/batchServiceClient.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import { TokenCredential } from "@azure/core-auth";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
Expand All @@ -27,14 +27,20 @@ class BatchServiceClient extends BatchServiceClientContext {
jobSchedule: operations.JobSchedule;
task: operations.Task;
computeNode: operations.ComputeNodeOperations;
computeNodeExtension: operations.ComputeNodeExtension;

/**
* Initializes a new instance of the BatchServiceClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param credentials Credentials needed for the client to connect to Azure. Credentials
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
* more information about these credentials, see
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
* @azure/ms-rest-browserauth are also supported.
* @param batchUrl The base URL for all Azure Batch service requests.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, batchUrl: string, options?: msRestAzure.AzureServiceClientOptions) {
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, batchUrl: string, options?: msRest.AzureServiceClientOptions) {
super(credentials, batchUrl, options);
this.application = new operations.Application(this);
this.pool = new operations.Pool(this);
Expand All @@ -45,6 +51,7 @@ class BatchServiceClient extends BatchServiceClientContext {
this.jobSchedule = new operations.JobSchedule(this);
this.task = new operations.Task(this);
this.computeNode = new operations.ComputeNodeOperations(this);
this.computeNodeExtension = new operations.ComputeNodeExtension(this);
}
}

Expand Down
25 changes: 15 additions & 10 deletions sdk/batch/batch/src/batchServiceClientContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
Expand All @@ -10,22 +9,28 @@

import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import { TokenCredential } from "@azure/core-auth";

const packageName = "@azure/batch";
const packageVersion = "8.0.0";

export class BatchServiceClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
credentials: msRest.ServiceClientCredentials | TokenCredential;
apiVersion?: string;
batchUrl: string;

/**
* Initializes a new instance of the BatchServiceClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param credentials Credentials needed for the client to connect to Azure. Credentials
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
* more information about these credentials, see
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
* @azure/ms-rest-browserauth are also supported.
* @param batchUrl The base URL for all Azure Batch service requests.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, batchUrl: string, options?: msRestAzure.AzureServiceClientOptions) {
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, batchUrl: string, options?: msRestAzure.AzureServiceClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
Expand All @@ -36,25 +41,25 @@ export class BatchServiceClientContext extends msRestAzure.AzureServiceClient {
if (!options) {
options = {};
}
if(!options.userAgent) {
if (!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2020-09-01.12.0';
this.apiVersion = '2021-06-01.14.0';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = "{batchUrl}";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.batchUrl = batchUrl;

if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/accountMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/applicationMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/certificateOperationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
20 changes: 20 additions & 0 deletions sdk/batch/batch/src/models/computeNodeExtensionMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
BatchError,
BatchErrorDetail,
ComputeNodeExtensionGetHeaders,
ComputeNodeExtensionListHeaders,
ErrorMessage,
InstanceViewStatus,
NodeVMExtension,
NodeVMExtensionList,
VMExtension,
VMExtensionInstanceView
} from "../models/mappers";
9 changes: 6 additions & 3 deletions sdk/batch/batch/src/models/computeNodeOperationsMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand All @@ -22,6 +22,7 @@ export {
ComputeNodeGetRemoteDesktopHeaders,
ComputeNodeGetRemoteLoginSettingsHeaders,
ComputeNodeGetRemoteLoginSettingsResult,
ComputeNodeIdentityReference,
ComputeNodeListHeaders,
ComputeNodeListResult,
ComputeNodeRebootHeaders,
Expand All @@ -32,6 +33,7 @@ export {
ContainerRegistry,
EnvironmentSetting,
ErrorMessage,
ImageReference,
InboundEndpoint,
NameValuePair,
NodeAgentInformation,
Expand All @@ -49,5 +51,6 @@ export {
TaskInformation,
UploadBatchServiceLogsConfiguration,
UploadBatchServiceLogsResult,
UserIdentity
UserIdentity,
VirtualMachineInfo
} from "../models/mappers";
4 changes: 2 additions & 2 deletions sdk/batch/batch/src/models/fileMappers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
Loading

0 comments on commit 9c0c923

Please sign in to comment.