@azure/arm-databox 3.0.0 → 5.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +72 -73
  4. package/dist/index.js +5592 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/dataBoxManagementClient.d.ts +29 -0
  9. package/dist-esm/src/dataBoxManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/dataBoxManagementClient.js +89 -0
  11. package/dist-esm/src/dataBoxManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +2157 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +168 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +163 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/dist-esm/src/models/mappers.js +3911 -0
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +24 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +176 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  33. package/dist-esm/src/operations/index.d.ts.map +1 -0
  34. package/dist-esm/src/operations/index.js +11 -0
  35. package/dist-esm/src/operations/index.js.map +1 -0
  36. package/dist-esm/src/operations/jobs.d.ts +161 -0
  37. package/dist-esm/src/operations/jobs.d.ts.map +1 -0
  38. package/dist-esm/src/operations/jobs.js +687 -0
  39. package/dist-esm/src/operations/jobs.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +32 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +120 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operations/service.d.ts +83 -0
  45. package/dist-esm/src/operations/service.d.ts.map +1 -0
  46. package/dist-esm/src/operations/service.js +307 -0
  47. package/dist-esm/src/operations/service.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  49. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  51. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/jobs.d.ts +115 -0
  53. package/dist-esm/src/operationsInterfaces/jobs.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/jobs.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/jobs.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  57. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/service.d.ts +54 -0
  61. package/dist-esm/src/operationsInterfaces/service.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/service.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/service.js.map +1 -0
  64. package/dist-esm/test/sampleTest.d.ts +2 -0
  65. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  66. package/dist-esm/test/sampleTest.js +40 -0
  67. package/dist-esm/test/sampleTest.js.map +1 -0
  68. package/package.json +65 -31
  69. package/review/arm-databox.api.md +1376 -0
  70. package/rollup.config.js +181 -30
  71. package/src/dataBoxManagementClient.ts +113 -29
  72. package/src/index.ts +12 -0
  73. package/src/lroImpl.ts +34 -0
  74. package/src/models/index.ts +1924 -1354
  75. package/src/models/mappers.ts +3160 -1086
  76. package/src/models/parameters.ts +144 -54
  77. package/src/operations/index.ts +3 -5
  78. package/src/operations/jobs.ts +702 -480
  79. package/src/operations/operations.ts +89 -75
  80. package/src/operations/service.ts +342 -127
  81. package/src/operationsInterfaces/index.ts +11 -0
  82. package/src/operationsInterfaces/jobs.ts +205 -0
  83. package/src/operationsInterfaces/operations.ts +22 -0
  84. package/src/operationsInterfaces/service.ts +107 -0
  85. package/tsconfig.json +3 -3
  86. package/types/arm-databox.d.ts +2558 -0
  87. package/types/tsdoc-metadata.json +11 -0
  88. package/dist/arm-databox.js +0 -3090
  89. package/dist/arm-databox.js.map +0 -1
  90. package/dist/arm-databox.min.js +0 -1
  91. package/dist/arm-databox.min.js.map +0 -1
  92. package/esm/dataBoxManagementClient.d.ts +0 -20
  93. package/esm/dataBoxManagementClient.d.ts.map +0 -1
  94. package/esm/dataBoxManagementClient.js +0 -35
  95. package/esm/dataBoxManagementClient.js.map +0 -1
  96. package/esm/dataBoxManagementClientContext.d.ts +0 -16
  97. package/esm/dataBoxManagementClientContext.d.ts.map +0 -1
  98. package/esm/dataBoxManagementClientContext.js +0 -57
  99. package/esm/dataBoxManagementClientContext.js.map +0 -1
  100. package/esm/models/index.d.ts +0 -1754
  101. package/esm/models/index.d.ts.map +0 -1
  102. package/esm/models/index.js +0 -8
  103. package/esm/models/index.js.map +0 -1
  104. package/esm/models/jobsMappers.d.ts +0 -2
  105. package/esm/models/jobsMappers.d.ts.map +0 -1
  106. package/esm/models/jobsMappers.js +0 -9
  107. package/esm/models/jobsMappers.js.map +0 -1
  108. package/esm/models/mappers.d.ts +0 -75
  109. package/esm/models/mappers.d.ts.map +0 -1
  110. package/esm/models/mappers.js +0 -2020
  111. package/esm/models/mappers.js.map +0 -1
  112. package/esm/models/operationsMappers.d.ts +0 -2
  113. package/esm/models/operationsMappers.d.ts.map +0 -1
  114. package/esm/models/operationsMappers.js +0 -9
  115. package/esm/models/operationsMappers.js.map +0 -1
  116. package/esm/models/parameters.d.ts +0 -12
  117. package/esm/models/parameters.d.ts.map +0 -1
  118. package/esm/models/parameters.js +0 -122
  119. package/esm/models/parameters.js.map +0 -1
  120. package/esm/models/serviceMappers.d.ts +0 -2
  121. package/esm/models/serviceMappers.d.ts.map +0 -1
  122. package/esm/models/serviceMappers.js +0 -9
  123. package/esm/models/serviceMappers.js.map +0 -1
  124. package/esm/operations/index.d.ts.map +0 -1
  125. package/esm/operations/index.js +0 -13
  126. package/esm/operations/index.js.map +0 -1
  127. package/esm/operations/jobs.d.ts +0 -245
  128. package/esm/operations/jobs.d.ts.map +0 -1
  129. package/esm/operations/jobs.js +0 -444
  130. package/esm/operations/jobs.js.map +0 -1
  131. package/esm/operations/operations.d.ts +0 -46
  132. package/esm/operations/operations.d.ts.map +0 -1
  133. package/esm/operations/operations.js +0 -77
  134. package/esm/operations/operations.js.map +0 -1
  135. package/esm/operations/service.d.ts +0 -79
  136. package/esm/operations/service.d.ts.map +0 -1
  137. package/esm/operations/service.js +0 -126
  138. package/esm/operations/service.js.map +0 -1
  139. package/src/dataBoxManagementClientContext.ts +0 -69
  140. package/src/models/jobsMappers.ts +0 -55
  141. package/src/models/operationsMappers.ts +0 -15
  142. package/src/models/serviceMappers.ts +0 -22
