@azure-rest/synapse-access-control 1.0.0-alpha.20241219.1 → 1.0.0-alpha.20241223.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 (117) hide show
  1. package/dist/browser/accessControlRestClient.d.ts +12 -1
  2. package/dist/browser/accessControlRestClient.d.ts.map +1 -1
  3. package/dist/browser/accessControlRestClient.js +30 -8
  4. package/dist/browser/accessControlRestClient.js.map +1 -1
  5. package/dist/browser/clientDefinitions.d.ts +9 -9
  6. package/dist/browser/clientDefinitions.js.map +1 -1
  7. package/dist/browser/isUnexpected.d.ts +9 -9
  8. package/dist/browser/isUnexpected.js +35 -28
  9. package/dist/browser/isUnexpected.js.map +1 -1
  10. package/dist/browser/logger.d.ts +2 -0
  11. package/dist/browser/logger.d.ts.map +1 -0
  12. package/dist/browser/logger.js +5 -0
  13. package/dist/browser/logger.js.map +1 -0
  14. package/dist/browser/models.d.ts +4 -0
  15. package/dist/browser/models.d.ts.map +1 -1
  16. package/dist/browser/models.js.map +1 -1
  17. package/dist/browser/outputModels.d.ts +16 -7
  18. package/dist/browser/outputModels.d.ts.map +1 -1
  19. package/dist/browser/outputModels.js.map +1 -1
  20. package/dist/browser/paginateHelper.d.ts +27 -2
  21. package/dist/browser/paginateHelper.d.ts.map +1 -1
  22. package/dist/browser/paginateHelper.js +98 -1
  23. package/dist/browser/paginateHelper.js.map +1 -1
  24. package/dist/browser/parameters.d.ts +1 -1
  25. package/dist/browser/parameters.d.ts.map +1 -1
  26. package/dist/browser/parameters.js.map +1 -1
  27. package/dist/browser/responses.d.ts +8 -10
  28. package/dist/browser/responses.d.ts.map +1 -1
  29. package/dist/browser/responses.js.map +1 -1
  30. package/dist/commonjs/accessControlRestClient.d.ts +12 -1
  31. package/dist/commonjs/accessControlRestClient.d.ts.map +1 -1
  32. package/dist/commonjs/accessControlRestClient.js +30 -8
  33. package/dist/commonjs/accessControlRestClient.js.map +1 -1
  34. package/dist/commonjs/clientDefinitions.d.ts +9 -9
  35. package/dist/commonjs/clientDefinitions.js.map +1 -1
  36. package/dist/commonjs/isUnexpected.d.ts +9 -9
  37. package/dist/commonjs/isUnexpected.js +35 -28
  38. package/dist/commonjs/isUnexpected.js.map +1 -1
  39. package/dist/commonjs/logger.d.ts +2 -0
  40. package/dist/commonjs/logger.d.ts.map +1 -0
  41. package/dist/commonjs/logger.js +8 -0
  42. package/dist/commonjs/logger.js.map +1 -0
  43. package/dist/commonjs/models.d.ts +4 -0
  44. package/dist/commonjs/models.d.ts.map +1 -1
  45. package/dist/commonjs/models.js.map +1 -1
  46. package/dist/commonjs/outputModels.d.ts +16 -7
  47. package/dist/commonjs/outputModels.d.ts.map +1 -1
  48. package/dist/commonjs/outputModels.js.map +1 -1
  49. package/dist/commonjs/paginateHelper.d.ts +27 -2
  50. package/dist/commonjs/paginateHelper.d.ts.map +1 -1
  51. package/dist/commonjs/paginateHelper.js +99 -2
  52. package/dist/commonjs/paginateHelper.js.map +1 -1
  53. package/dist/commonjs/parameters.d.ts +1 -1
  54. package/dist/commonjs/parameters.d.ts.map +1 -1
  55. package/dist/commonjs/parameters.js.map +1 -1
  56. package/dist/commonjs/responses.d.ts +8 -10
  57. package/dist/commonjs/responses.d.ts.map +1 -1
  58. package/dist/commonjs/responses.js.map +1 -1
  59. package/dist/esm/accessControlRestClient.d.ts +12 -1
  60. package/dist/esm/accessControlRestClient.d.ts.map +1 -1
  61. package/dist/esm/accessControlRestClient.js +30 -8
  62. package/dist/esm/accessControlRestClient.js.map +1 -1
  63. package/dist/esm/clientDefinitions.d.ts +9 -9
  64. package/dist/esm/clientDefinitions.js.map +1 -1
  65. package/dist/esm/isUnexpected.d.ts +9 -9
  66. package/dist/esm/isUnexpected.js +35 -28
  67. package/dist/esm/isUnexpected.js.map +1 -1
  68. package/dist/esm/logger.d.ts +2 -0
  69. package/dist/esm/logger.d.ts.map +1 -0
  70. package/dist/esm/logger.js +5 -0
  71. package/dist/esm/logger.js.map +1 -0
  72. package/dist/esm/models.d.ts +4 -0
  73. package/dist/esm/models.d.ts.map +1 -1
  74. package/dist/esm/models.js.map +1 -1
  75. package/dist/esm/outputModels.d.ts +16 -7
  76. package/dist/esm/outputModels.d.ts.map +1 -1
  77. package/dist/esm/outputModels.js.map +1 -1
  78. package/dist/esm/paginateHelper.d.ts +27 -2
  79. package/dist/esm/paginateHelper.d.ts.map +1 -1
  80. package/dist/esm/paginateHelper.js +98 -1
  81. package/dist/esm/paginateHelper.js.map +1 -1
  82. package/dist/esm/parameters.d.ts +1 -1
  83. package/dist/esm/parameters.d.ts.map +1 -1
  84. package/dist/esm/parameters.js.map +1 -1
  85. package/dist/esm/responses.d.ts +8 -10
  86. package/dist/esm/responses.d.ts.map +1 -1
  87. package/dist/esm/responses.js.map +1 -1
  88. package/dist/react-native/accessControlRestClient.d.ts +12 -1
  89. package/dist/react-native/accessControlRestClient.d.ts.map +1 -1
  90. package/dist/react-native/accessControlRestClient.js +30 -8
  91. package/dist/react-native/accessControlRestClient.js.map +1 -1
  92. package/dist/react-native/clientDefinitions.d.ts +9 -9
  93. package/dist/react-native/clientDefinitions.js.map +1 -1
  94. package/dist/react-native/isUnexpected.d.ts +9 -9
  95. package/dist/react-native/isUnexpected.js +35 -28
  96. package/dist/react-native/isUnexpected.js.map +1 -1
  97. package/dist/react-native/logger.d.ts +2 -0
  98. package/dist/react-native/logger.d.ts.map +1 -0
  99. package/dist/react-native/logger.js +5 -0
  100. package/dist/react-native/logger.js.map +1 -0
  101. package/dist/react-native/models.d.ts +4 -0
  102. package/dist/react-native/models.d.ts.map +1 -1
  103. package/dist/react-native/models.js.map +1 -1
  104. package/dist/react-native/outputModels.d.ts +16 -7
  105. package/dist/react-native/outputModels.d.ts.map +1 -1
  106. package/dist/react-native/outputModels.js.map +1 -1
  107. package/dist/react-native/paginateHelper.d.ts +27 -2
  108. package/dist/react-native/paginateHelper.d.ts.map +1 -1
  109. package/dist/react-native/paginateHelper.js +98 -1
  110. package/dist/react-native/paginateHelper.js.map +1 -1
  111. package/dist/react-native/parameters.d.ts +1 -1
  112. package/dist/react-native/parameters.d.ts.map +1 -1
  113. package/dist/react-native/parameters.js.map +1 -1
  114. package/dist/react-native/responses.d.ts +8 -10
  115. package/dist/react-native/responses.d.ts.map +1 -1
  116. package/dist/react-native/responses.js.map +1 -1
  117. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kCAAkC;IACjD,6HAA6H;IAC7H,eAAe,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,yBAAyB;IACxC,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACrC,iC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AQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,uCAAuC;AACvC,MAAM,WAAW,+BAA+B;IAC9C,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;CAC5C;AAED,sCAAsC;AACtC,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,WAAW,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACjD,0CAA0C;IAC1C,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,sCAAsC;AACtC,MAAM,WAAW,2BAA2B;IAC1C,sBAAsB;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,+BAA+B;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport interface CheckPrincipalAccessResponseOutput {\n /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */\n AccessDecisions?: Array<CheckAccessDecisionOutput>;\n}\n\nexport interface CheckAccessDecisionOutput {\n /** Access Decision. */\n accessDecision?: string;\n /** Action Id. */\n actionId?: string;\n /** Role Assignment response details */\n roleAssignment?: RoleAssignmentDetailsOutput;\n}\n\nexport interface RoleAssignmentDetailsOutput {\n /** Role Assignment ID */\n id?: string;\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleDefinitionId?: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId?: string;\n /** Scope at the role assignment is created */\n scope?: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n\nexport interface ErrorContractOutput {\n /** The error details. */\n error?: ErrorResponseOutput;\n}\n\nexport interface ErrorResponseOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** The error details. */\n details?: Array<ErrorResponseOutput>;\n /** The error additional info. */\n additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n type?: string;\n /** The additional info. */\n info?: Record<string, unknown>;\n}\n\nexport interface RoleAssignmentDetailsListOutput {\n /** Number of role assignments */\n count?: number;\n /** A list of role assignments */\n value?: Array<RoleAssignmentDetailsOutput>;\n}\n\nexport interface SynapseRoleDefinitionOutput {\n /**\n * Role Definition ID\n *\n * Value may contain a UUID\n */\n id?: string;\n /** Name of the Synapse role */\n name?: string;\n /** Is a built-in role or not */\n isBuiltIn?: boolean;\n /** Description for the Synapse role */\n description?: string;\n /** Permissions for the Synapse role */\n permissions?: Array<SynapseRbacPermissionOutput>;\n /** Allowed scopes for the Synapse role */\n scopes?: Array<string>;\n /** Availability of the Synapse role */\n availabilityStatus?: string;\n}\n\nexport interface SynapseRbacPermissionOutput {\n /** List of actions */\n actions?: Array<string>;\n /** List of Not actions */\n notActions?: Array<string>;\n /** List of data actions */\n dataActions?: Array<string>;\n /** List of Not data actions */\n notDataActions?: Array<string>;\n}\n"]}
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Check access response details */\nexport interface CheckPrincipalAccessResponseOutput {\n /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */\n AccessDecisions?: Array<CheckAccessDecisionOutput>;\n}\n\n/** Check access response details */\nexport interface CheckAccessDecisionOutput {\n /** Access Decision. */\n accessDecision?: string;\n /** Action Id. */\n actionId?: string;\n /** Role Assignment response details */\n roleAssignment?: RoleAssignmentDetailsOutput;\n}\n\n/** Role Assignment response details */\nexport interface RoleAssignmentDetailsOutput {\n /** Role Assignment ID */\n id?: string;\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleDefinitionId?: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId?: string;\n /** Scope at the role assignment is created */\n scope?: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n\n/** Contains details when the response code indicates an error. */\nexport interface ErrorContractOutput {\n /** The error details. */\n error?: ErrorResponseOutput;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */\nexport interface ErrorResponseOutput {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: Array<ErrorResponseOutput>;\n /** The error additional info. */\n readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, unknown>;\n}\n\n/** Role Assignment response details */\nexport interface RoleAssignmentDetailsListOutput {\n /** Number of role assignments */\n count?: number;\n /** A list of role assignments */\n value?: Array<RoleAssignmentDetailsOutput>;\n}\n\n/** Synapse role definition details */\nexport interface SynapseRoleDefinitionOutput {\n /**\n * Role Definition ID\n *\n * Value may contain a UUID\n */\n id?: string;\n /** Name of the Synapse role */\n name?: string;\n /** Is a built-in role or not */\n isBuiltIn?: boolean;\n /** Description for the Synapse role */\n description?: string;\n /** Permissions for the Synapse role */\n permissions?: Array<SynapseRbacPermissionOutput>;\n /** Allowed scopes for the Synapse role */\n scopes?: Array<string>;\n /** Availability of the Synapse role */\n availabilityStatus?: string;\n}\n\n/** Synapse role definition details */\nexport interface SynapseRbacPermissionOutput {\n /** List of actions */\n actions?: Array<string>;\n /** List of Not actions */\n notActions?: Array<string>;\n /** List of data actions */\n dataActions?: Array<string>;\n /** List of Not data actions */\n notDataActions?: Array<string>;\n}\n"]}
@@ -1,5 +1,30 @@
1
- import type { PagedAsyncIterableIterator } from "@azure/core-paging";
2
1
  import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
2
+ /**
3
+ * An interface that tracks the settings for paged iteration
4
+ */
5
+ export interface PageSettings {
6
+ /**
7
+ * The token that keeps track of where to continue the iterator
8
+ */
9
+ continuationToken?: string;
10
+ }
11
+ /**
12
+ * An interface that allows async iterable iteration both to completion and by page.
13
+ */
14
+ export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
15
+ /**
16
+ * The next method, part of the iteration protocol
17
+ */
18
+ next(): Promise<IteratorResult<TElement>>;
19
+ /**
20
+ * The connection to the async iterator, part of the iteration protocol
21
+ */
22
+ [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
23
+ /**
24
+ * Return an AsyncIterableIterator that works a page at a time
25
+ */
26
+ byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
27
+ }
3
28
  /**
4
29
  * Helper type to extract the type of an array
5
30
  */
@@ -7,7 +32,7 @@ export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
7
32
  /**
8
33
  * The type of a custom function that defines how to get a page and a link to the next one if any.
9
34
  */
10
- export type GetPage<TPage> = (pageLink: string, maxPageSize?: number) => Promise<{
35
+ export type GetPage<TPage> = (pageLink: string) => Promise<{
11
36
  page: TPage;
12
37
  nextPageLink?: string;
13
38
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAe,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG7E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,KACjB,OAAO,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;CACtD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,IAAI,OAAO,SAAS;IACpD,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;KAAE,CAAC;CAC/B,GACG,YAAY,CAAC,KAAK,CAAC,GACnB,KAAK,CAAC,OAAO,CAAC,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,qBAAqB,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,EAC1B,OAAO,GAA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,CAAC,OAAO,IAAI,OAAO,SAAS;IACpD,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;KAAE,CAAC;CAC/B,GACG,YAAY,CAAC,KAAK,CAAC,GACnB,KAAK,CAAC,OAAO,CAAC,CAAC;AAEnB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,qBAAqB,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,SAAS,EAC1B,OAAO,GAAE,aAAa,CAAC,SAAS,CAAM,GACrC,0BAA0B,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CA0BvD"}
@@ -1,7 +1,104 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { getPagedAsyncIterator } from "@azure/core-paging";
3
+ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
4
4
  import { createRestError } from "@azure-rest/core-client";
5
+ /**
6
+ * returns an async iterator that iterates over results. It also has a `byPage`
7
+ * method that returns pages of items at once.
8
+ *
9
+ * @param pagedResult - an object that specifies how to get pages.
10
+ * @returns a paged async iterator that iterates over results.
11
+ */
12
+ function getPagedAsyncIterator(pagedResult) {
13
+ var _a;
14
+ const iter = getItemAsyncIterator(pagedResult);
15
+ return {
16
+ next() {
17
+ return iter.next();
18
+ },
19
+ [Symbol.asyncIterator]() {
20
+ return this;
21
+ },
22
+ byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
23
+ const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
24
+ return getPageAsyncIterator(pagedResult, {
25
+ pageLink: continuationToken,
26
+ });
27
+ }),
28
+ };
29
+ }
30
+ function getItemAsyncIterator(pagedResult) {
31
+ return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
32
+ var _a, e_1, _b, _c, _d, e_2, _e, _f;
33
+ const pages = getPageAsyncIterator(pagedResult);
34
+ const firstVal = yield __await(pages.next());
35
+ // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
36
+ if (!Array.isArray(firstVal.value)) {
37
+ // can extract elements from this page
38
+ const { toElements } = pagedResult;
39
+ if (toElements) {
40
+ yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value))));
41
+ try {
42
+ for (var _g = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _g = true) {
43
+ _c = pages_1_1.value;
44
+ _g = false;
45
+ const page = _c;
46
+ yield __await(yield* __asyncDelegator(__asyncValues(toElements(page))));
47
+ }
48
+ }
49
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
50
+ finally {
51
+ try {
52
+ if (!_g && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
53
+ }
54
+ finally { if (e_1) throw e_1.error; }
55
+ }
56
+ }
57
+ else {
58
+ yield yield __await(firstVal.value);
59
+ // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case
60
+ yield __await(yield* __asyncDelegator(__asyncValues(pages)));
61
+ }
62
+ }
63
+ else {
64
+ yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value)));
65
+ try {
66
+ for (var _h = true, pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), _d = pages_2_1.done, !_d; _h = true) {
67
+ _f = pages_2_1.value;
68
+ _h = false;
69
+ const page = _f;
70
+ // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,
71
+ // it must be the case that `TPage = TElement[]`
72
+ yield __await(yield* __asyncDelegator(__asyncValues(page)));
73
+ }
74
+ }
75
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
76
+ finally {
77
+ try {
78
+ if (!_h && !_d && (_e = pages_2.return)) yield __await(_e.call(pages_2));
79
+ }
80
+ finally { if (e_2) throw e_2.error; }
81
+ }
82
+ }
83
+ });
84
+ }
85
+ function getPageAsyncIterator(pagedResult_1) {
86
+ return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
87
+ const { pageLink } = options;
88
+ let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
89
+ if (!response) {
90
+ return yield __await(void 0);
91
+ }
92
+ yield yield __await(response.page);
93
+ while (response.nextPageLink) {
94
+ response = yield __await(pagedResult.getPage(response.nextPageLink));
95
+ if (!response) {
96
+ return yield __await(void 0);
97
+ }
98
+ yield yield __await(response.page);
99
+ }
100
+ });
101
+ }
5
102
  /**
6
103
  * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
7
104
  * @param client - Client to use for sending the next page requests
@@ -1 +1 @@
1
- {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAyC1D;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC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AAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { getPagedAsyncIterator } from \"@azure/core-paging\";\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number,\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;GAMG;AACH,SAAS,qBAAqB,CAM5B,WAAqD;;IAErD,MAAM,IAAI,GAAG,oBAAoB,CAAwC,WAAW,CAAC,CAAC;IACtF,OAAO;QACL,IAAI;YACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QACD,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,EACJ,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,mCAClB,CAAC,CAAC,QAAuB,EAAE,EAAE;YAC5B,MAAM,EAAE,iBAAiB,EAAE,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC;YAC7C,OAAO,oBAAoB,CAAC,WAAW,EAAE;gBACvC,QAAQ,EAAE,iBAAiD;aAC5D,CAAC,CAAC;QACL,CAAC,CAA2E;KAC/E,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAClC,WAAqD;;;QAErD,MAAM,KAAK,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,cAAM,KAAK,CAAC,IAAI,EAAE,CAAA,CAAC;QACpC,6FAA6F;QAC7F,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,sCAAsC;YACtC,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;YACnC,IAAI,UAAU,EAAE,CAAC;gBACf,cAAA,KAAK,CAAC,CAAC,iBAAA,cAAA,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAe,CAAA,CAAA,CAAA,CAAC;;oB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;IACnB,CAAC;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (pageLink: string) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
@@ -26,7 +26,7 @@ export interface RoleAssignmentsListRoleAssignmentsQueryParam {
26
26
  queryParameters?: RoleAssignmentsListRoleAssignmentsQueryParamProperties;
27
27
  }
28
28
  export interface RoleAssignmentsListRoleAssignmentsHeaderParam {
29
- headers: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders;
29
+ headers?: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders;
30
30
  }
31
31
  export type RoleAssignmentsListRoleAssignmentsParameters = RoleAssignmentsListRoleAssignmentsQueryParam & RoleAssignmentsListRoleAssignmentsHeaderParam & RequestParameters;
32
32
  export interface RoleAssignmentsCreateRoleAssignmentBodyParam {
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEtF,MAAM,WAAW,4CAA4C;IAC3D,uDAAuD;IACvD,IAAI,EAAE,2BAA2B,CAAC;CACnC;AAED,MAAM,WAAW,kDAAkD;IACjE,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAk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,GACtD,4CAA4C,GAC1C,6CAA6C,GAC7C,iBAAiB,CAAC;AAEtB,MAAM,WAAW,4CAA4C;IAC3D,+CAA+C;IAC/C,IAAI,EAAE,qBAAqB,CAAC;CAC7B;AAED,MAAM,WAAW,kDAAkD;IACjE,2BAA2B;IAC3B,WAAW,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAAC;CAChD;AAED,MAAM,MAAM,6CAA6C,GACvD,kDAAkD,GAChD,4CAA4C,GAC5C,iBAAiB,CAAC;AACtB,MAAM,MAAM,8CAA8C,GAAG,iBAAiB,CAAC;AAE/E,MAAM,WAAW,2DAA2D;IAC1E,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iDAAiD;IAChE,eAAe,CAAC,EAAE,2DAA2D,CAAC;CAC/E;AAED,MAAM,MAAM,iDAAiD,GAC3D,iDAAiD,GAAG,iBAAiB,CAAC;AAExE,MAAM,WAAW,sDAAsD;IACrE,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4CAA4C;IAC3D,eAAe,CAAC,EAAE,sDAAsD,CAAC;CAC1E;AAED,MAAM,MAAM,4CAA4C,GACtD,4CAA4C,GAAG,iBAAiB,CAAC;AACnE,MAAM,MAAM,8CAA8C,GAAG,iBAAiB,CAAC;AAC/E,MAAM,MAAM,mCAAmC,GAAG,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { CheckPrincipalAccessRequest, RoleAssignmentRequest } from \"./models.js\";\n\nexport interface RoleAssignmentsCheckPrincipalAccessBodyParam {\n /** Details of scope, list of actions and principal. */\n body: CheckPrincipalAccessRequest;\n}\n\nexport interface RoleAssignmentsCheckPrincipalAccessMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\" | \"text/json\";\n}\n\nexport type RoleAssignmentsCheckPrincipalAccessParameters =\n RoleAssignmentsCheckPrincipalAccessMediaTypesParam &\n RoleAssignmentsCheckPrincipalAccessBodyParam &\n RequestParameters;\n\nexport interface RoleAssignmentsListRoleAssignmentsHeaders {\n /** Continuation token. */\n \"x-ms-continuation\"?: string;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsQueryParamProperties {\n /** Synapse Built-In Role Id. */\n roleId?: string;\n /** Object ID of the AAD principal or security-group. */\n principalId?: string;\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsQueryParam {\n queryParameters?: RoleAssignmentsListRoleAssignmentsQueryParamProperties;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsHeaderParam {\n headers: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders;\n}\n\nexport type RoleAssignmentsListRoleAssignmentsParameters =\n RoleAssignmentsListRoleAssignmentsQueryParam &\n RoleAssignmentsListRoleAssignmentsHeaderParam &\n RequestParameters;\n\nexport interface RoleAssignmentsCreateRoleAssignmentBodyParam {\n /** Details of role id, scope and object id. */\n body: RoleAssignmentRequest;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignmentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\" | \"text/json\";\n}\n\nexport type RoleAssignmentsCreateRoleAssignmentParameters =\n RoleAssignmentsCreateRoleAssignmentMediaTypesParam &\n RoleAssignmentsCreateRoleAssignmentBodyParam &\n RequestParameters;\nexport type RoleAssignmentsGetRoleAssignmentByIdParameters = RequestParameters;\n\nexport interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties {\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParam {\n queryParameters?: RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties;\n}\n\nexport type RoleAssignmentsDeleteRoleAssignmentByIdParameters =\n RoleAssignmentsDeleteRoleAssignmentByIdQueryParam & RequestParameters;\n\nexport interface RoleDefinitionsListRoleDefinitionsQueryParamProperties {\n /** Is a Synapse Built-In Role or not. */\n isBuiltIn?: boolean;\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleDefinitionsListRoleDefinitionsQueryParam {\n queryParameters?: RoleDefinitionsListRoleDefinitionsQueryParamProperties;\n}\n\nexport type RoleDefinitionsListRoleDefinitionsParameters =\n RoleDefinitionsListRoleDefinitionsQueryParam & RequestParameters;\nexport type RoleDefinitionsGetRoleDefinitionByIdParameters = RequestParameters;\nexport type RoleDefinitionsListScopesParameters = RequestParameters;\n"]}
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { CheckPrincipalAccessRequest, RoleAssignmentRequest } from \"./models.js\";\n\nexport interface RoleAssignmentsCheckPrincipalAccessBodyParam {\n /** Details of scope, list of actions and principal. */\n body: CheckPrincipalAccessRequest;\n}\n\nexport interface RoleAssignmentsCheckPrincipalAccessMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\" | \"text/json\";\n}\n\nexport type RoleAssignmentsCheckPrincipalAccessParameters =\n RoleAssignmentsCheckPrincipalAccessMediaTypesParam &\n RoleAssignmentsCheckPrincipalAccessBodyParam &\n RequestParameters;\n\nexport interface RoleAssignmentsListRoleAssignmentsHeaders {\n /** Continuation token. */\n \"x-ms-continuation\"?: string;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsQueryParamProperties {\n /** Synapse Built-In Role Id. */\n roleId?: string;\n /** Object ID of the AAD principal or security-group. */\n principalId?: string;\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsQueryParam {\n queryParameters?: RoleAssignmentsListRoleAssignmentsQueryParamProperties;\n}\n\nexport interface RoleAssignmentsListRoleAssignmentsHeaderParam {\n headers?: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders;\n}\n\nexport type RoleAssignmentsListRoleAssignmentsParameters =\n RoleAssignmentsListRoleAssignmentsQueryParam &\n RoleAssignmentsListRoleAssignmentsHeaderParam &\n RequestParameters;\n\nexport interface RoleAssignmentsCreateRoleAssignmentBodyParam {\n /** Details of role id, scope and object id. */\n body: RoleAssignmentRequest;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignmentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\" | \"text/json\";\n}\n\nexport type RoleAssignmentsCreateRoleAssignmentParameters =\n RoleAssignmentsCreateRoleAssignmentMediaTypesParam &\n RoleAssignmentsCreateRoleAssignmentBodyParam &\n RequestParameters;\nexport type RoleAssignmentsGetRoleAssignmentByIdParameters = RequestParameters;\n\nexport interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties {\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParam {\n queryParameters?: RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties;\n}\n\nexport type RoleAssignmentsDeleteRoleAssignmentByIdParameters =\n RoleAssignmentsDeleteRoleAssignmentByIdQueryParam & RequestParameters;\n\nexport interface RoleDefinitionsListRoleDefinitionsQueryParamProperties {\n /** Is a Synapse Built-In Role or not. */\n isBuiltIn?: boolean;\n /** Scope of the Synapse Built-in Role. */\n scope?: string;\n}\n\nexport interface RoleDefinitionsListRoleDefinitionsQueryParam {\n queryParameters?: RoleDefinitionsListRoleDefinitionsQueryParamProperties;\n}\n\nexport type RoleDefinitionsListRoleDefinitionsParameters =\n RoleDefinitionsListRoleDefinitionsQueryParam & RequestParameters;\nexport type RoleDefinitionsGetRoleDefinitionByIdParameters = RequestParameters;\nexport type RoleDefinitionsListScopesParameters = RequestParameters;\n"]}
@@ -7,7 +7,7 @@ export interface RoleAssignmentsCheckPrincipalAccess200Response extends HttpResp
7
7
  body: CheckPrincipalAccessResponseOutput;
