@azure/arm-graphservices 1.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 (120) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1313 -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/samples-dev/accountCreateAndUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/accountCreateAndUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/accountCreateAndUpdateSample.js +43 -0
  11. package/dist-esm/samples-dev/accountCreateAndUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/accountDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/accountDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/accountDeleteSample.js +39 -0
  15. package/dist-esm/samples-dev/accountDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/accountGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/accountGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/accountGetSample.js +39 -0
  19. package/dist-esm/samples-dev/accountGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/accountUpdateSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/accountUpdateSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/accountUpdateSample.js +42 -0
  23. package/dist-esm/samples-dev/accountUpdateSample.js.map +1 -0
  24. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/accountsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +52 -0
  27. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/accountsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js +51 -0
  31. package/dist-esm/samples-dev/accountsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/operationListSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/operationListSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/operationListSample.js +51 -0
  35. package/dist-esm/samples-dev/operationListSample.js.map +1 -0
  36. package/dist-esm/src/graphServices.d.ts +22 -0
  37. package/dist-esm/src/graphServices.d.ts.map +1 -0
  38. package/dist-esm/src/graphServices.js +102 -0
  39. package/dist-esm/src/graphServices.js.map +1 -0
  40. package/dist-esm/src/index.d.ts +6 -0
  41. package/dist-esm/src/index.d.ts.map +1 -0
  42. package/dist-esm/src/index.js +13 -0
  43. package/dist-esm/src/index.js.map +1 -0
  44. package/dist-esm/src/lroImpl.d.ts +11 -0
  45. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  46. package/dist-esm/src/lroImpl.js +21 -0
  47. package/dist-esm/src/lroImpl.js.map +1 -0
  48. package/dist-esm/src/models/index.d.ts +320 -0
  49. package/dist-esm/src/models/index.d.ts.map +1 -0
  50. package/dist-esm/src/models/index.js +46 -0
  51. package/dist-esm/src/models/index.js.map +1 -0
  52. package/dist-esm/src/models/mappers.d.ts +15 -0
  53. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  54. package/dist-esm/src/models/mappers.js +384 -0
  55. package/dist-esm/src/models/mappers.js.map +1 -0
  56. package/dist-esm/src/models/parameters.d.ts +12 -0
  57. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  58. package/dist-esm/src/models/parameters.js +109 -0
  59. package/dist-esm/src/models/parameters.js.map +1 -0
  60. package/dist-esm/src/operations/account.d.ts +52 -0
  61. package/dist-esm/src/operations/account.d.ts.map +1 -0
  62. package/dist-esm/src/operations/account.js +208 -0
  63. package/dist-esm/src/operations/account.js.map +1 -0
  64. package/dist-esm/src/operations/accounts.d.ts +53 -0
  65. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  66. package/dist-esm/src/operations/accounts.js +252 -0
  67. package/dist-esm/src/operations/accounts.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +4 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +11 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operationOperations.d.ts +32 -0
  73. package/dist-esm/src/operations/operationOperations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operationOperations.js +131 -0
  75. package/dist-esm/src/operations/operationOperations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/account.d.ts +44 -0
  77. package/dist-esm/src/operationsInterfaces/account.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/account.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/account.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/accounts.d.ts +17 -0
  81. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  85. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  87. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/operationOperations.d.ts +11 -0
  89. package/dist-esm/src/operationsInterfaces/operationOperations.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/operationOperations.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/operationOperations.js.map +1 -0
  92. package/dist-esm/src/pagingHelper.d.ts +13 -0
  93. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  94. package/dist-esm/src/pagingHelper.js +32 -0
  95. package/dist-esm/src/pagingHelper.js.map +1 -0
  96. package/dist-esm/test/graphservices_operations_test.spec.d.ts +4 -0
  97. package/dist-esm/test/graphservices_operations_test.spec.d.ts.map +1 -0
  98. package/dist-esm/test/graphservices_operations_test.spec.js +55 -0
  99. package/dist-esm/test/graphservices_operations_test.spec.js.map +1 -0
  100. package/package.json +123 -0
  101. package/review/arm-graphservices.api.md +262 -0
  102. package/rollup.config.js +122 -0
  103. package/src/graphServices.ts +148 -0
  104. package/src/index.ts +13 -0
  105. package/src/lroImpl.ts +42 -0
  106. package/src/models/index.ts +364 -0
  107. package/src/models/mappers.ts +408 -0
  108. package/src/models/parameters.ts +127 -0
  109. package/src/operations/account.ts +295 -0
  110. package/src/operations/accounts.ts +303 -0
  111. package/src/operations/index.ts +11 -0
  112. package/src/operations/operationOperations.ts +149 -0
  113. package/src/operationsInterfaces/account.ts +90 -0
  114. package/src/operationsInterfaces/accounts.ts +35 -0
  115. package/src/operationsInterfaces/index.ts +11 -0
  116. package/src/operationsInterfaces/operationOperations.ts +22 -0
  117. package/src/pagingHelper.ts +39 -0
  118. package/tsconfig.json +33 -0
  119. package/types/arm-graphservices.d.ts +459 -0
  120. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,149 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { OperationOperations } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { GraphServices } from "../graphServices";