@@ -1,123 +1,137 @@
1
1
  /*
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.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/operationsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operations } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { DataBoxManagementClientContext } from "../dataBoxManagementClientContext";
14
+ import { DataBoxManagementClient } from "../dataBoxManagementClient";
15
+ import {
16
+ Operation,
17
+ OperationsListNextOptionalParams,
18
+ OperationsListOptionalParams,
19
+ OperationsListResponse,
20
+ OperationsListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a Operations. */
18
- export class Operations {
19
- private readonly client: DataBoxManagementClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Operations operations. */
25
+ export class OperationsImpl implements Operations {
26
+ private readonly client: DataBoxManagementClient;
20
27
 
21
28
  /**
22
- * Create a Operations.
23
- * @param {DataBoxManagementClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class Operations class.
30
+ * @param client Reference to the service client
24
31
  */
25
- constructor(client: DataBoxManagementClientContext) {
32
+ constructor(client: DataBoxManagementClient) {
26
33
  this.client = client;
27
34
  }
28
35
 
29
36
  /**
30
37
  * This method gets all the operations.
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.OperationsListResponse>
38
+ * @param options The options parameters.
33
39
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.OperationList>): void;
39
- /**
40
- * @param options The optional parameters
41
- * @param callback The callback
42
- */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationList>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationList>, callback?: msRest.ServiceCallback<Models.OperationList>): Promise<Models.OperationsListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
40
+ public list(
41
+ options?: OperationsListOptionalParams
42
+ ): PagedAsyncIterableIterator<Operation> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
48
50
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.OperationsListResponse>;
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: OperationsListOptionalParams
59
+ ): AsyncIterableIterator<Operation[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: OperationsListOptionalParams
72
+ ): AsyncIterableIterator<Operation> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
51
76
  }
52
77
 
53
78
  /**
54
79
  * This method gets all the operations.
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.OperationsListNextResponse>
58
- */
59
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.OperationsListNextResponse>;
60
- /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
80
+ * @param options The options parameters.
63
81
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationList>): void;
82
+ private _list(
83
+ options?: OperationsListOptionalParams
84
+ ): Promise<OperationsListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
65
88
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
69
92
  */
70
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationList>): void;
71
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationList>, callback?: msRest.ServiceCallback<Models.OperationList>): Promise<Models.OperationsListNextResponse> {
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: OperationsListNextOptionalParams
96
+ ): Promise<OperationsListNextResponse> {
72
97
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.OperationsListNextResponse>;
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
79
101
  }
80
102
  }
81
-
82
103
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path: "/providers/Microsoft.DataBox/operations",
85
108
  httpMethod: "GET",
86
- path: "providers/Microsoft.DataBox/operations",
87
- queryParameters: [
88
- Parameters.apiVersion
89
- ],
90
- headerParameters: [
91
- Parameters.acceptLanguage
92
- ],
93
109
  responses: {
94
110
  200: {
95
111
  bodyMapper: Mappers.OperationList
96
112
  },
97
113
  default: {
98
- bodyMapper: Mappers.CloudError
114
+ bodyMapper: Mappers.ApiError
99
115
  }
100
116
  },
117
+ queryParameters: [Parameters.apiVersion],
118
+ urlParameters: [Parameters.$host],
119
+ headerParameters: [Parameters.accept],
101
120
  serializer
102
121
  };
103
-
104
- const listNextOperationSpec: msRest.OperationSpec = {
105
- httpMethod: "GET",
106
- baseUrl: "https://management.azure.com",
122
+ const listNextOperationSpec: coreClient.OperationSpec = {
107
123
  path: "{nextLink}",
108
- urlParameters: [
109
- Parameters.nextPageLink
110
- ],
111
- headerParameters: [
112
- Parameters.acceptLanguage
113
- ],
124
+ httpMethod: "GET",
114
125
  responses: {
115
126
  200: {
116
127
  bodyMapper: Mappers.OperationList
117
128
  },
118
129
  default: {
119
- bodyMapper: Mappers.CloudError
130
+ bodyMapper: Mappers.ApiError
120
131
  }
121
132
  },
133
+ queryParameters: [Parameters.apiVersion],
134
+ urlParameters: [Parameters.$host, Parameters.nextLink],
135
+ headerParameters: [Parameters.accept],
122
136
  serializer
123
137
  };