8
8
  }
9
9
  /** Check if the given principalId has access to perform list of actions at a given scope. */
10
- export interface RoleAssignmentsCheckPrincipalAccessdefaultResponse extends HttpResponse {
10
+ export interface RoleAssignmentsCheckPrincipalAccessDefaultResponse extends HttpResponse {
11
11
  status: string;
12
12
  body: ErrorContractOutput;
13
13
  }
@@ -22,7 +22,7 @@ export interface RoleAssignmentsListRoleAssignments200Response extends HttpRespo
22
22
  headers: RawHttpHeaders & RoleAssignmentsListRoleAssignments200Headers;
23
23
  }
24
24
  /** List role assignments. */
25
- export interface RoleAssignmentsListRoleAssignmentsdefaultResponse extends HttpResponse {
25
+ export interface RoleAssignmentsListRoleAssignmentsDefaultResponse extends HttpResponse {
26
26
  status: string;
27
27
  body: ErrorContractOutput;
28
28
  }
@@ -32,7 +32,7 @@ export interface RoleAssignmentsCreateRoleAssignment200Response extends HttpResp
32
32
  body: RoleAssignmentDetailsOutput;
33
33
  }
34
34
  /** Create role assignment. */
35
- export interface RoleAssignmentsCreateRoleAssignmentdefaultResponse extends HttpResponse {
35
+ export interface RoleAssignmentsCreateRoleAssignmentDefaultResponse extends HttpResponse {
36
36
  status: string;
37
37
  body: ErrorContractOutput;
38
38
  }
@@ -42,22 +42,20 @@ export interface RoleAssignmentsGetRoleAssignmentById200Response extends HttpRes
42
42
  body: RoleAssignmentDetailsOutput;
43
43
  }
