@azure/arm-locks 1.2.0 → 2.0.0-alpha.20211015.3

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 (84) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +63 -80
  4. package/dist/index.js +1796 -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/esm/index.d.ts +534 -0
  9. package/esm/index.d.ts.map +1 -0
  10. package/esm/index.js +13 -0
  11. package/esm/index.js.map +1 -0
  12. package/esm/managementLockClient.d.ts +9 -18
  13. package/esm/managementLockClient.d.ts.map +1 -1
  14. package/esm/managementLockClient.js +12 -28
  15. package/esm/managementLockClient.js.map +1 -1
  16. package/esm/managementLockClientContext.d.ts +10 -16
  17. package/esm/managementLockClientContext.d.ts.map +1 -1
  18. package/esm/managementLockClientContext.js +34 -46
  19. package/esm/managementLockClientContext.js.map +1 -1
  20. package/esm/models/index.d.ts +208 -445
  21. package/esm/models/index.d.ts.map +1 -1
  22. package/esm/models/index.js +9 -2
  23. package/esm/models/index.js.map +1 -1
  24. package/esm/models/mappers.d.ts +7 -9
  25. package/esm/models/mappers.d.ts.map +1 -1
  26. package/esm/models/mappers.js +69 -78
  27. package/esm/models/mappers.js.map +1 -1
  28. package/esm/models/parameters.d.ts +16 -13
  29. package/esm/models/parameters.d.ts.map +1 -1
  30. package/esm/models/parameters.js +78 -54
  31. package/esm/models/parameters.js.map +1 -1
  32. package/esm/operations/authorizationOperations.d.ts +27 -26
  33. package/esm/operations/authorizationOperations.d.ts.map +1 -1
  34. package/esm/operations/authorizationOperations.js +158 -50
  35. package/esm/operations/authorizationOperations.js.map +1 -1
  36. package/esm/operations/index.d.ts.map +1 -1
  37. package/esm/operations/index.js +3 -5
  38. package/esm/operations/index.js.map +1 -1
  39. package/esm/operations/managementLocks.d.ts +203 -393
  40. package/esm/operations/managementLocks.d.ts.map +1 -1
  41. package/esm/operations/managementLocks.js +993 -485
  42. package/esm/operations/managementLocks.js.map +1 -1
  43. package/esm/operationsInterfaces/authorizationOperations.d.ts +18 -0
  44. package/esm/operationsInterfaces/authorizationOperations.d.ts.map +1 -0
  45. package/esm/operationsInterfaces/authorizationOperations.js +9 -0
  46. package/esm/operationsInterfaces/authorizationOperations.js.map +1 -0
  47. package/esm/operationsInterfaces/index.d.ts +3 -0
  48. package/esm/operationsInterfaces/index.d.ts.map +1 -0
  49. package/esm/operationsInterfaces/index.js +10 -0
  50. package/esm/operationsInterfaces/index.js.map +1 -0
  51. package/esm/operationsInterfaces/managementLocks.d.ts +198 -0
  52. package/esm/operationsInterfaces/managementLocks.d.ts.map +1 -0
  53. package/esm/operationsInterfaces/managementLocks.js +9 -0
  54. package/esm/operationsInterfaces/managementLocks.js.map +1 -0
  55. package/package.json +53 -16
  56. package/review/arm-locks.api.md +313 -0
  57. package/rollup.config.js +181 -30
  58. package/src/index.ts +13 -0
  59. package/src/managementLockClient.ts +23 -36
  60. package/src/managementLockClientContext.ts +47 -45
  61. package/src/models/index.ts +256 -470
  62. package/src/models/mappers.ts +72 -82
  63. package/src/models/parameters.ts +97 -55
  64. package/src/operations/authorizationOperations.ts +155 -70
  65. package/src/operations/index.ts +3 -5
  66. package/src/operations/managementLocks.ts +1165 -869
  67. package/src/operationsInterfaces/authorizationOperations.ts +36 -0
  68. package/src/operationsInterfaces/index.ts +10 -0
  69. package/src/operationsInterfaces/managementLocks.ts +332 -0
  70. package/tsconfig.json +3 -2
  71. package/dist/arm-locks.js +0 -1280
  72. package/dist/arm-locks.js.map +0 -1
  73. package/dist/arm-locks.min.js +0 -1
  74. package/dist/arm-locks.min.js.map +0 -1
  75. package/esm/models/authorizationOperationsMappers.d.ts +0 -2
  76. package/esm/models/authorizationOperationsMappers.d.ts.map +0 -1
  77. package/esm/models/authorizationOperationsMappers.js +0 -9
  78. package/esm/models/authorizationOperationsMappers.js.map +0 -1
  79. package/esm/models/managementLocksMappers.d.ts +0 -2
  80. package/esm/models/managementLocksMappers.d.ts.map +0 -1
  81. package/esm/models/managementLocksMappers.js +0 -9
  82. package/esm/models/managementLocksMappers.js.map +0 -1
  83. package/src/models/authorizationOperationsMappers.ts +0 -14
  84. package/src/models/managementLocksMappers.ts +0 -15