16
+ import {
17
+ Operation,
18
+ OperationListNextOptionalParams,
19
+ OperationListOptionalParams,
20
+ OperationListResponse,
21
+ OperationListNextResponse
22
+ } from "../models";
23
+
24
+ /// <reference lib="esnext.asynciterable" />
25
+ /** Class containing OperationOperations operations. */
26
+ export class OperationOperationsImpl implements OperationOperations {
27
+ private readonly client: GraphServices;
28
+
29
+ /**
30
+ * Initialize a new instance of the class OperationOperations class.
31
+ * @param client Reference to the service client
32
+ */
33
+ constructor(client: GraphServices) {
34
+ this.client = client;
35
+ }
36
+
37
+ /**
38
+ * Returns list of operations.
39
+ * @param options The options parameters.
40
+ */
41
+ public list(
42
+ options?: OperationListOptionalParams
43
+ ): PagedAsyncIterableIterator<Operation> {
44
+ const iter = this.listPagingAll(options);
45
+ return {
46
+ next() {
47
+ return iter.next();
48
+ },
49
+ [Symbol.asyncIterator]() {
50
+ return this;
51
+ },
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
57
+ }
58
+ };
59
+ }
60
+
61
+ private async *listPagingPage(
62
+ options?: OperationListOptionalParams,
63
+ settings?: PageSettings
64
+ ): AsyncIterableIterator<Operation[]> {
65
+ let result: OperationListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
74
+ while (continuationToken) {
75
+ result = await this._listNext(continuationToken, options);
76
+ continuationToken = result.nextLink;
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
80
+ }
81
+ }
82
+
83
+ private async *listPagingAll(
84
+ options?: OperationListOptionalParams
85
+ ): AsyncIterableIterator<Operation> {
86
+ for await (const page of this.listPagingPage(options)) {
87
+ yield* page;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Returns list of operations.
93
+ * @param options The options parameters.
94
+ */
95
+ private _list(
96
+ options?: OperationListOptionalParams
97
+ ): Promise<OperationListResponse> {
98
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
99
+ }
100
+
101
+ /**
102
+ * ListNext
103
+ * @param nextLink The nextLink from the previous successful call to the List method.
104
+ * @param options The options parameters.
105
+ */
106
+ private _listNext(
107
+ nextLink: string,
108
+ options?: OperationListNextOptionalParams
109
+ ): Promise<OperationListNextResponse> {
110
+ return this.client.sendOperationRequest(
111
+ { nextLink, options },
112
+ listNextOperationSpec
113
+ );
114
+ }
115
+ }
116
+ // Operation Specifications
117
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
118
+
119
+ const listOperationSpec: coreClient.OperationSpec = {
120
+ path: "/providers/Microsoft.GraphServices/operations",
121
+ httpMethod: "GET",
122
+ responses: {
123
+ 200: {
124
+ bodyMapper: Mappers.OperationListResult
125
+ },
126
+ default: {
127
+ bodyMapper: Mappers.ErrorResponse
128
+ }
129
+ },
130
+ queryParameters: [Parameters.apiVersion],
131
+ urlParameters: [Parameters.$host],
132
+ headerParameters: [Parameters.accept],
133
+ serializer
134
+ };
135
+ const listNextOperationSpec: coreClient.OperationSpec = {
136
+ path: "{nextLink}",
137
+ httpMethod: "GET",
138
+ responses: {
139
+ 200: {
140
+ bodyMapper: Mappers.OperationListResult
141
+ },
142
+ default: {
143
+ bodyMapper: Mappers.ErrorResponse
144
+ }
145
+ },
146
+ urlParameters: [Parameters.$host, Parameters.nextLink],
147
+ headerParameters: [Parameters.accept],
148
+ serializer
149
+ };
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { SimplePollerLike, OperationState } from "@azure/core-lro";
10
+ import {
11
+ AccountGetOptionalParams,
12
+ AccountGetResponse,
13
+ AccountResource,
14
+ AccountCreateAndUpdateOptionalParams,
15
+ AccountCreateAndUpdateResponse,
16
+ AccountPatchResource,
17
+ AccountUpdateOptionalParams,
18
+ AccountUpdateResponse,
19
+ AccountDeleteOptionalParams
20
+ } from "../models";
21
+
22
+ /** Interface representing a Account. */
23
+ export interface Account {
24
+ /**
25
+ * Returns account resource for a given name.
26
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
27
+ * @param resourceName The name of the resource.
28
+ * @param options The options parameters.
29
+ */
30
+ get(
31
+ resourceGroupName: string,
32
+ resourceName: string,
33
+ options?: AccountGetOptionalParams
34
+ ): Promise<AccountGetResponse>;
35
+ /**
36
+ * Create or update account resource.
37
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
38
+ * @param resourceName The name of the resource.
39
+ * @param accountResource Account details.
40
+ * @param options The options parameters.
41
+ */
42
+ beginCreateAndUpdate(
43
+ resourceGroupName: string,
44
+ resourceName: string,
45
+ accountResource: AccountResource,
46
+ options?: AccountCreateAndUpdateOptionalParams
47
+ ): Promise<
48
+ SimplePollerLike<
49
+ OperationState<AccountCreateAndUpdateResponse>,
50
+ AccountCreateAndUpdateResponse
51
+ >
52
+ >;
53
+ /**
54
+ * Create or update account resource.
55
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
56
+ * @param resourceName The name of the resource.
57
+ * @param accountResource Account details.
58
+ * @param options The options parameters.
59
+ */
60
+ beginCreateAndUpdateAndWait(
61
+ resourceGroupName: string,
62
+ resourceName: string,
63
+ accountResource: AccountResource,
64
+ options?: AccountCreateAndUpdateOptionalParams
65
+ ): Promise<AccountCreateAndUpdateResponse>;
66
+ /**
67
+ * Update account details.
68
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
69
+ * @param resourceName The name of the resource.
70
+ * @param accountResource Account patch details.
71
+ * @param options The options parameters.
72
+ */
73
+ update(
74
+ resourceGroupName: string,
75
+ resourceName: string,
76
+ accountResource: AccountPatchResource,
77
+ options?: AccountUpdateOptionalParams
78
+ ): Promise<AccountUpdateResponse>;
79
+ /**
80
+ * Deletes a account resource.
81
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
82
+ * @param resourceName The name of the resource.
83
+ * @param options The options parameters.
84
+ */
85
+ delete(
86
+ resourceGroupName: string,
87
+ resourceName: string,
88
+ options?: AccountDeleteOptionalParams
89
+ ): Promise<void>;
90
+ }
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import {
11
+ AccountResource,
12
+ AccountsListByResourceGroupOptionalParams,
13
+ AccountsListBySubscriptionOptionalParams
14
+ } from "../models";
15
+
16
+ /// <reference lib="esnext.asynciterable" />
17
+ /** Interface representing a Accounts. */
18
+ export interface Accounts {
19
+ /**
20
+ * Returns list of accounts apps.
21
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
22
+ * @param options The options parameters.
23
+ */
24
+ listByResourceGroup(
25
+ resourceGroupName: string,
26
+ options?: AccountsListByResourceGroupOptionalParams
27
+ ): PagedAsyncIterableIterator<AccountResource>;
28
+ /**
29
+ * Returns list of accounts belonging to a subscription.
30
+ * @param options The options parameters.
31
+ */
32
+ listBySubscription(
33
+ options?: AccountsListBySubscriptionOptionalParams
34
+ ): PagedAsyncIterableIterator<AccountResource>;
35
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export * from "./accounts";
10
+ export * from "./account";
11
+ export * from "./operationOperations";
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operation, OperationListOptionalParams } from "../models";
11
+
12
+ /// <reference lib="esnext.asynciterable" />
13
+ /** Interface representing a OperationOperations. */
14
+ export interface OperationOperations {
15
+ /**
16
+ * Returns list of operations.
17
+ * @param options The options parameters.
18
+ */
19
+ list(
20
+ options?: OperationListOptionalParams
21
+ ): PagedAsyncIterableIterator<Operation>;
22
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "es6",
4
+ "moduleResolution": "node",
5
+ "strict": true,
6
+ "target": "es6",
7
+ "sourceMap": true,
8
+ "declarationMap": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "lib": [
13
+ "es6",
14
+ "dom"
15
+ ],
16
+ "declaration": true,
17
+ "outDir": "./dist-esm",
18
+ "importHelpers": true,
19
+ "paths": {
20
+ "@azure/arm-graphservices": [
21
+ "./src/index"
22
+ ]
23
+ }
24
+ },
25
+ "include": [
26
+ "./src/**/*.ts",
27
+ "./test/**/*.ts",
28
+ "samples-dev/**/*.ts"
29
+ ],
30
+ "exclude": [
31
+ "node_modules"
32
+ ]
33
+ }