44
44
  /** Get role assignment by role assignment Id. */
45
- export interface RoleAssignmentsGetRoleAssignmentByIddefaultResponse extends HttpResponse {
45
+ export interface RoleAssignmentsGetRoleAssignmentByIdDefaultResponse extends HttpResponse {
46
46
  status: string;
47
47
  body: ErrorContractOutput;
48
48
  }
49
49
  /** Delete role assignment by role assignment Id. */
50
50
  export interface RoleAssignmentsDeleteRoleAssignmentById200Response extends HttpResponse {
51
51
  status: "200";
52
- body: Record<string, unknown>;
53
52
  }
54
53
  /** Delete role assignment by role assignment Id. */
55
54
  export interface RoleAssignmentsDeleteRoleAssignmentById204Response extends HttpResponse {
56
55
  status: "204";
57
- body: Record<string, unknown>;
58
56
  }
59
57
  /** Delete role assignment by role assignment Id. */
60
- export interface RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse extends HttpResponse {
58
+ export interface RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse extends HttpResponse {
61
59
  status: string;
62
60
  body: ErrorContractOutput;
63
61
  }
@@ -67,7 +65,7 @@ export interface RoleDefinitionsListRoleDefinitions200Response extends HttpRespo
67
65
  body: Array<SynapseRoleDefinitionOutput>;
68
66
  }
69
67
  /** List role definitions. */
70
- export interface RoleDefinitionsListRoleDefinitionsdefaultResponse extends HttpResponse {
68
+ export interface RoleDefinitionsListRoleDefinitionsDefaultResponse extends HttpResponse {
71
69
  status: string;
72
70
  body: ErrorContractOutput;
73
71
  }
@@ -77,7 +75,7 @@ export interface RoleDefinitionsGetRoleDefinitionById200Response extends HttpRes
77
75
  body: SynapseRoleDefinitionOutput;
78
76
  }
79
77
  /** Get role definition by role definition Id. */
80
- export interface RoleDefinitionsGetRoleDefinitionByIddefaultResponse extends HttpResponse {
78
+ export interface RoleDefinitionsGetRoleDefinitionByIdDefaultResponse extends HttpResponse {
81
79
  status: string;
82
80
  body: ErrorContractOutput;
83
81
  }
@@ -87,7 +85,7 @@ export interface RoleDefinitionsListScopes200Response extends HttpResponse {
87
85
  body: Array<string>;
88
86
  }
89
87
  /** List rbac scopes. */
90
- export interface RoleDefinitionsListScopesdefaultResponse extends HttpResponse {
88
+ export interface RoleDefinitionsListScopesDefaultResponse extends HttpResponse {
91
89
  status: string;
92
90
  body: Err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IACd,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB;AAED,wBAAwB;AACxB,MAAM,WAAW,wCAAyC,SAAQ,YAAY;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n CheckPrincipalAccessResponseOutput,\n ErrorContractOutput,\n RoleAssignmentDetailsListOutput,\n RoleAssignmentDetailsOutput,\n SynapseRoleDefinitionOutput,\n} from \"./outputModels.js\";\n\n/** Check if the given principalId has access to perform list of actions at a given scope. */\nexport interface RoleAssignmentsCheckPrincipalAccess200Response extends HttpResponse {\n status: \"200\";\n body: CheckPrincipalAccessResponseOutput;\n}\n\n/** Check if the given principalId has access to perform list of actions at a given scope. */\nexport interface RoleAssignmentsCheckPrincipalAccessdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\nexport interface RoleAssignmentsListRoleAssignments200Headers {\n /** If the number of role assignments to be listed exceeds the maxResults limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the list operation to continue listing the role assignments. */\n \"x-ms-continuation\"?: string;\n}\n\n/** List role assignments. */\nexport interface RoleAssignmentsListRoleAssignments200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsListOutput;\n headers: RawHttpHeaders & RoleAssignmentsListRoleAssignments200Headers;\n}\n\n/** List role assignments. */\nexport interface RoleAssignmentsListRoleAssignmentsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Create role assignment. */\nexport interface RoleAssignmentsCreateRoleAssignment200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsOutput;\n}\n\n/** Create role assignment. */\nexport interface RoleAssignmentsCreateRoleAssignmentdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Get role assignment by role assignment Id. */\nexport interface RoleAssignmentsGetRoleAssignmentById200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsOutput;\n}\n\n/** Get role assignment by role assignment Id. */\nexport interface RoleAssignmentsGetRoleAssignmentByIddefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentById200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentById204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** List role definitions. */\nexport interface RoleDefinitionsListRoleDefinitions200Response extends HttpResponse {\n status: \"200\";\n body: Array<SynapseRoleDefinitionOutput>;\n}\n\n/** List role definitions. */\nexport interface RoleDefinitionsListRoleDefinitionsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Get role definition by role definition Id. */\nexport interface RoleDefinitionsGetRoleDefinitionById200Response extends HttpResponse {\n status: \"200\";\n body: SynapseRoleDefinitionOutput;\n}\n\n/** Get role definition by role definition Id. */\nexport interface RoleDefinitionsGetRoleDefinitionByIddefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** List rbac scopes. */\nexport interface RoleDefinitionsListScopes200Response extends HttpResponse {\n status: \"200\";\n body: Array<string>;\n}\n\n/** List rbac scopes. */\nexport interface RoleDefinitionsListScopesdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n"]}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse } from \"@azure-rest/core-client\";\nimport type {\n CheckPrincipalAccessResponseOutput,\n ErrorContractOutput,\n RoleAssignmentDetailsListOutput,\n RoleAssignmentDetailsOutput,\n SynapseRoleDefinitionOutput,\n} from \"./outputModels.js\";\n\n/** Check if the given principalId has access to perform list of actions at a given scope. */\nexport interface RoleAssignmentsCheckPrincipalAccess200Response extends HttpResponse {\n status: \"200\";\n body: CheckPrincipalAccessResponseOutput;\n}\n\n/** Check if the given principalId has access to perform list of actions at a given scope. */\nexport interface RoleAssignmentsCheckPrincipalAccessDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\nexport interface RoleAssignmentsListRoleAssignments200Headers {\n /** If the number of role assignments to be listed exceeds the maxResults limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the list operation to continue listing the role assignments. */\n \"x-ms-continuation\"?: string;\n}\n\n/** List role assignments. */\nexport interface RoleAssignmentsListRoleAssignments200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsListOutput;\n headers: RawHttpHeaders & RoleAssignmentsListRoleAssignments200Headers;\n}\n\n/** List role assignments. */\nexport interface RoleAssignmentsListRoleAssignmentsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Create role assignment. */\nexport interface RoleAssignmentsCreateRoleAssignment200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsOutput;\n}\n\n/** Create role assignment. */\nexport interface RoleAssignmentsCreateRoleAssignmentDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Get role assignment by role assignment Id. */\nexport interface RoleAssignmentsGetRoleAssignmentById200Response extends HttpResponse {\n status: \"200\";\n body: RoleAssignmentDetailsOutput;\n}\n\n/** Get role assignment by role assignment Id. */\nexport interface RoleAssignmentsGetRoleAssignmentByIdDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentById200Response extends HttpResponse {\n status: \"200\";\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentById204Response extends HttpResponse {\n status: \"204\";\n}\n\n/** Delete role assignment by role assignment Id. */\nexport interface RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** List role definitions. */\nexport interface RoleDefinitionsListRoleDefinitions200Response extends HttpResponse {\n status: \"200\";\n body: Array<SynapseRoleDefinitionOutput>;\n}\n\n/** List role definitions. */\nexport interface RoleDefinitionsListRoleDefinitionsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** Get role definition by role definition Id. */\nexport interface RoleDefinitionsGetRoleDefinitionById200Response extends HttpResponse {\n status: \"200\";\n body: SynapseRoleDefinitionOutput;\n}\n\n/** Get role definition by role definition Id. */\nexport interface RoleDefinitionsGetRoleDefinitionByIdDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n\n/** List rbac scopes. */\nexport interface RoleDefinitionsListScopes200Response extends HttpResponse {\n status: \"200\";\n body: Array<string>;\n}\n\n/** List rbac scopes. */\nexport interface RoleDefinitionsListScopesDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorContractOutput;\n}\n"]}