@@ -1,26 +1,36 @@
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/authorizationOperationsMappers";
9
+ import "@azure/core-paging";
10
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
11
+ import { AuthorizationOperations } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { ManagementLockClientContext } from "../managementLockClientContext";
16
+ import {
17
+ Operation,
18
+ AuthorizationOperationsListNextOptionalParams,
19
+ AuthorizationOperationsListOptionalParams,
20
+ AuthorizationOperationsListNextNextOptionalParams,
21
+ AuthorizationOperationsListResponse,
22
+ AuthorizationOperationsListNextResponse,
23
+ AuthorizationOperationsListNextNextResponse
24
+ } from "../models";
16
25
 
26
+ /// <reference lib="esnext.asynciterable" />
17
27
  /** Class representing a AuthorizationOperations. */
18
- export class AuthorizationOperations {
28
+ export class AuthorizationOperationsImpl implements AuthorizationOperations {
19
29
  private readonly client: ManagementLockClientContext;
20
30
 
21
31
  /**
22
- * Create a AuthorizationOperations.
23
- * @param {ManagementLockClientContext} client Reference to the service client.
32
+ * Initialize a new instance of the class AuthorizationOperations class.
33
+ * @param client Reference to the service client
24
34
  */
25
35
  constructor(client: ManagementLockClientContext) {
26
36
  this.client = client;
@@ -28,96 +38,171 @@ export class AuthorizationOperations {
28
38
 
29
39
  /**
30
40
  * Lists all of the available Microsoft.Authorization REST API operations.
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.AuthorizationOperationsListResponse>
41
+ * @param options The options parameters.
33
42
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.AuthorizationOperationsListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
43
+ public list(
44
+ options?: AuthorizationOperationsListOptionalParams
45
+ ): PagedAsyncIterableIterator<Operation> {
46
+ const iter = this.listPagingAll(options);
47
+ return {
48
+ next() {
49
+ return iter.next();
50
+ },
51
+ [Symbol.asyncIterator]() {
52
+ return this;
53
+ },
54
+ byPage: () => {
55
+ return this.listPagingPage(options);
56
+ }
57
+ };
58
+ }
59
+
60
+ private async *listPagingPage(
61
+ options?: AuthorizationOperationsListOptionalParams
62
+ ): AsyncIterableIterator<Operation[]> {
63
+ let result = await this._list(options);
64
+ yield result.value || [];
65
+ let continuationToken = result.nextLink;
66
+ while (continuationToken) {
67
+ result = await this._listNext(continuationToken, options);
68
+ continuationToken = result.nextLink;
69
+ yield result.value || [];
70
+ }
71
+ }
72
+
73
+ private async *listPagingAll(
74
+ options?: AuthorizationOperationsListOptionalParams
75
+ ): AsyncIterableIterator<Operation> {
76
+ for await (const page of this.listPagingPage(options)) {
77
+ yield* page;
78
+ }
79
+ }
80
+
39
81
  /**
40
- * @param options The optional parameters
41
- * @param callback The callback
82
+ * ListNext
83
+ * @param nextLink The nextLink from the previous successful call to the List method.
84
+ * @param options The options parameters.
42
85
  */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.AuthorizationOperationsListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
86
+ public listNext(
87
+ nextLink: string,
88
+ options?: AuthorizationOperationsListNextOptionalParams
89
+ ): PagedAsyncIterableIterator<Operation> {
90
+ const iter = this.listNextPagingAll(nextLink, options);
91
+ return {
92
+ next() {
93
+ return iter.next();
48
94
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.AuthorizationOperationsListResponse>;
95
+ [Symbol.asyncIterator]() {
96
+ return this;
97
+ },
98
+ byPage: () => {
99
+ return this.listNextPagingPage(nextLink, options);
100
+ }
101
+ };
102
+ }
103
+
104
+ private async *listNextPagingPage(
105
+ nextLink: string,
106
+ options?: AuthorizationOperationsListNextOptionalParams
107
+ ): AsyncIterableIterator<Operation[]> {
108
+ let result = await this._listNext(nextLink, options);
109
+ yield result.value || [];
110
+ let continuationToken = result.nextLink;
111
+ while (continuationToken) {
112
+ result = await this._listNextNext(continuationToken, options);
113
+ continuationToken = result.nextLink;
114
+ yield result.value || [];
115
+ }
116
+ }
117
+
118
+ private async *listNextPagingAll(
119
+ nextLink: string,
120
+ options?: AuthorizationOperationsListNextOptionalParams
121
+ ): AsyncIterableIterator<Operation> {
122
+ for await (const page of this.listNextPagingPage(nextLink, options)) {
123
+ yield* page;
124
+ }
51
125
  }
52
126
 
53
127
  /**
54
128
  * Lists all of the available Microsoft.Authorization REST API operations.
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.AuthorizationOperationsListNextResponse>
129
+ * @param options The options parameters.
58
130
  */
59
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AuthorizationOperationsListNextResponse>;
131
+ private _list(
132
+ options?: AuthorizationOperationsListOptionalParams
133
+ ): Promise<AuthorizationOperationsListResponse> {
134
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
135
+ }
136
+
60
137
  /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
138
+ * ListNext
139
+ * @param nextLink The nextLink from the previous successful call to the List method.
140
+ * @param options The options parameters.
63
141
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
142
+ private _listNext(
143
+ nextLink: string,
144
+ options?: AuthorizationOperationsListNextOptionalParams
145
+ ): Promise<AuthorizationOperationsListNextResponse> {
146
+ return this.client.sendOperationRequest(
147
+ { nextLink, options },
148
+ listNextOperationSpec
149
+ );
150
+ }
151
+
65
152
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
153
+ * ListNextNext
154
+ * @param nextLink The nextLink from the previous successful call to the ListNext method.
155
+ * @param options The options parameters.
69
156
  */
70
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
71
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.AuthorizationOperationsListNextResponse> {
157
+ private _listNextNext(
158
+ nextLink: string,
159
+ options?: AuthorizationOperationsListNextNextOptionalParams
160
+ ): Promise<AuthorizationOperationsListNextNextResponse> {
72
161
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.AuthorizationOperationsListNextResponse>;
162
+ { nextLink, options },
163
+ listNextNextOperationSpec
164
+ );
79
165
  }
80
166
  }
81
-
82
167
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
168
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
169
+
170
+ const listOperationSpec: coreClient.OperationSpec = {
171
+ path: "/providers/Microsoft.Authorization/operations",
85
172
  httpMethod: "GET",
86
- path: "providers/Microsoft.Authorization/operations",
87
- queryParameters: [
88
- Parameters.apiVersion
89
- ],
90
- headerParameters: [
91
- Parameters.acceptLanguage
92
- ],
93
173
  responses: {
94
174
  200: {
95
175
  bodyMapper: Mappers.OperationListResult
96
- },
97
- default: {
98
- bodyMapper: Mappers.CloudError
99
176
  }
100
177
  },
178
+ queryParameters: [Parameters.apiVersion],
179
+ urlParameters: [Parameters.$host],
180
+ headerParameters: [Parameters.accept],
101
181
  serializer
102
182
  };
103
-
104
- const listNextOperationSpec: msRest.OperationSpec = {
183
+ const listNextOperationSpec: coreClient.OperationSpec = {
184
+ path: "{nextLink}",
105
185
  httpMethod: "GET",
106
- baseUrl: "https://management.azure.com",
186
+ responses: {
187
+ 200: {
188
+ bodyMapper: Mappers.OperationListResult
189
+ }
190
+ },
191
+ queryParameters: [Parameters.apiVersion],
192
+ urlParameters: [Parameters.$host, Parameters.nextLink],
193
+ headerParameters: [Parameters.accept],
194
+ serializer
195
+ };
196
+ const listNextNextOperationSpec: coreClient.OperationSpec = {
107
197
  path: "{nextLink}",
108
- urlParameters: [
109
- Parameters.nextPageLink
110
- ],
111
- headerParameters: [
112
- Parameters.acceptLanguage
113
- ],
198
+ httpMethod: "GET",
114
199
  responses: {
115
200
  200: {
116
201
  bodyMapper: Mappers.OperationListResult
117
- },
118
- default: {
119
- bodyMapper: Mappers.CloudError
120
202
  }
121
203
  },
204
+ queryParameters: [Parameters.apiVersion],
205
+ urlParameters: [Parameters.$host, Parameters.nextLink],
206
+ headerParameters: [Parameters.accept],
122
207
  serializer
123
208
  };
@@ -1,11 +1,9 @@
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
9
  export * from "./authorizationOperations";