Skip to content

Commit 187d233

Browse files
author
SDKAuto
committed
CodeGen from PR 16870 in Azure/azure-rest-api-specs
Merge 060b8c0b612f9682ea4128bbd36a6d1827b1fdbc into b6b834584cb58a3c2cbe887570fa0942b397dfc7
1 parent 94c7e2f commit 187d233

16 files changed

+3528
-972
lines changed

sdk/databox/arm-databox/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 Microsoft
3+
Copyright (c) 2021 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/databox/arm-databox/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Azure DataBoxManagementClient SDK for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for DataBoxManagementClient.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for DataBoxManagementClient.
44

55
### Currently supported environments
66

77
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8-
- Latest versions of Safari, Chrome, Edge, and Firefox.
8+
- Latest versions of Safari, Chrome, Edge and Firefox.
99

1010
### Prerequisites
1111

@@ -21,7 +21,6 @@ Install both packages using the below command:
2121
```bash
2222
npm install --save @azure/arm-databox @azure/identity
2323
```
24-
2524
> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
2625
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
2726

@@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/
3736

3837
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
3938
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
40-
4139
#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.
4240

4341
##### Sample code
@@ -51,7 +49,6 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
5149
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
5250
const creds = new DefaultAzureCredential();
5351
const client = new DataBoxManagementClient(creds, subscriptionId);
54-
5552
client.operations.list().then((result) => {
5653
console.log("The result is:");
5754
console.log(result);
@@ -86,7 +83,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8683
const credential = new InteractiveBrowserCredential(
8784
{
8885
clientId: "<client id for your Azure AD app>",
89-
tenantId: "<optional tenant for your organization>"
86+
tenant: "<optional tenant for your organization>"
9087
});
9188
const client = new Azure.ArmDatabox.DataBoxManagementClient(creds, subscriptionId);
9289
client.operations.list().then((result) => {

sdk/databox/arm-databox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"rollup-plugin-sourcemaps": "^0.4.2",
2828
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/databox/arm-databox",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/databox/arm-databox",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/databox/arm-databox/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const config = {
2121
"@azure/ms-rest-azure-js": "msRestAzure"
2222
},
2323
banner: `/*
24-
* Copyright (c) Microsoft Corporation. All rights reserved.
25-
* Licensed under the MIT License. See License.txt in the project root for license information.
24+
* Copyright (c) Microsoft Corporation.
25+
* Licensed under the MIT License.
2626
*
2727
* Code generated by Microsoft (R) AutoRest Code Generator.
2828
* Changes may cause incorrect behavior and will be lost if the code is regenerated.

sdk/databox/arm-databox/src/dataBoxManagementClient.ts

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for
4-
* license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -12,6 +11,7 @@ import * as msRest from "@azure/ms-rest-js";
1211
import { TokenCredential } from "@azure/core-auth";
1312
import * as Models from "./models";
1413
import * as Mappers from "./models/mappers";
14+
import * as Parameters from "./models/parameters";
1515
import * as operations from "./operations";
1616
import { DataBoxManagementClientContext } from "./dataBoxManagementClientContext";
1717

@@ -39,9 +39,83 @@ class DataBoxManagementClient extends DataBoxManagementClientContext {
3939
this.jobs = new operations.Jobs(this);
4040
this.service = new operations.Service(this);
4141
}
42+
43+
/**
44+
* Request to mitigate for a given job
45+
* @param jobName The name of the job Resource within the specified resource group. job names must
46+
* be between 3 and 24 characters in length and use any alphanumeric and underscore only
47+
* @param resourceGroupName The Resource Group Name
48+
* @param customerResolutionCode Resolution code for the job. Possible values include: 'None',
49+
* 'MoveToCleanUpDevice', 'Resume'
50+
* @param [options] The optional parameters
51+
* @returns Promise<msRest.RestResponse>
52+
*/
53+
mitigate(jobName: string, resourceGroupName: string, customerResolutionCode: Models.CustomerResolutionCode, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
54+
/**
55+
* @param jobName The name of the job Resource within the specified resource group. job names must
56+
* be between 3 and 24 characters in length and use any alphanumeric and underscore only
57+
* @param resourceGroupName The Resource Group Name
58+
* @param customerResolutionCode Resolution code for the job. Possible values include: 'None',
59+
* 'MoveToCleanUpDevice', 'Resume'
60+
* @param callback The callback
61+
*/
62+
mitigate(jobName: string, resourceGroupName: string, customerResolutionCode: Models.CustomerResolutionCode, callback: msRest.ServiceCallback<void>): void;
63+
/**
64+
* @param jobName The name of the job Resource within the specified resource group. job names must
65+
* be between 3 and 24 characters in length and use any alphanumeric and underscore only
66+
* @param resourceGroupName The Resource Group Name
67+
* @param customerResolutionCode Resolution code for the job. Possible values include: 'None',
68+
* 'MoveToCleanUpDevice', 'Resume'
69+
* @param options The optional parameters
70+
* @param callback The callback
71+
*/
72+
mitigate(jobName: string, resourceGroupName: string, customerResolutionCode: Models.CustomerResolutionCode, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
73+
mitigate(jobName: string, resourceGroupName: string, customerResolutionCode: Models.CustomerResolutionCode, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
74+
return this.sendOperationRequest(
75+
{
76+
jobName,
77+
resourceGroupName,
78+
customerResolutionCode,
79+
options
80+
},
81+
mitigateOperationSpec,
82+
callback);
83+
}
4284
}
4385

4486
// Operation Specifications
87+
const serializer = new msRest.Serializer(Mappers);
88+
const mitigateOperationSpec: msRest.OperationSpec = {
89+
httpMethod: "POST",
90+
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate",
91+
urlParameters: [
92+
Parameters.jobName,
93+
Parameters.subscriptionId,
94+
Parameters.resourceGroupName
95+
],
96+
queryParameters: [
97+
Parameters.apiVersion
98+
],
99+
headerParameters: [
100+
Parameters.acceptLanguage
101+
],
102+
requestBody: {
103+
parameterPath: {
104+
customerResolutionCode: "customerResolutionCode"
105+
},
106+
mapper: {
107+
...Mappers.MitigateJobRequest,
108+
required: true
109+
}
110+
},
111+
responses: {
112+
204: {},
113+
default: {
114+
bodyMapper: Mappers.ApiError
115+
}
116+
},
117+
serializer
118+
};
45119

46120
export {
47121
DataBoxManagementClient,

sdk/databox/arm-databox/src/dataBoxManagementClientContext.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for
4-
* license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -10,8 +9,8 @@
109

1110
import * as Models from "./models";
1211
import * as msRest from "@azure/ms-rest-js";
13-
import { TokenCredential } from "@azure/core-auth";
1412
import * as msRestAzure from "@azure/ms-rest-azure-js";
13+
import { TokenCredential } from "@azure/core-auth";
1514

1615
const packageName = "@azure/arm-databox";
1716
const packageVersion = "4.1.1";
@@ -50,7 +49,7 @@ export class DataBoxManagementClientContext extends msRestAzure.AzureServiceClie
5049

5150
super(credentials, options);
5251

53-
this.apiVersion = '2019-09-01';
52+
this.apiVersion = '2021-08-01-preview';
5453
this.acceptLanguage = 'en-US';
5554
this.longRunningOperationRetryTimeout = 30;
5655
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";

0 commit comments

Comments
 (0)