@@ -1,5 +1,16 @@
1
1
  import type { ClientOptions } from "@azure-rest/core-client";
2
2
  import type { TokenCredential } from "@azure/core-auth";
3
3
  import type { AccessControlRestClient } from "./clientDefinitions.js";
4
- export default function createClient(endpoint: string, credentials: TokenCredential, options?: ClientOptions): AccessControlRestClient;
4
+ /** The optional parameters for the client */
5
+ export interface AccessControlRestClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
9
+ /**
10
+ * Initialize a new instance of `AccessControlRestClient`
11
+ * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.
12
+ * @param credentials - uniquely identify client credential
13
+ * @param options - the parameter for all optional parameters
14
+ */
15
+ export default function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: AccessControlRestClientOptions): AccessControlRestClient;
5
16
  //# sourceMappingURL=accessControlRestClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessControlRestClient.d.ts","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,OAAO,GAAE,aAAkB,GAC1B,uBAAuB,CAyBzB"}
1
+ {"version":3,"file":"accessControlRestClient.d.ts","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,6CAA6C;AAC7C,MAAM,WAAW,8BAA+B,SAAQ,aAAa;IACnE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,8BAAmC,GAC7E,uBAAuB,CAuCzB"}
@@ -1,21 +1,43 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ import { __rest } from "tslib";
3
4
  import { getClient } from "@azure-rest/core-client";
