From 02bb5caf51f8f509381736d836a8b21f3801cfa8 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:03:39 +0800 Subject: [PATCH] refresh synapse-access-control-rest --- .../synapse-access-control-rest/package.json | 3 +- .../review/synapse-access-control.api.md | 103 +++++------ .../src/accessControlRestClient.ts | 62 +++++-- .../src/clientDefinitions.ts | 54 +++--- .../src/isUnexpected.ts | 162 ++++++++++-------- .../synapse-access-control-rest/src/logger.ts | 5 + .../synapse-access-control-rest/src/models.ts | 4 + .../src/outputModels.ts | 23 ++- .../src/paginateHelper.ts | 20 +-- .../src/parameters.ts | 31 ++-- .../src/responses.ts | 20 +-- .../swagger/README.md | 2 + 12 files changed, 278 insertions(+), 211 deletions(-) create mode 100644 sdk/synapse/synapse-access-control-rest/src/logger.ts diff --git a/sdk/synapse/synapse-access-control-rest/package.json b/sdk/synapse/synapse-access-control-rest/package.json index 9a6fb2a29556..7d44e6e885b5 100644 --- a/sdk/synapse/synapse-access-control-rest/package.json +++ b/sdk/synapse/synapse-access-control-rest/package.json @@ -9,7 +9,7 @@ "dependencies": { "@azure-rest/core-client": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-paging": "^1.2.0", + "@azure/core-paging": "^1.5.0", "@azure/core-rest-pipeline": "^1.3.0", "tslib": "^2.2.0" }, @@ -42,6 +42,7 @@ "devDependencies": { "@azure-tools/test-credential": "^1.0.0", "@azure-tools/test-recorder": "^3.0.0", + "@azure/logger": "^1.0.0", "@azure/core-util": "^1.6.1", "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", diff --git a/sdk/synapse/synapse-access-control-rest/review/synapse-access-control.api.md b/sdk/synapse/synapse-access-control-rest/review/synapse-access-control.api.md index afbfc4b4f56f..f88fb17ac905 100644 --- a/sdk/synapse/synapse-access-control-rest/review/synapse-access-control.api.md +++ b/sdk/synapse/synapse-access-control-rest/review/synapse-access-control.api.md @@ -20,47 +20,52 @@ export type AccessControlRestClient = Client & { path: Routes; }; -// @public (undocumented) +// @public +export interface AccessControlRestClientOptions extends ClientOptions { + apiVersion?: string; +} + +// @public export interface CheckAccessDecisionOutput { accessDecision?: string; actionId?: string; roleAssignment?: RoleAssignmentDetailsOutput; } -// @public (undocumented) +// @public export interface CheckPrincipalAccessRequest { actions: Array; scope: string; subject: SubjectInfo; } -// @public (undocumented) +// @public export interface CheckPrincipalAccessResponseOutput { AccessDecisions?: Array; } -// @public (undocumented) -function createClient(endpoint: string, credentials: TokenCredential, options?: ClientOptions): AccessControlRestClient; +// @public +function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: AccessControlRestClientOptions): AccessControlRestClient; export default createClient; -// @public (undocumented) +// @public export interface ErrorAdditionalInfoOutput { - info?: Record; - type?: string; + readonly info?: Record; + readonly type?: string; } -// @public (undocumented) +// @public export interface ErrorContractOutput { error?: ErrorResponseOutput; } -// @public (undocumented) +// @public export interface ErrorResponseOutput { - additionalInfo?: Array; - code?: string; - details?: Array; - message?: string; - target?: string; + readonly additionalInfo?: Array; + readonly code?: string; + readonly details?: Array; + readonly message?: string; + readonly target?: string; } // @public @@ -73,28 +78,28 @@ export type GetPage = (pageLink: string, maxPageSize?: number) => Promise }>; // @public (undocumented) -export function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessdefaultResponse): response is RoleAssignmentsCheckPrincipalAccessdefaultResponse; +export function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessDefaultResponse): response is RoleAssignmentsCheckPrincipalAccessDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsdefaultResponse): response is RoleAssignmentsListRoleAssignmentsdefaultResponse; +export function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsDefaultResponse): response is RoleAssignmentsListRoleAssignmentsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentdefaultResponse): response is RoleAssignmentsCreateRoleAssignmentdefaultResponse; +export function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentDefaultResponse): response is RoleAssignmentsCreateRoleAssignmentDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIddefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIddefaultResponse; +export function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIdDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse; +export function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsdefaultResponse): response is RoleDefinitionsListRoleDefinitionsdefaultResponse; +export function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsDefaultResponse): response is RoleDefinitionsListRoleDefinitionsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIddefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIddefaultResponse; +export function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIdDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse): response is RoleDefinitionsListScopesdefaultResponse; +export function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse): response is RoleDefinitionsListScopesDefaultResponse; // @public export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; @@ -111,19 +116,19 @@ export interface PagingOptions { customGetPage?: GetPage[]>; } -// @public (undocumented) +// @public export interface RequiredAction { id: string; isDataAction: boolean; } -// @public (undocumented) +// @public export interface RoleAssignmentDetailsListOutput { count?: number; value?: Array; } -// @public (undocumented) +// @public export interface RoleAssignmentDetailsOutput { id?: string; principalId?: string; @@ -132,7 +137,7 @@ export interface RoleAssignmentDetailsOutput { scope?: string; } -// @public (undocumented) +// @public export interface RoleAssignmentRequest { principalId: string; principalType?: string; @@ -142,7 +147,7 @@ export interface RoleAssignmentRequest { // @public (undocumented) export interface RoleAssignmentsCheckPrincipalAccess { - post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod; + post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod; } // @public @@ -159,7 +164,7 @@ export interface RoleAssignmentsCheckPrincipalAccessBodyParam { } // @public -export interface RoleAssignmentsCheckPrincipalAccessdefaultResponse extends HttpResponse { +export interface RoleAssignmentsCheckPrincipalAccessDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -176,9 +181,9 @@ export type RoleAssignmentsCheckPrincipalAccessParameters = RoleAssignmentsCheck // @public (undocumented) export interface RoleAssignmentsCreateRoleAssignment { - delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod; - get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod; - put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod; + delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod; + get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod; + put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod; } // @public @@ -195,7 +200,7 @@ export interface RoleAssignmentsCreateRoleAssignmentBodyParam { } // @public -export interface RoleAssignmentsCreateRoleAssignmentdefaultResponse extends HttpResponse { +export interface RoleAssignmentsCreateRoleAssignmentDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -212,22 +217,18 @@ export type RoleAssignmentsCreateRoleAssignmentParameters = RoleAssignmentsCreat // @public export interface RoleAssignmentsDeleteRoleAssignmentById200Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "200"; } // @public export interface RoleAssignmentsDeleteRoleAssignmentById204Response extends HttpResponse { - // (undocumented) - body: Record; // (undocumented) status: "204"; } // @public -export interface RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse extends HttpResponse { +export interface RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -257,7 +258,7 @@ export interface RoleAssignmentsGetRoleAssignmentById200Response extends HttpRes } // @public -export interface RoleAssignmentsGetRoleAssignmentByIddefaultResponse extends HttpResponse { +export interface RoleAssignmentsGetRoleAssignmentByIdDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -269,7 +270,7 @@ export type RoleAssignmentsGetRoleAssignmentByIdParameters = RequestParameters; // @public (undocumented) export interface RoleAssignmentsListRoleAssignments { - get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod; + get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod; } // @public (undocumented) @@ -288,7 +289,7 @@ export interface RoleAssignmentsListRoleAssignments200Response extends HttpRespo } // @public -export interface RoleAssignmentsListRoleAssignmentsdefaultResponse extends HttpResponse { +export interface RoleAssignmentsListRoleAssignmentsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -298,7 +299,7 @@ export interface RoleAssignmentsListRoleAssignmentsdefaultResponse extends HttpR // @public (undocumented) export interface RoleAssignmentsListRoleAssignmentsHeaderParam { // (undocumented) - headers: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders; + headers?: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders; } // @public (undocumented) @@ -324,7 +325,7 @@ export interface RoleAssignmentsListRoleAssignmentsQueryParamProperties { // @public (undocumented) export interface RoleDefinitionsGetRoleDefinitionById { - get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod; + get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod; } // @public @@ -336,7 +337,7 @@ export interface RoleDefinitionsGetRoleDefinitionById200Response extends HttpRes } // @public -export interface RoleDefinitionsGetRoleDefinitionByIddefaultResponse extends HttpResponse { +export interface RoleDefinitionsGetRoleDefinitionByIdDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -348,7 +349,7 @@ export type RoleDefinitionsGetRoleDefinitionByIdParameters = RequestParameters; // @public (undocumented) export interface RoleDefinitionsListRoleDefinitions { - get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod; + get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod; } // @public @@ -360,7 +361,7 @@ export interface RoleDefinitionsListRoleDefinitions200Response extends HttpRespo } // @public -export interface RoleDefinitionsListRoleDefinitionsdefaultResponse extends HttpResponse { +export interface RoleDefinitionsListRoleDefinitionsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -384,7 +385,7 @@ export interface RoleDefinitionsListRoleDefinitionsQueryParamProperties { // @public (undocumented) export interface RoleDefinitionsListScopes { - get(options?: RoleDefinitionsListScopesParameters): StreamableMethod; + get(options?: RoleDefinitionsListScopesParameters): StreamableMethod; } // @public @@ -396,7 +397,7 @@ export interface RoleDefinitionsListScopes200Response extends HttpResponse { } // @public -export interface RoleDefinitionsListScopesdefaultResponse extends HttpResponse { +export interface RoleDefinitionsListScopesDefaultResponse extends HttpResponse { // (undocumented) body: ErrorContractOutput; // (undocumented) @@ -416,13 +417,13 @@ export interface Routes { (path: "/rbacScopes"): RoleDefinitionsListScopes; } -// @public (undocumented) +// @public export interface SubjectInfo { groupIds?: Array; principalId: string; } -// @public (undocumented) +// @public export interface SynapseRbacPermissionOutput { actions?: Array; dataActions?: Array; @@ -430,7 +431,7 @@ export interface SynapseRbacPermissionOutput { notDataActions?: Array; } -// @public (undocumented) +// @public export interface SynapseRoleDefinitionOutput { availabilityStatus?: string; description?: string; diff --git a/sdk/synapse/synapse-access-control-rest/src/accessControlRestClient.ts b/sdk/synapse/synapse-access-control-rest/src/accessControlRestClient.ts index 1d3764d55d01..fe2a082ce4d4 100644 --- a/sdk/synapse/synapse-access-control-rest/src/accessControlRestClient.ts +++ b/sdk/synapse/synapse-access-control-rest/src/accessControlRestClient.ts @@ -2,23 +2,31 @@ // Licensed under the MIT License. import { getClient, ClientOptions } from "@azure-rest/core-client"; +import { logger } from "./logger"; import { TokenCredential } from "@azure/core-auth"; import { AccessControlRestClient } from "./clientDefinitions"; +/** The optional parameters for the client */ +export interface AccessControlRestClientOptions extends ClientOptions { + /** The api version option of the client */ + apiVersion?: string; +} + +/** + * Initialize a new instance of `AccessControlRestClient` + * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`. + * @param credentials - uniquely identify client credential + * @param options - the parameter for all optional parameters + */ export default function createClient( endpoint: string, credentials: TokenCredential, - options: ClientOptions = {} + { + apiVersion = "2020-12-01", + ...options + }: AccessControlRestClientOptions = {}, ): AccessControlRestClient { - const baseUrl = options.baseUrl ?? `${endpoint}`; - options.apiVersion = options.apiVersion ?? "2020-12-01"; - options = { - ...options, - credentials: { - scopes: ["https://dev.azuresynapse.net/.default"] - } - }; - + const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`; const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix @@ -27,15 +35,39 @@ export default function createClient( options = { ...options, userAgentOptions: { - userAgentPrefix - } + userAgentPrefix, + }, + loggingOptions: { + logger: options.loggingOptions?.logger ?? logger.info, + }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://dev.azuresynapse.net/.default", + ], + }, }; - const client = getClient( - baseUrl, + endpointUrl, credentials, - options + options, ) as AccessControlRestClient; + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return client; } diff --git a/sdk/synapse/synapse-access-control-rest/src/clientDefinitions.ts b/sdk/synapse/synapse-access-control-rest/src/clientDefinitions.ts index c2fb1ff21f7c..f235d625982d 100644 --- a/sdk/synapse/synapse-access-control-rest/src/clientDefinitions.ts +++ b/sdk/synapse/synapse-access-control-rest/src/clientDefinitions.ts @@ -9,101 +9,101 @@ import { RoleAssignmentsDeleteRoleAssignmentByIdParameters, RoleDefinitionsListRoleDefinitionsParameters, RoleDefinitionsGetRoleDefinitionByIdParameters, - RoleDefinitionsListScopesParameters + RoleDefinitionsListScopesParameters, } from "./parameters"; import { RoleAssignmentsCheckPrincipalAccess200Response, - RoleAssignmentsCheckPrincipalAccessdefaultResponse, + RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, - RoleAssignmentsListRoleAssignmentsdefaultResponse, + RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, - RoleAssignmentsCreateRoleAssignmentdefaultResponse, + RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, - RoleAssignmentsGetRoleAssignmentByIddefaultResponse, + RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, - RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, + RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, - RoleDefinitionsListRoleDefinitionsdefaultResponse, + RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, - RoleDefinitionsGetRoleDefinitionByIddefaultResponse, + RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, - RoleDefinitionsListScopesdefaultResponse + RoleDefinitionsListScopesDefaultResponse, } from "./responses"; import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface RoleAssignmentsCheckPrincipalAccess { /** Check if the given principalId has access to perform list of actions at a given scope. */ post( - options: RoleAssignmentsCheckPrincipalAccessParameters + options: RoleAssignmentsCheckPrincipalAccessParameters, ): StreamableMethod< | RoleAssignmentsCheckPrincipalAccess200Response - | RoleAssignmentsCheckPrincipalAccessdefaultResponse + | RoleAssignmentsCheckPrincipalAccessDefaultResponse >; } export interface RoleAssignmentsListRoleAssignments { /** List role assignments. */ get( - options?: RoleAssignmentsListRoleAssignmentsParameters + options?: RoleAssignmentsListRoleAssignmentsParameters, ): StreamableMethod< | RoleAssignmentsListRoleAssignments200Response - | RoleAssignmentsListRoleAssignmentsdefaultResponse + | RoleAssignmentsListRoleAssignmentsDefaultResponse >; } export interface RoleAssignmentsCreateRoleAssignment { /** Create role assignment. */ put( - options: RoleAssignmentsCreateRoleAssignmentParameters + options: RoleAssignmentsCreateRoleAssignmentParameters, ): StreamableMethod< | RoleAssignmentsCreateRoleAssignment200Response - | RoleAssignmentsCreateRoleAssignmentdefaultResponse + | RoleAssignmentsCreateRoleAssignmentDefaultResponse >; /** Get role assignment by role assignment Id. */ get( - options?: RoleAssignmentsGetRoleAssignmentByIdParameters + options?: RoleAssignmentsGetRoleAssignmentByIdParameters, ): StreamableMethod< | RoleAssignmentsGetRoleAssignmentById200Response - | RoleAssignmentsGetRoleAssignmentByIddefaultResponse + | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse >; /** Delete role assignment by role assignment Id. */ delete( - options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters + options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters, ): StreamableMethod< | RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response - | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse + | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse >; } export interface RoleDefinitionsListRoleDefinitions { /** List role definitions. */ get( - options?: RoleDefinitionsListRoleDefinitionsParameters + options?: RoleDefinitionsListRoleDefinitionsParameters, ): StreamableMethod< | RoleDefinitionsListRoleDefinitions200Response - | RoleDefinitionsListRoleDefinitionsdefaultResponse + | RoleDefinitionsListRoleDefinitionsDefaultResponse >; } export interface RoleDefinitionsGetRoleDefinitionById { /** Get role definition by role definition Id. */ get( - options?: RoleDefinitionsGetRoleDefinitionByIdParameters + options?: RoleDefinitionsGetRoleDefinitionByIdParameters, ): StreamableMethod< | RoleDefinitionsGetRoleDefinitionById200Response - | RoleDefinitionsGetRoleDefinitionByIddefaultResponse + | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse >; } export interface RoleDefinitionsListScopes { /** List rbac scopes. */ get( - options?: RoleDefinitionsListScopesParameters + options?: RoleDefinitionsListScopesParameters, ): StreamableMethod< | RoleDefinitionsListScopes200Response - | RoleDefinitionsListScopesdefaultResponse + | RoleDefinitionsListScopesDefaultResponse >; } @@ -115,14 +115,14 @@ export interface Routes { /** Resource for '/roleAssignments/\{roleAssignmentId\}' has methods for the following verbs: put, get, delete */ ( path: "/roleAssignments/{roleAssignmentId}", - roleAssignmentId: string + roleAssignmentId: string, ): RoleAssignmentsCreateRoleAssignment; /** Resource for '/roleDefinitions' has methods for the following verbs: get */ (path: "/roleDefinitions"): RoleDefinitionsListRoleDefinitions; /** Resource for '/roleDefinitions/\{roleDefinitionId\}' has methods for the following verbs: get */ ( path: "/roleDefinitions/{roleDefinitionId}", - roleDefinitionId: string + roleDefinitionId: string, ): RoleDefinitionsGetRoleDefinitionById; /** Resource for '/rbacScopes' has methods for the following verbs: get */ (path: "/rbacScopes"): RoleDefinitionsListScopes; diff --git a/sdk/synapse/synapse-access-control-rest/src/isUnexpected.ts b/sdk/synapse/synapse-access-control-rest/src/isUnexpected.ts index 5498a638159a..5a6ef8296942 100644 --- a/sdk/synapse/synapse-access-control-rest/src/isUnexpected.ts +++ b/sdk/synapse/synapse-access-control-rest/src/isUnexpected.ts @@ -3,22 +3,22 @@ import { RoleAssignmentsCheckPrincipalAccess200Response, - RoleAssignmentsCheckPrincipalAccessdefaultResponse, + RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, - RoleAssignmentsListRoleAssignmentsdefaultResponse, + RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, - RoleAssignmentsCreateRoleAssignmentdefaultResponse, + RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, - RoleAssignmentsGetRoleAssignmentByIddefaultResponse, + RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, - RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, + RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, - RoleDefinitionsListRoleDefinitionsdefaultResponse, + RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, - RoleDefinitionsGetRoleDefinitionByIddefaultResponse, + RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, - RoleDefinitionsListScopesdefaultResponse + RoleDefinitionsListScopesDefaultResponse, } from "./responses"; const responseMap: Record = { @@ -29,142 +29,154 @@ const responseMap: Record = { "DELETE /roleAssignments/{roleAssignmentId}": ["200", "204"], "GET /roleDefinitions": ["200"], "GET /roleDefinitions/{roleDefinitionId}": ["200"], - "GET /rbacScopes": ["200"] + "GET /rbacScopes": ["200"], }; export function isUnexpected( response: | RoleAssignmentsCheckPrincipalAccess200Response - | RoleAssignmentsCheckPrincipalAccessdefaultResponse -): response is RoleAssignmentsCheckPrincipalAccessdefaultResponse; + | RoleAssignmentsCheckPrincipalAccessDefaultResponse, +): response is RoleAssignmentsCheckPrincipalAccessDefaultResponse; export function isUnexpected( response: | RoleAssignmentsListRoleAssignments200Response - | RoleAssignmentsListRoleAssignmentsdefaultResponse -): response is RoleAssignmentsListRoleAssignmentsdefaultResponse; + | RoleAssignmentsListRoleAssignmentsDefaultResponse, +): response is RoleAssignmentsListRoleAssignmentsDefaultResponse; export function isUnexpected( response: | RoleAssignmentsCreateRoleAssignment200Response - | RoleAssignmentsCreateRoleAssignmentdefaultResponse -): response is RoleAssignmentsCreateRoleAssignmentdefaultResponse; + | RoleAssignmentsCreateRoleAssignmentDefaultResponse, +): response is RoleAssignmentsCreateRoleAssignmentDefaultResponse; export function isUnexpected( response: | RoleAssignmentsGetRoleAssignmentById200Response - | RoleAssignmentsGetRoleAssignmentByIddefaultResponse -): response is RoleAssignmentsGetRoleAssignmentByIddefaultResponse; + | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, +): response is RoleAssignmentsGetRoleAssignmentByIdDefaultResponse; export function isUnexpected( response: | RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response - | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse -): response is RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse; + | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, +): response is RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse; export function isUnexpected( response: | RoleDefinitionsListRoleDefinitions200Response - | RoleDefinitionsListRoleDefinitionsdefaultResponse -): response is RoleDefinitionsListRoleDefinitionsdefaultResponse; + | RoleDefinitionsListRoleDefinitionsDefaultResponse, +): response is RoleDefinitionsListRoleDefinitionsDefaultResponse; export function isUnexpected( response: | RoleDefinitionsGetRoleDefinitionById200Response - | RoleDefinitionsGetRoleDefinitionByIddefaultResponse -): response is RoleDefinitionsGetRoleDefinitionByIddefaultResponse; + | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, +): response is RoleDefinitionsGetRoleDefinitionByIdDefaultResponse; export function isUnexpected( response: | RoleDefinitionsListScopes200Response - | RoleDefinitionsListScopesdefaultResponse -): response is RoleDefinitionsListScopesdefaultResponse; + | RoleDefinitionsListScopesDefaultResponse, +): response is RoleDefinitionsListScopesDefaultResponse; export function isUnexpected( response: | RoleAssignmentsCheckPrincipalAccess200Response - | RoleAssignmentsCheckPrincipalAccessdefaultResponse + | RoleAssignmentsCheckPrincipalAccessDefaultResponse | RoleAssignmentsListRoleAssignments200Response - | RoleAssignmentsListRoleAssignmentsdefaultResponse + | RoleAssignmentsListRoleAssignmentsDefaultResponse | RoleAssignmentsCreateRoleAssignment200Response - | RoleAssignmentsCreateRoleAssignmentdefaultResponse + | RoleAssignmentsCreateRoleAssignmentDefaultResponse | RoleAssignmentsGetRoleAssignmentById200Response - | RoleAssignmentsGetRoleAssignmentByIddefaultResponse + | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse | RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response - | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse + | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse | RoleDefinitionsListRoleDefinitions200Response - | RoleDefinitionsListRoleDefinitionsdefaultResponse + | RoleDefinitionsListRoleDefinitionsDefaultResponse | RoleDefinitionsGetRoleDefinitionById200Response - | RoleDefinitionsGetRoleDefinitionByIddefaultResponse + | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse | RoleDefinitionsListScopes200Response - | RoleDefinitionsListScopesdefaultResponse + | RoleDefinitionsListScopesDefaultResponse, ): response is - | RoleAssignmentsCheckPrincipalAccessdefaultResponse - | RoleAssignmentsListRoleAssignmentsdefaultResponse - | RoleAssignmentsCreateRoleAssignmentdefaultResponse - | RoleAssignmentsGetRoleAssignmentByIddefaultResponse - | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse - | RoleDefinitionsListRoleDefinitionsdefaultResponse - | RoleDefinitionsGetRoleDefinitionByIddefaultResponse - | RoleDefinitionsListScopesdefaultResponse { + | RoleAssignmentsCheckPrincipalAccessDefaultResponse + | RoleAssignmentsListRoleAssignmentsDefaultResponse + | RoleAssignmentsCreateRoleAssignmentDefaultResponse + | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse + | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse + | RoleDefinitionsListRoleDefinitionsDefaultResponse + | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse + | RoleDefinitionsListScopesDefaultResponse { const lroOriginal = response.headers["x-ms-original-url"]; const url = new URL(lroOriginal ?? response.request.url); const method = response.request.method; let pathDetails = responseMap[`${method} ${url.pathname}`]; if (!pathDetails) { - pathDetails = geParametrizedPathSuccess(url.pathname); + pathDetails = getParametrizedPathSuccess(method, url.pathname); } return !pathDetails.includes(response.status); } -function geParametrizedPathSuccess(path: string): string[] { +function getParametrizedPathSuccess(method: string, path: string): string[] { const pathParts = path.split("/"); + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: string[] = []; + // Iterate the responseMap to find a match for (const [key, value] of Object.entries(responseMap)) { // Extracting the path from the map key which is in format // GET /path/foo + if (!key.startsWith(method)) { + continue; + } const candidatePath = getPathFromMapKey(key); // Get each part of the url path const candidateParts = candidatePath.split("/"); - // If the candidate and actual paths don't match in size - // we move on to the next candidate path - if ( - candidateParts.length === pathParts.length && - hasParametrizedPath(key) + // track if we have found a match to return the values found. + let found = true; + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- ) { - // track if we have found a match to return the values found. - let found = true; - for (let i = 0; i < candidateParts.length; i++) { - if ( - candidateParts[i].startsWith("{") && - candidateParts[i].endsWith("}") - ) { - // If the current part of the candidate is a "template" part - // it is a match with the actual path part on hand - // skip as the parameterized part can match anything - continue; - } + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); - // If the candidate part is not a template and - // the parts don't match mark the candidate as not found - // to move on with the next candidate path. - if (candidateParts[i] !== pathParts[i]) { + if (!isMatched) { found = false; break; } + continue; } - // We finished evaluating the current candidate parts - // if all parts matched we return the success values form - // the path mapping. - if (found) { - return value; + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; } } - } - // No match was found, return an empty array. - return []; -} + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } -function hasParametrizedPath(path: string): boolean { - return path.includes("/{"); + return matchedValue; } function getPathFromMapKey(mapKey: string): string { diff --git a/sdk/synapse/synapse-access-control-rest/src/logger.ts b/sdk/synapse/synapse-access-control-rest/src/logger.ts new file mode 100644 index 000000000000..5c572f53d29d --- /dev/null +++ b/sdk/synapse/synapse-access-control-rest/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("synapse-access-control"); diff --git a/sdk/synapse/synapse-access-control-rest/src/models.ts b/sdk/synapse/synapse-access-control-rest/src/models.ts index 45913da2f0ad..a4c5f4c77803 100644 --- a/sdk/synapse/synapse-access-control-rest/src/models.ts +++ b/sdk/synapse/synapse-access-control-rest/src/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/** Check access request details */ export interface CheckPrincipalAccessRequest { /** Subject details */ subject: SubjectInfo; @@ -10,6 +11,7 @@ export interface CheckPrincipalAccessRequest { scope: string; } +/** Subject details */ export interface SubjectInfo { /** * Principal Id @@ -21,6 +23,7 @@ export interface SubjectInfo { groupIds?: Array; } +/** Action Info */ export interface RequiredAction { /** Action Id. */ id: string; @@ -28,6 +31,7 @@ export interface RequiredAction { isDataAction: boolean; } +/** Role Assignment request details */ export interface RoleAssignmentRequest { /** * Role ID of the Synapse Built-In Role diff --git a/sdk/synapse/synapse-access-control-rest/src/outputModels.ts b/sdk/synapse/synapse-access-control-rest/src/outputModels.ts index 9487b94ed1f7..954a7e97a5e0 100644 --- a/sdk/synapse/synapse-access-control-rest/src/outputModels.ts +++ b/sdk/synapse/synapse-access-control-rest/src/outputModels.ts @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/** Check access response details */ export interface CheckPrincipalAccessResponseOutput { /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */ AccessDecisions?: Array; } +/** Check access response details */ export interface CheckAccessDecisionOutput { /** Access Decision. */ accessDecision?: string; @@ -15,6 +17,7 @@ export interface CheckAccessDecisionOutput { roleAssignment?: RoleAssignmentDetailsOutput; } +/** Role Assignment response details */ export interface RoleAssignmentDetailsOutput { /** Role Assignment ID */ id?: string; @@ -36,31 +39,35 @@ export interface RoleAssignmentDetailsOutput { principalType?: string; } +/** Contains details when the response code indicates an error. */ export interface ErrorContractOutput { /** The error details. */ error?: ErrorResponseOutput; } +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */ export interface ErrorResponseOutput { /** The error code. */ - code?: string; + readonly code?: string; /** The error message. */ - message?: string; + readonly message?: string; /** The error target. */ - target?: string; + readonly target?: string; /** The error details. */ - details?: Array; + readonly details?: Array; /** The error additional info. */ - additionalInfo?: Array; + readonly additionalInfo?: Array; } +/** The resource management error additional info. */ export interface ErrorAdditionalInfoOutput { /** The additional info type. */ - type?: string; + readonly type?: string; /** The additional info. */ - info?: Record; + readonly info?: Record; } +/** Role Assignment response details */ export interface RoleAssignmentDetailsListOutput { /** Number of role assignments */ count?: number; @@ -68,6 +75,7 @@ export interface RoleAssignmentDetailsListOutput { value?: Array; } +/** Synapse role definition details */ export interface SynapseRoleDefinitionOutput { /** * Role Definition ID @@ -89,6 +97,7 @@ export interface SynapseRoleDefinitionOutput { availabilityStatus?: string; } +/** Synapse role definition details */ export interface SynapseRbacPermissionOutput { /** List of actions */ actions?: Array; diff --git a/sdk/synapse/synapse-access-control-rest/src/paginateHelper.ts b/sdk/synapse/synapse-access-control-rest/src/paginateHelper.ts index d7c0356b40c7..94d5220235d9 100644 --- a/sdk/synapse/synapse-access-control-rest/src/paginateHelper.ts +++ b/sdk/synapse/synapse-access-control-rest/src/paginateHelper.ts @@ -4,12 +4,12 @@ import { getPagedAsyncIterator, PagedAsyncIterableIterator, - PagedResult + PagedResult, } from "@azure/core-paging"; import { Client, createRestError, - PathUncheckedResponse + PathUncheckedResponse, } from "@azure-rest/core-client"; /** @@ -22,7 +22,7 @@ export type GetArrayType = T extends Array ? TData : never; */ export type GetPage = ( pageLink: string, - maxPageSize?: number + maxPageSize?: number, ) => Promise<{ page: TPage; nextPageLink?: string; @@ -61,7 +61,7 @@ export type PaginateReturn = TResult extends { export function paginate( client: Client, initialResponse: TResponse, - options: PagingOptions = {} + options: PagingOptions = {}, ): PagedAsyncIterableIterator> { // Extract element type from initial response type TElement = PaginateReturn; @@ -84,9 +84,9 @@ export function paginate( const values = getElements(result.body, itemName); return { page: values, - nextPageLink: nextLink + nextPageLink: nextLink, }; - } + }, }; return getPagedAsyncIterator(pagedResult); @@ -104,7 +104,7 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { throw new Error( - `Body Property ${nextLinkName} should be a string or undefined` + `Body Property ${nextLinkName} should be a string or undefined`, ); } @@ -122,7 +122,7 @@ function getElements(body: unknown, itemName: string): T[] { // type of elements in the page in PaginateReturn if (!Array.isArray(value)) { throw new Error( - `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}` + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, ); } @@ -143,12 +143,12 @@ function checkPagingRequest(response: PathUncheckedResponse): void { "206", "207", "208", - "226" + "226", ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, - response + response, ); } } diff --git a/sdk/synapse/synapse-access-control-rest/src/parameters.ts b/sdk/synapse/synapse-access-control-rest/src/parameters.ts index d919e9ac718b..d1602061fc61 100644 --- a/sdk/synapse/synapse-access-control-rest/src/parameters.ts +++ b/sdk/synapse/synapse-access-control-rest/src/parameters.ts @@ -15,9 +15,10 @@ export interface RoleAssignmentsCheckPrincipalAccessMediaTypesParam { contentType?: "application/json" | "text/json"; } -export type RoleAssignmentsCheckPrincipalAccessParameters = RoleAssignmentsCheckPrincipalAccessMediaTypesParam & - RoleAssignmentsCheckPrincipalAccessBodyParam & - RequestParameters; +export type RoleAssignmentsCheckPrincipalAccessParameters = + RoleAssignmentsCheckPrincipalAccessMediaTypesParam & + RoleAssignmentsCheckPrincipalAccessBodyParam & + RequestParameters; export interface RoleAssignmentsListRoleAssignmentsHeaders { /** Continuation token. */ @@ -38,12 +39,13 @@ export interface RoleAssignmentsListRoleAssignmentsQueryParam { } export interface RoleAssignmentsListRoleAssignmentsHeaderParam { - headers: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders; + headers?: RawHttpHeadersInput & RoleAssignmentsListRoleAssignmentsHeaders; } -export type RoleAssignmentsListRoleAssignmentsParameters = RoleAssignmentsListRoleAssignmentsQueryParam & - RoleAssignmentsListRoleAssignmentsHeaderParam & - RequestParameters; +export type RoleAssignmentsListRoleAssignmentsParameters = + RoleAssignmentsListRoleAssignmentsQueryParam & + RoleAssignmentsListRoleAssignmentsHeaderParam & + RequestParameters; export interface RoleAssignmentsCreateRoleAssignmentBodyParam { /** Details of role id, scope and object id. */ @@ -55,9 +57,10 @@ export interface RoleAssignmentsCreateRoleAssignmentMediaTypesParam { contentType?: "application/json" | "text/json"; } -export type RoleAssignmentsCreateRoleAssignmentParameters = RoleAssignmentsCreateRoleAssignmentMediaTypesParam & - RoleAssignmentsCreateRoleAssignmentBodyParam & - RequestParameters; +export type RoleAssignmentsCreateRoleAssignmentParameters = + RoleAssignmentsCreateRoleAssignmentMediaTypesParam & + RoleAssignmentsCreateRoleAssignmentBodyParam & + RequestParameters; export type RoleAssignmentsGetRoleAssignmentByIdParameters = RequestParameters; export interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties { @@ -69,8 +72,8 @@ export interface RoleAssignmentsDeleteRoleAssignmentByIdQueryParam { queryParameters?: RoleAssignmentsDeleteRoleAssignmentByIdQueryParamProperties; } -export type RoleAssignmentsDeleteRoleAssignmentByIdParameters = RoleAssignmentsDeleteRoleAssignmentByIdQueryParam & - RequestParameters; +export type RoleAssignmentsDeleteRoleAssignmentByIdParameters = + RoleAssignmentsDeleteRoleAssignmentByIdQueryParam & RequestParameters; export interface RoleDefinitionsListRoleDefinitionsQueryParamProperties { /** Is a Synapse Built-In Role or not. */ @@ -83,7 +86,7 @@ export interface RoleDefinitionsListRoleDefinitionsQueryParam { queryParameters?: RoleDefinitionsListRoleDefinitionsQueryParamProperties; } -export type RoleDefinitionsListRoleDefinitionsParameters = RoleDefinitionsListRoleDefinitionsQueryParam & - RequestParameters; +export type RoleDefinitionsListRoleDefinitionsParameters = + RoleDefinitionsListRoleDefinitionsQueryParam & RequestParameters; export type RoleDefinitionsGetRoleDefinitionByIdParameters = RequestParameters; export type RoleDefinitionsListScopesParameters = RequestParameters; diff --git a/sdk/synapse/synapse-access-control-rest/src/responses.ts b/sdk/synapse/synapse-access-control-rest/src/responses.ts index 5c57c2377fe3..cabc47af677f 100644 --- a/sdk/synapse/synapse-access-control-rest/src/responses.ts +++ b/sdk/synapse/synapse-access-control-rest/src/responses.ts @@ -8,7 +8,7 @@ import { ErrorContractOutput, RoleAssignmentDetailsListOutput, RoleAssignmentDetailsOutput, - SynapseRoleDefinitionOutput + SynapseRoleDefinitionOutput, } from "./outputModels"; /** Check if the given principalId has access to perform list of actions at a given scope. */ @@ -19,7 +19,7 @@ export interface RoleAssignmentsCheckPrincipalAccess200Response } /** Check if the given principalId has access to perform list of actions at a given scope. */ -export interface RoleAssignmentsCheckPrincipalAccessdefaultResponse +export interface RoleAssignmentsCheckPrincipalAccessDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -39,7 +39,7 @@ export interface RoleAssignmentsListRoleAssignments200Response } /** List role assignments. */ -export interface RoleAssignmentsListRoleAssignmentsdefaultResponse +export interface RoleAssignmentsListRoleAssignmentsDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -53,7 +53,7 @@ export interface RoleAssignmentsCreateRoleAssignment200Response } /** Create role assignment. */ -export interface RoleAssignmentsCreateRoleAssignmentdefaultResponse +export interface RoleAssignmentsCreateRoleAssignmentDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -67,7 +67,7 @@ export interface RoleAssignmentsGetRoleAssignmentById200Response } /** Get role assignment by role assignment Id. */ -export interface RoleAssignmentsGetRoleAssignmentByIddefaultResponse +export interface RoleAssignmentsGetRoleAssignmentByIdDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -77,18 +77,16 @@ export interface RoleAssignmentsGetRoleAssignmentByIddefaultResponse export interface RoleAssignmentsDeleteRoleAssignmentById200Response extends HttpResponse { status: "200"; - body: Record; } /** Delete role assignment by role assignment Id. */ export interface RoleAssignmentsDeleteRoleAssignmentById204Response extends HttpResponse { status: "204"; - body: Record; } /** Delete role assignment by role assignment Id. */ -export interface RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse +export interface RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -102,7 +100,7 @@ export interface RoleDefinitionsListRoleDefinitions200Response } /** List role definitions. */ -export interface RoleDefinitionsListRoleDefinitionsdefaultResponse +export interface RoleDefinitionsListRoleDefinitionsDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -116,7 +114,7 @@ export interface RoleDefinitionsGetRoleDefinitionById200Response } /** Get role definition by role definition Id. */ -export interface RoleDefinitionsGetRoleDefinitionByIddefaultResponse +export interface RoleDefinitionsGetRoleDefinitionByIdDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; @@ -129,7 +127,7 @@ export interface RoleDefinitionsListScopes200Response extends HttpResponse { } /** List rbac scopes. */ -export interface RoleDefinitionsListScopesdefaultResponse extends HttpResponse { +export interface RoleDefinitionsListScopesDefaultResponse extends HttpResponse { status: string; body: ErrorContractOutput; } diff --git a/sdk/synapse/synapse-access-control-rest/swagger/README.md b/sdk/synapse/synapse-access-control-rest/swagger/README.md index 3509b04d66a6..0470af3060a0 100644 --- a/sdk/synapse/synapse-access-control-rest/swagger/README.md +++ b/sdk/synapse/synapse-access-control-rest/swagger/README.md @@ -5,6 +5,8 @@ ## Configuration ```yaml +flavor: azure +openapi-type: data-plane tag: package-access-control-2020-12-01 package-name: "@azure-rest/synapse-access-control" package-version: "1.0.0-beta.1"