4
- export default function createClient(endpoint, credentials, options = {}) {
5
- var _a, _b;
6
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}`;
7
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2020-12-01";
8
- options = Object.assign(Object.assign({}, options), { credentials: {
9
- scopes: ["https://dev.azuresynapse.net/.default"],
10
- } });
5
+ import { logger } from "./logger.js";
6
+ /**
7
+ * Initialize a new instance of `AccessControlRestClient`
8
+ * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.
9
+ * @param credentials - uniquely identify client credential
10
+ * @param options - the parameter for all optional parameters
11
+ */
12
+ export default function createClient(endpoint, credentials, _a = {}) {
13
+ var _b, _c, _d, _e, _f, _g;
14
+ var { apiVersion = "2020-12-01" } = _a, options = __rest(_a, ["apiVersion"]);
15
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpoint}`;
11
16
  const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;
12
17
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
13
18
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
14
19
  : `${userAgentInfo}`;
15
20
  options = Object.assign(Object.assign({}, options), { userAgentOptions: {
16
21
  userAgentPrefix,
22
+ }, loggingOptions: {
23
+ logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
24
+ }, credentials: {
25
+ scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://dev.azuresynapse.net/.default"],
17
26
  } });
18
- const client = getClient(baseUrl, credentials, options);
27
+ const client = getClient(endpointUrl, credentials, options);
28
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
29
+ client.pipeline.addPolicy({
30
+ name: "ClientApiVersionPolicy",
31
+ sendRequest: (req, next) => {
32
+ // Use the apiVersion defined in request url directly
33
+ // Append one if there is no apiVersion and we have one at client options
34
+ const url = new URL(req.url);
35
+ if (!url.searchParams.get("api-version") && apiVersion) {
36
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
37
+ }
38
+ return next(req);
39
+ },
40
+ });
19
41
  return client;
20
42
  }
21
43
  //# sourceMappingURL=accessControlRestClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessControlRestClient.js","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,EAAE,CAAC;IACjD,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,uCAAuC,CAAC;SAClD,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,mDAAmD,CAAC;IAC1E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA4B,CAAC;IAEnF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { AccessControlRestClient } from \"./clientDefinitions.js\";\n\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {},\n): AccessControlRestClient {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2020-12-01\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://dev.azuresynapse.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as AccessControlRestClient;\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"accessControlRestClient.js","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,KAA4E,EAAE;;QAA9E,EAAE,UAAU,GAAG,YAAY,OAA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AK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { AccessControlRestClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface AccessControlRestClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `AccessControlRestClient`\n * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2020-12-01\", ...options }: AccessControlRestClientOptions = {},\n): AccessControlRestClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`;\n const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://dev.azuresynapse.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as AccessControlRestClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -1,33 +1,33 @@
1
1
  import type { RoleAssignmentsCheckPrincipalAccessParameters, RoleAssignmentsListRoleAssignmentsParameters, RoleAssignmentsCreateRoleAssignmentParameters, RoleAssignmentsGetRoleAssignmentByIdParameters, RoleAssignmentsDeleteRoleAssignmentByIdParameters, RoleDefinitionsListRoleDefinitionsParameters, RoleDefinitionsGetRoleDefinitionByIdParameters, RoleDefinitionsListScopesParameters } from "./parameters.js";
2
- import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessdefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsdefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentdefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIddefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsdefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIddefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesdefaultResponse } from "./responses.js";
2
+ import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesDefaultResponse } from "./responses.js";
3
3
  import type { Client, StreamableMethod } from "@azure-rest/core-client";
4
4
  export interface RoleAssignmentsCheckPrincipalAccess {
5
5
  /** Check if the given principalId has access to perform list of actions at a given scope. */
6
- post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod<RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessdefaultResponse>;
6
+ post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod<RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessDefaultResponse>;
7
7
  }
8
8
  export interface RoleAssignmentsListRoleAssignments {
9
9
  /** List role assignments. */
10
- get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod<RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsdefaultResponse>;
10
+ get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod<RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsDefaultResponse>;
11
11
  }
12
12
  export interface RoleAssignmentsCreateRoleAssignment {
13
13
  /** Create role assignment. */
14
- put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod<RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentdefaultResponse>;
14
+ put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod<RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentDefaultResponse>;
15
15
  /** Get role assignment by role assignment Id. */
16
- get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIddefaultResponse>;
16
+ get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse>;
17
17
  /** Delete role assignment by role assignment Id. */
18
- delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse>;
18
+ delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse>;
19
19
  }
20
20
  export interface RoleDefinitionsListRoleDefinitions {
21
21
  /** List role definitions. */
22
- get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod<RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsdefaultResponse>;
22
+ get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod<RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsDefaultResponse>;
23
23
  }
24
24
  export interface RoleDefinitionsGetRoleDefinitionById {
25
25
  /** Get role definition by role definition Id. */
26
- get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod<RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIddefaultResponse>;
26
+ get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod<RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse>;
27
27
  }
28
28
  export interface RoleDefinitionsListScopes {
29
29
  /** List rbac scopes. */
30
- get(options?: RoleDefinitionsListScopesParameters): StreamableMethod<RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse>;
30
+ get(options?: RoleDefinitionsListScopesParameters): StreamableMethod<RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse>;
31
31
  }
32
32
  export interface Routes {
33
33
  /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccessParameters,\n RoleAssignmentsListRoleAssignmentsParameters,\n RoleAssignmentsCreateRoleAssignmentParameters,\n RoleAssignmentsGetRoleAssignmentByIdParameters,\n RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n RoleDefinitionsListRoleDefinitionsParameters,\n RoleDefinitionsGetRoleDefinitionByIdParameters,\n RoleDefinitionsListScopesParameters,\n} from \"./parameters.js\";\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessdefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsdefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentdefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIddefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsdefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIddefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesdefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface RoleAssignmentsCheckPrincipalAccess {\n /** Check if the given principalId has access to perform list of actions at a given scope. */\n post(\n options: RoleAssignmentsCheckPrincipalAccessParameters,\n ): StreamableMethod<\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessdefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsListRoleAssignments {\n /** List role assignments. */\n get(\n options?: RoleAssignmentsListRoleAssignmentsParameters,\n ): StreamableMethod<\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsdefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignment {\n /** Create role assignment. */\n put(\n options: RoleAssignmentsCreateRoleAssignmentParameters,\n ): StreamableMethod<\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentdefaultResponse\n >;\n /** Get role assignment by role assignment Id. */\n get(\n options?: RoleAssignmentsGetRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIddefaultResponse\n >;\n /** Delete role assignment by role assignment Id. */\n delete(\n options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListRoleDefinitions {\n /** List role definitions. */\n get(\n options?: RoleDefinitionsListRoleDefinitionsParameters,\n ): StreamableMethod<\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsdefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsGetRoleDefinitionById {\n /** Get role definition by role definition Id. */\n get(\n options?: RoleDefinitionsGetRoleDefinitionByIdParameters,\n ): StreamableMethod<\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIddefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListScopes {\n /** List rbac scopes. */\n get(\n options?: RoleDefinitionsListScopesParameters,\n ): StreamableMethod<\n RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */\n (path: \"/checkAccessSynapseRbac\"): RoleAssignmentsCheckPrincipalAccess;\n /** Resource for '/roleAssignments' has methods for the following verbs: get */\n (path: \"/roleAssignments\"): RoleAssignmentsListRoleAssignments;\n /** Resource for '/roleAssignments/\\{roleAssignmentId\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/roleAssignments/{roleAssignmentId}\",\n roleAssignmentId: string,\n ): RoleAssignmentsCreateRoleAssignment;\n /** Resource for '/roleDefinitions' has methods for the following verbs: get */\n (path: \"/roleDefinitions\"): RoleDefinitionsListRoleDefinitions;\n /** Resource for '/roleDefinitions/\\{roleDefinitionId\\}' has methods for the following verbs: get */\n (\n path: \"/roleDefinitions/{roleDefinitionId}\",\n roleDefinitionId: string,\n ): RoleDefinitionsGetRoleDefinitionById;\n /** Resource for '/rbacScopes' has methods for the following verbs: get */\n (path: \"/rbacScopes\"): RoleDefinitionsListScopes;\n}\n\nexport type AccessControlRestClient = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccessParameters,\n RoleAssignmentsListRoleAssignmentsParameters,\n RoleAssignmentsCreateRoleAssignmentParameters,\n RoleAssignmentsGetRoleAssignmentByIdParameters,\n RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n RoleDefinitionsListRoleDefinitionsParameters,\n RoleDefinitionsGetRoleDefinitionByIdParameters,\n RoleDefinitionsListScopesParameters,\n} from \"./parameters.js\";\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessDefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsDefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentDefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIdDefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsDefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIdDefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface RoleAssignmentsCheckPrincipalAccess {\n /** Check if the given principalId has access to perform list of actions at a given scope. */\n post(\n options: RoleAssignmentsCheckPrincipalAccessParameters,\n ): StreamableMethod<\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessDefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsListRoleAssignments {\n /** List role assignments. */\n get(\n options?: RoleAssignmentsListRoleAssignmentsParameters,\n ): StreamableMethod<\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsDefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignment {\n /** Create role assignment. */\n put(\n options: RoleAssignmentsCreateRoleAssignmentParameters,\n ): StreamableMethod<\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentDefaultResponse\n >;\n /** Get role assignment by role assignment Id. */\n get(\n options?: RoleAssignmentsGetRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse\n >;\n /** Delete role assignment by role assignment Id. */\n delete(\n options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListRoleDefinitions {\n /** List role definitions. */\n get(\n options?: RoleDefinitionsListRoleDefinitionsParameters,\n ): StreamableMethod<\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsGetRoleDefinitionById {\n /** Get role definition by role definition Id. */\n get(\n options?: RoleDefinitionsGetRoleDefinitionByIdParameters,\n ): StreamableMethod<\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListScopes {\n /** List rbac scopes. */\n get(\n options?: RoleDefinitionsListScopesParameters,\n ): StreamableMethod<\n RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */\n (path: \"/checkAccessSynapseRbac\"): RoleAssignmentsCheckPrincipalAccess;\n /** Resource for '/roleAssignments' has methods for the following verbs: get */\n (path: \"/roleAssignments\"): RoleAssignmentsListRoleAssignments;\n /** Resource for '/roleAssignments/\\{roleAssignmentId\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/roleAssignments/{roleAssignmentId}\",\n roleAssignmentId: string,\n ): RoleAssignmentsCreateRoleAssignment;\n /** Resource for '/roleDefinitions' has methods for the following verbs: get */\n (path: \"/roleDefinitions\"): RoleDefinitionsListRoleDefinitions;\n /** Resource for '/roleDefinitions/\\{roleDefinitionId\\}' has methods for the following verbs: get */\n (\n path: \"/roleDefinitions/{roleDefinitionId}\",\n roleDefinitionId: string,\n ): RoleDefinitionsGetRoleDefinitionById;\n /** Resource for '/rbacScopes' has methods for the following verbs: get */\n (path: \"/rbacScopes\"): RoleDefinitionsListScopes;\n}\n\nexport type AccessControlRestClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,10 +1,10 @@
1
- import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessdefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsdefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentdefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIddefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsdefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIddefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesdefaultResponse } from "./responses.js";
2
- export declare function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessdefaultResponse): response is RoleAssignmentsCheckPrincipalAccessdefaultResponse;
3
- export declare function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsdefaultResponse): response is RoleAssignmentsListRoleAssignmentsdefaultResponse;
4
- export declare function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentdefaultResponse): response is RoleAssignmentsCreateRoleAssignmentdefaultResponse;
5
- export declare function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIddefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIddefaultResponse;
6
- export declare function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse;
7
- export declare function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsdefaultResponse): response is RoleDefinitionsListRoleDefinitionsdefaultResponse;
8
- export declare function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIddefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIddefaultResponse;
9
- export declare function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse): response is RoleDefinitionsListScopesdefaultResponse;
1
+ import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesDefaultResponse } from "./responses.js";
2
+ export declare function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessDefaultResponse): response is RoleAssignmentsCheckPrincipalAccessDefaultResponse;
3
+ export declare function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsDefaultResponse): response is RoleAssignmentsListRoleAssignmentsDefaultResponse;
4
+ export declare function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentDefaultResponse): response is RoleAssignmentsCreateRoleAssignmentDefaultResponse;
5
+ export declare function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIdDefaultResponse;
6
+ export declare function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse;
7
+ export declare function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsDefaultResponse): response is RoleDefinitionsListRoleDefinitionsDefaultResponse;
8
+ export declare function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIdDefaultResponse;
9
+ export declare function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse): response is RoleDefinitionsListScopesDefaultResponse;
10
10
  //# sourceMappingURL=isUnexpected.d.ts.map