From 5433ea4f1e3ec9973b32233d2877cb3366876f2f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 14 Jul 2022 09:32:07 +0000 Subject: [PATCH] CodeGen from PR 19692 in Azure/azure-rest-api-specs Merge a9848fce4e7f9fe1d0f5b0cbc9c7447c05af3948 into 9918d83b021f4abe956ca3be5df358482f50433a --- sdk/dashboard/arm-dashboard/CHANGELOG.md | 2 +- sdk/dashboard/arm-dashboard/README.md | 2 +- sdk/dashboard/arm-dashboard/_meta.json | 8 +- sdk/dashboard/arm-dashboard/package.json | 22 +- .../arm-dashboard/review/arm-dashboard.api.md | 261 ++++++++-- .../src/dashboardManagementClient.ts | 59 ++- .../arm-dashboard/src/models/index.ts | 408 ++++++++++++--- .../arm-dashboard/src/models/mappers.ts | 371 +++++++++++++- .../arm-dashboard/src/models/parameters.ts | 33 +- .../arm-dashboard/src/operations/grafana.ts | 3 + .../arm-dashboard/src/operations/index.ts | 2 + .../src/operations/operations.ts | 8 +- .../operations/privateEndpointConnections.ts | 481 ++++++++++++++++++ .../src/operations/privateLinkResources.ts | 221 ++++++++ .../src/operationsInterfaces/index.ts | 2 + .../src/operationsInterfaces/operations.ts | 4 +- .../privateEndpointConnections.ts | 105 ++++ .../privateLinkResources.ts | 44 ++ .../arm-dashboard/test/sampleTest.ts | 39 +- sdk/dashboard/arm-dashboard/tsconfig.json | 10 +- 20 files changed, 1889 insertions(+), 196 deletions(-) create mode 100644 sdk/dashboard/arm-dashboard/src/operations/privateEndpointConnections.ts create mode 100644 sdk/dashboard/arm-dashboard/src/operations/privateLinkResources.ts create mode 100644 sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateLinkResources.ts diff --git a/sdk/dashboard/arm-dashboard/CHANGELOG.md b/sdk/dashboard/arm-dashboard/CHANGELOG.md index 3dae69c0d53d..281a23d39d86 100644 --- a/sdk/dashboard/arm-dashboard/CHANGELOG.md +++ b/sdk/dashboard/arm-dashboard/CHANGELOG.md @@ -1,5 +1,5 @@ # Release History -## 1.0.0-beta.1 (2022-04-13) +## 1.0.0 (2022-07-14) The package of @azure/arm-dashboard is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/dashboard/arm-dashboard/README.md b/sdk/dashboard/arm-dashboard/README.md index 68a20a1d1060..b874ed96556f 100644 --- a/sdk/dashboard/arm-dashboard/README.md +++ b/sdk/dashboard/arm-dashboard/README.md @@ -6,7 +6,7 @@ The Microsoft.Dashboard Rest API spec. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dashboard/arm-dashboard) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-dashboard) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dashboard?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dashboard) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/dashboard/arm-dashboard/_meta.json b/sdk/dashboard/arm-dashboard/_meta.json index d2532b3c517a..4f5b198b023f 100644 --- a/sdk/dashboard/arm-dashboard/_meta.json +++ b/sdk/dashboard/arm-dashboard/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ffa0f749195189f4161f4dc9ae3794b3f2e01f11", + "commit": "574bd258df5c9a6cfe48f24cf24894c6f14a082c", "readme": "specification/dashboard/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dashboard\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dashboard/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/dashboard/arm-dashboard/package.json b/sdk/dashboard/arm-dashboard/package.json index d95f0e910d2d..94e50fd353f1 100644 --- a/sdk/dashboard/arm-dashboard/package.json +++ b/sdk/dashboard/arm-dashboard/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DashboardManagementClient.", - "version": "1.0.0-beta.1", + "version": "1.0.0", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dashboard/arm-dashboard", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dashboard?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/dashboard/arm-dashboard/review/arm-dashboard.api.md b/sdk/dashboard/arm-dashboard/review/arm-dashboard.api.md index ad01a452b197..0a13a310620f 100644 --- a/sdk/dashboard/arm-dashboard/review/arm-dashboard.api.md +++ b/sdk/dashboard/arm-dashboard/review/arm-dashboard.api.md @@ -13,6 +13,9 @@ import { PollOperationState } from '@azure/core-lro'; // @public export type ActionType = string; +// @public +export type ApiKey = string; + // @public export type AutoGeneratedDomainNameLabelScope = string; @@ -31,6 +34,10 @@ export class DashboardManagementClient extends coreClient.ServiceClient { // (undocumented) operations: Operations; // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) subscriptionId: string; } @@ -41,6 +48,9 @@ export interface DashboardManagementClientOptionalParams extends coreClient.Serv endpoint?: string; } +// @public +export type DeterministicOutboundIP = string; + // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -130,15 +140,20 @@ export interface GrafanaUpdateOptionalParams extends coreClient.OperationOptions // @public export type GrafanaUpdateResponse = ManagedGrafana; -// @public -export type IdentityType = string; - // @public export enum KnownActionType { // (undocumented) Internal = "Internal" } +// @public +export enum KnownApiKey { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + // @public export enum KnownAutoGeneratedDomainNameLabelScope { // (undocumented) @@ -158,23 +173,23 @@ export enum KnownCreatedByType { } // @public -export enum KnownIdentityType { +export enum KnownDeterministicOutboundIP { // (undocumented) - None = "None", + Disabled = "Disabled", // (undocumented) - SystemAssigned = "SystemAssigned" + Enabled = "Enabled" } // @public -export enum KnownLastModifiedByType { +export enum KnownManagedServiceIdentityType { // (undocumented) - Application = "Application", + None = "None", // (undocumented) - Key = "Key", + SystemAssigned = "SystemAssigned", // (undocumented) - ManagedIdentity = "ManagedIdentity", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", // (undocumented) - User = "User" + UserAssigned = "UserAssigned" } // @public @@ -187,6 +202,28 @@ export enum KnownOrigin { UserSystem = "user,system" } +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + // @public export enum KnownProvisioningState { // (undocumented) @@ -210,7 +247,7 @@ export enum KnownProvisioningState { } // @public -export enum KnownZoneRedundancy { +export enum KnownPublicNetworkAccess { // (undocumented) Disabled = "Disabled", // (undocumented) @@ -218,12 +255,17 @@ export enum KnownZoneRedundancy { } // @public -export type LastModifiedByType = string; +export enum KnownZoneRedundancy { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} // @public export interface ManagedGrafana { readonly id?: string; - identity?: ManagedIdentity; + identity?: ManagedServiceIdentity; location?: string; readonly name?: string; properties?: ManagedGrafanaProperties; @@ -245,33 +287,57 @@ export interface ManagedGrafanaListResponse { // @public export interface ManagedGrafanaProperties { - // (undocumented) + apiKey?: ApiKey; autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; + deterministicOutboundIP?: DeterministicOutboundIP; readonly endpoint?: string; readonly grafanaVersion?: string; - provisioningState?: ProvisioningState; - // (undocumented) + readonly outboundIPs?: string[]; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; + zoneRedundancy?: ZoneRedundancy; +} + +// @public +export interface ManagedGrafanaPropertiesUpdateParameters { + apiKey?: ApiKey; + deterministicOutboundIP?: DeterministicOutboundIP; + publicNetworkAccess?: PublicNetworkAccess; zoneRedundancy?: ZoneRedundancy; } // @public export interface ManagedGrafanaUpdateParameters { - identity?: ManagedIdentity; + identity?: ManagedServiceIdentity; + properties?: ManagedGrafanaPropertiesUpdateParameters; tags?: { [propertyName: string]: string; }; } // @public -export interface ManagedIdentity { +export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; - type?: IdentityType; + type: ManagedServiceIdentityType; userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity; }; } +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + // @public export interface OperationDisplay { readonly description?: string; @@ -283,21 +349,12 @@ export interface OperationDisplay { // @public export interface OperationListResult { readonly nextLink?: string; - readonly value?: OperationResult[]; -} - -// @public -export interface OperationResult { - readonly actionType?: ActionType; - display?: OperationDisplay; - readonly isDataAction?: boolean; - readonly name?: string; - readonly origin?: Origin; + readonly value?: Operation[]; } // @public export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -317,31 +374,157 @@ export type OperationsListResponse = OperationListResult; // @public export type Origin = string; +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export type PrivateEndpointConnection = Resource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + groupIds?: string[]; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + +// @public +export interface PrivateEndpointConnectionListResult { + readonly nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnections { + beginApprove(resourceGroupName: string, workspaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsApproveOptionalParams): Promise, PrivateEndpointConnectionsApproveResponse>>; + beginApproveAndWait(resourceGroupName: string, workspaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsApproveOptionalParams): Promise; + beginDelete(resourceGroupName: string, workspaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, workspaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, workspaceName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsApproveOptionalParams extends coreClient.OperationOptions { + body?: PrivateEndpointConnection; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsApproveResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export type PrivateLinkResource = Resource & { + readonly provisioningState?: ProvisioningState; + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +}; + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, workspaceName: string, privateLinkResourceName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + list(resourceGroupName: string, workspaceName: string, options?: PrivateLinkResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +// @public +export interface PrivateLinkResourcesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListNextResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkResourcesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + // @public export type ProvisioningState = string; +// @public +export type PublicNetworkAccess = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + // @public (undocumented) export interface ResourceSku { // (undocumented) name: string; } -// @public (undocumented) +// @public export interface SystemData { - // (undocumented) createdAt?: Date; - // (undocumented) createdBy?: string; createdByType?: CreatedByType; - // (undocumented) lastModifiedAt?: Date; - // (undocumented) lastModifiedBy?: string; - // (undocumented) - lastModifiedByType?: LastModifiedByType; + lastModifiedByType?: CreatedByType; } -// @public (undocumented) +// @public export interface UserAssignedIdentity { readonly clientId?: string; readonly principalId?: string; diff --git a/sdk/dashboard/arm-dashboard/src/dashboardManagementClient.ts b/sdk/dashboard/arm-dashboard/src/dashboardManagementClient.ts index cd0c227dd4b7..389a94cb9afb 100644 --- a/sdk/dashboard/arm-dashboard/src/dashboardManagementClient.ts +++ b/sdk/dashboard/arm-dashboard/src/dashboardManagementClient.ts @@ -8,9 +8,24 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, GrafanaImpl } from "./operations"; -import { Operations, Grafana } from "./operationsInterfaces"; +import { + OperationsImpl, + GrafanaImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl +} from "./operations"; +import { + Operations, + Grafana, + PrivateEndpointConnections, + PrivateLinkResources +} from "./operationsInterfaces"; import { DashboardManagementClientOptionalParams } from "./models"; export class DashboardManagementClient extends coreClient.ServiceClient { @@ -21,8 +36,7 @@ export class DashboardManagementClient extends coreClient.ServiceClient { /** * Initializes a new instance of the DashboardManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( @@ -46,7 +60,7 @@ export class DashboardManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dashboard/1.0.0-beta.1`; + const packageDetails = `azsdk-js-arm-dashboard/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -93,11 +107,44 @@ export class DashboardManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-09-01-preview"; + this.apiVersion = options.apiVersion || "2022-08-01"; this.operations = new OperationsImpl(this); this.grafana = new GrafanaImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } operations: Operations; grafana: Grafana; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; } diff --git a/sdk/dashboard/arm-dashboard/src/models/index.ts b/sdk/dashboard/arm-dashboard/src/models/index.ts index 5ab925993a9a..b28633c131e7 100644 --- a/sdk/dashboard/arm-dashboard/src/models/index.ts +++ b/sdk/dashboard/arm-dashboard/src/models/index.ts @@ -8,41 +8,41 @@ import * as coreClient from "@azure/core-client"; -/** A list of REST API operations supported by Microsoft.Dashboard provider. It contains an URL link to get the next set of results. */ +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ export interface OperationListResult { /** - * List of operations supported by the Microsoft.Dashboard provider. + * List of operations supported by the resource provider * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: OperationResult[]; + readonly value?: Operation[]; /** - * URL to get the next set of operation list results if there are any. + * URL to get the next set of operation list results (if there are any). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nextLink?: string; } -/** A Microsoft.Dashboard REST API operation. */ -export interface OperationResult { +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * Operation name, i.e., {provider}/{resource}/{operation}. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * Indicates whether the operation applies to data-plane. Set "true" for data-plane operations and "false" for ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isDataAction?: boolean; /** Localized display information for this particular operation. */ display?: OperationDisplay; /** - * The intended executor of the operation. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly origin?: Origin; /** - * Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly actionType?: ActionType; @@ -51,22 +51,22 @@ export interface OperationResult { /** Localized display information for this particular operation. */ export interface OperationDisplay { /** - * The localized friendly form of the resource provider name, i.e., Microsoft.Dashboard. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provider?: string; /** - * The localized friendly name of the resource type related to this operation, e.g., 'grafana'. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly resource?: string; /** - * Operation type, e.g., read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operation?: string; /** - * Description of the operation, e.g., 'Read grafana'. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly description?: string; @@ -148,7 +148,7 @@ export interface ManagedGrafana { /** Properties specific to the grafana resource. */ properties?: ManagedGrafanaProperties; /** The managed identity of the grafana resource. */ - identity?: ManagedIdentity; + identity?: ManagedServiceIdentity; /** * The system meta data relating to this grafana resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -166,8 +166,11 @@ export interface ResourceSku { /** Properties specific to the grafana resource. */ export interface ManagedGrafanaProperties { - /** Provisioning state of the resource. */ - provisioningState?: ProvisioningState; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; /** * The Grafana software version. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -178,59 +181,199 @@ export interface ManagedGrafanaProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly endpoint?: string; + /** Indicate the state for enable or disable traffic over the public interface. */ + publicNetworkAccess?: PublicNetworkAccess; + /** The zone redundancy setting of the Grafana instance. */ zoneRedundancy?: ZoneRedundancy; + /** The api key setting of the Grafana instance. */ + apiKey?: ApiKey; + /** Whether a Grafana instance uses deterministic outbound IPs. */ + deterministicOutboundIP?: DeterministicOutboundIP; + /** + * List of outbound IPs if deterministicOutboundIP is enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly outboundIPs?: string[]; + /** + * The private endpoint connections of the Grafana instance. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Scope for dns deterministic name hash calculation. */ autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope; } -/** The managed identity of a resource. */ -export interface ManagedIdentity { - /** The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the resource. */ - type?: IdentityType; +/** The Private Endpoint resource. */ +export interface PrivateEndpoint { /** - * The principal id of the system assigned identity. + * The ARM identifier for Private Endpoint * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The tenant id of the system assigned identity. + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tenantId?: string; - /** Dictionary of user assigned identities. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; -} - -export interface UserAssignedIdentity { + readonly id?: string; /** - * The principal id of user assigned identity. + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly name?: string; /** - * The client id of user assigned identity. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly clientId?: string; + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; } +/** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { + /** The identity that created the resource. */ createdBy?: string; /** The type of identity that created the resource. */ createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ createdAt?: Date; + /** The identity that last modified the resource. */ lastModifiedBy?: string; - lastModifiedByType?: LastModifiedByType; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ lastModifiedAt?: Date; } +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** The parameters for a PATCH request to a grafana resource. */ export interface ManagedGrafanaUpdateParameters { /** The managed identity of the grafana resource. */ - identity?: ManagedIdentity; + identity?: ManagedServiceIdentity; /** The new tags of the grafana resource. */ tags?: { [propertyName: string]: string }; + /** Properties specific to the managed grafana resource. */ + properties?: ManagedGrafanaPropertiesUpdateParameters; } +/** The properties parameters for a PATCH request to a grafana resource. */ +export interface ManagedGrafanaPropertiesUpdateParameters { + /** The zone redundancy setting of the Grafana instance. */ + zoneRedundancy?: ZoneRedundancy; + /** The api key setting of the Grafana instance. */ + apiKey?: ApiKey; + /** Whether a Grafana instance uses deterministic outbound IPs. */ + deterministicOutboundIP?: DeterministicOutboundIP; + /** Indicate the state for enable or disable traffic over the public interface. */ + publicNetworkAccess?: PublicNetworkAccess; +} + +/** List of private endpoint connection associated with the specified storage account */ +export interface PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The Private Endpoint Connection resource. */ +export type PrivateEndpointConnection = Resource & { + /** The resource of private end point. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** The private endpoint connection group ids. */ + groupIds?: string[]; + /** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + +/** A private link resource */ +export type PrivateLinkResource = Resource & { + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +}; + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { User = "user", @@ -293,6 +436,22 @@ export enum KnownProvisioningState { */ export type ProvisioningState = string; +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + Enabled = "Enabled", + Disabled = "Disabled" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + /** Known values of {@link ZoneRedundancy} that the service accepts. */ export enum KnownZoneRedundancy { Disabled = "Disabled", @@ -309,35 +468,75 @@ export enum KnownZoneRedundancy { */ export type ZoneRedundancy = string; -/** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */ -export enum KnownAutoGeneratedDomainNameLabelScope { - TenantReuse = "TenantReuse" +/** Known values of {@link ApiKey} that the service accepts. */ +export enum KnownApiKey { + Disabled = "Disabled", + Enabled = "Enabled" } /** - * Defines values for AutoGeneratedDomainNameLabelScope. \ - * {@link KnownAutoGeneratedDomainNameLabelScope} can be used interchangeably with AutoGeneratedDomainNameLabelScope, + * Defines values for ApiKey. \ + * {@link KnownApiKey} can be used interchangeably with ApiKey, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **TenantReuse** + * **Disabled** \ + * **Enabled** */ -export type AutoGeneratedDomainNameLabelScope = string; +export type ApiKey = string; -/** Known values of {@link IdentityType} that the service accepts. */ -export enum KnownIdentityType { - None = "None", - SystemAssigned = "SystemAssigned" +/** Known values of {@link DeterministicOutboundIP} that the service accepts. */ +export enum KnownDeterministicOutboundIP { + Disabled = "Disabled", + Enabled = "Enabled" } /** - * Defines values for IdentityType. \ - * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * Defines values for DeterministicOutboundIP. \ + * {@link KnownDeterministicOutboundIP} can be used interchangeably with DeterministicOutboundIP, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **None** \ - * **SystemAssigned** + * **Disabled** \ + * **Enabled** + */ +export type DeterministicOutboundIP = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** */ -export type IdentityType = string; +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + Succeeded = "Succeeded", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed" +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { @@ -359,25 +558,39 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; -/** Known values of {@link LastModifiedByType} that the service accepts. */ -export enum KnownLastModifiedByType { - User = "User", - Application = "Application", - ManagedIdentity = "ManagedIdentity", - Key = "Key" +/** Known values of {@link AutoGeneratedDomainNameLabelScope} that the service accepts. */ +export enum KnownAutoGeneratedDomainNameLabelScope { + TenantReuse = "TenantReuse" } /** - * Defines values for LastModifiedByType. \ - * {@link KnownLastModifiedByType} can be used interchangeably with LastModifiedByType, + * Defines values for AutoGeneratedDomainNameLabelScope. \ + * {@link KnownAutoGeneratedDomainNameLabelScope} can be used interchangeably with AutoGeneratedDomainNameLabelScope, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **TenantReuse** */ -export type LastModifiedByType = string; +export type AutoGeneratedDomainNameLabelScope = string; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + UserAssigned = "UserAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** + */ +export type ManagedServiceIdentityType = string; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -455,6 +668,71 @@ export interface GrafanaListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type GrafanaListByResourceGroupNextResponse = ManagedGrafanaListResponse; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsApproveOptionalParams + extends coreClient.OperationOptions { + /** The Private Endpoint Connection resource. */ + body?: PrivateEndpointConnection; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approve operation. */ +export type PrivateEndpointConnectionsApproveResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PrivateEndpointConnectionsListNextResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateLinkResourcesListResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResource; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PrivateLinkResourcesListNextResponse = PrivateLinkResourceListResult; + /** Optional parameters. */ export interface DashboardManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/dashboard/arm-dashboard/src/models/mappers.ts b/sdk/dashboard/arm-dashboard/src/models/mappers.ts index 189c69290140..ebd7ae3fdd6f 100644 --- a/sdk/dashboard/arm-dashboard/src/models/mappers.ts +++ b/sdk/dashboard/arm-dashboard/src/models/mappers.ts @@ -21,7 +21,7 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "OperationResult" + className: "Operation" } } } @@ -37,10 +37,10 @@ export const OperationListResult: coreClient.CompositeMapper = { } }; -export const OperationResult: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationResult", + className: "Operation", modelProperties: { name: { serializedName: "name", @@ -285,7 +285,7 @@ export const ManagedGrafana: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "ManagedIdentity" + className: "ManagedServiceIdentity" } }, systemData: { @@ -335,6 +335,7 @@ export const ManagedGrafanaProperties: coreClient.CompositeMapper = { modelProperties: { provisioningState: { serializedName: "provisioningState", + readOnly: true, type: { name: "String" } @@ -353,6 +354,12 @@ export const ManagedGrafanaProperties: coreClient.CompositeMapper = { name: "String" } }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + }, zoneRedundancy: { defaultValue: "Disabled", serializedName: "zoneRedundancy", @@ -360,6 +367,45 @@ export const ManagedGrafanaProperties: coreClient.CompositeMapper = { name: "String" } }, + apiKey: { + defaultValue: "Disabled", + serializedName: "apiKey", + type: { + name: "String" + } + }, + deterministicOutboundIP: { + defaultValue: "Disabled", + serializedName: "deterministicOutboundIP", + type: { + name: "String" + } + }, + outboundIPs: { + serializedName: "outboundIPs", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, autoGeneratedDomainNameLabelScope: { serializedName: "autoGeneratedDomainNameLabelScope", type: { @@ -370,62 +416,81 @@ export const ManagedGrafanaProperties: coreClient.CompositeMapper = { } }; -export const ManagedIdentity: coreClient.CompositeMapper = { +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedIdentity", + className: "PrivateEndpoint", modelProperties: { - type: { - serializedName: "type", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } - }, - principalId: { - serializedName: "principalId", - readOnly: true, + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", type: { name: "String" } }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + description: { + serializedName: "description", type: { name: "String" } }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + actionsRequired: { + serializedName: "actionsRequired", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" } - } + name: "String" } } } } }; -export const UserAssignedIdentity: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserAssignedIdentity", + className: "Resource", modelProperties: { - principalId: { - serializedName: "principalId", + id: { + serializedName: "id", readOnly: true, type: { name: "String" } }, - clientId: { - serializedName: "clientId", + name: { + serializedName: "name", readOnly: true, type: { name: "String" } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } @@ -476,6 +541,68 @@ export const SystemData: coreClient.CompositeMapper = { } }; +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + export const ManagedGrafanaUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -485,7 +612,7 @@ export const ManagedGrafanaUpdateParameters: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "ManagedIdentity" + className: "ManagedServiceIdentity" } }, tags: { @@ -494,6 +621,194 @@ export const ManagedGrafanaUpdateParameters: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ManagedGrafanaPropertiesUpdateParameters" + } + } + } + } +}; + +export const ManagedGrafanaPropertiesUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedGrafanaPropertiesUpdateParameters", + modelProperties: { + zoneRedundancy: { + defaultValue: "Disabled", + serializedName: "zoneRedundancy", + type: { + name: "String" + } + }, + apiKey: { + defaultValue: "Disabled", + serializedName: "apiKey", + type: { + name: "String" + } + }, + deterministicOutboundIP: { + defaultValue: "Disabled", + serializedName: "deterministicOutboundIP", + type: { + name: "String" + } + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + groupIds: { + serializedName: "properties.groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } diff --git a/sdk/dashboard/arm-dashboard/src/models/parameters.ts b/sdk/dashboard/arm-dashboard/src/models/parameters.ts index be12e39b54dd..c28a319166d0 100644 --- a/sdk/dashboard/arm-dashboard/src/models/parameters.ts +++ b/sdk/dashboard/arm-dashboard/src/models/parameters.ts @@ -13,7 +13,8 @@ import { } from "@azure/core-client"; import { ManagedGrafana as ManagedGrafanaMapper, - ManagedGrafanaUpdateParameters as ManagedGrafanaUpdateParametersMapper + ManagedGrafanaUpdateParameters as ManagedGrafanaUpdateParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -43,7 +44,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-09-01-preview", + defaultValue: "2022-08-01", isConstant: true, serializedName: "api-version", type: { @@ -82,6 +83,7 @@ export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { constraints: { + MaxLength: 90, MinLength: 1 }, serializedName: "resourceGroupName", @@ -124,3 +126,30 @@ export const requestBodyParameters1: OperationParameter = { parameterPath: "requestBodyParameters", mapper: ManagedGrafanaUpdateParametersMapper }; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: ["options", "body"], + mapper: PrivateEndpointConnectionMapper +}; + +export const privateLinkResourceName: OperationURLParameter = { + parameterPath: "privateLinkResourceName", + mapper: { + serializedName: "privateLinkResourceName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/dashboard/arm-dashboard/src/operations/grafana.ts b/sdk/dashboard/arm-dashboard/src/operations/grafana.ts index 4b027181c804..b30a23b9f525 100644 --- a/sdk/dashboard/arm-dashboard/src/operations/grafana.ts +++ b/sdk/dashboard/arm-dashboard/src/operations/grafana.ts @@ -513,6 +513,9 @@ const updateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.ManagedGrafana }, + 202: { + bodyMapper: Mappers.ManagedGrafana + }, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/dashboard/arm-dashboard/src/operations/index.ts b/sdk/dashboard/arm-dashboard/src/operations/index.ts index 252ad2d099b5..ccfcf6ca4471 100644 --- a/sdk/dashboard/arm-dashboard/src/operations/index.ts +++ b/sdk/dashboard/arm-dashboard/src/operations/index.ts @@ -8,3 +8,5 @@ export * from "./operations"; export * from "./grafana"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/dashboard/arm-dashboard/src/operations/operations.ts b/sdk/dashboard/arm-dashboard/src/operations/operations.ts index 7eb9d26e05b4..a818626bed1c 100644 --- a/sdk/dashboard/arm-dashboard/src/operations/operations.ts +++ b/sdk/dashboard/arm-dashboard/src/operations/operations.ts @@ -13,7 +13,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { DashboardManagementClient } from "../dashboardManagementClient"; import { - OperationResult, + Operation, OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { */ public list( options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -56,7 +56,7 @@ export class OperationsImpl implements Operations { private async *listPagingPage( options?: OperationsListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._list(options); yield result.value || []; let continuationToken = result.nextLink; @@ -69,7 +69,7 @@ export class OperationsImpl implements Operations { private async *listPagingAll( options?: OperationsListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; } diff --git a/sdk/dashboard/arm-dashboard/src/operations/privateEndpointConnections.ts b/sdk/dashboard/arm-dashboard/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..43d4918913b2 --- /dev/null +++ b/sdk/dashboard/arm-dashboard/src/operations/privateEndpointConnections.ts @@ -0,0 +1,481 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DashboardManagementClient } from "../dashboardManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListNextOptionalParams, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsApproveOptionalParams, + PrivateEndpointConnectionsApproveResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsListNextResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: DashboardManagementClient; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: DashboardManagementClient) { + this.client = client; + } + + /** + * Get private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, workspaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, workspaceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workspaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, workspaceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workspaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Get private endpoint connections. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + options + }, + getOperationSpec + ); + } + + /** + * Manual approve private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + async beginApprove( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsApproveOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsApproveResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + options + }, + approveOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Manual approve private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + async beginApproveAndWait( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsApproveOptionalParams + ): Promise { + const poller = await this.beginApprove( + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + options + }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: PrivateEndpointConnectionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const approveOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dashboard/arm-dashboard/src/operations/privateLinkResources.ts b/sdk/dashboard/arm-dashboard/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..81dd13cf49bf --- /dev/null +++ b/sdk/dashboard/arm-dashboard/src/operations/privateLinkResources.ts @@ -0,0 +1,221 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DashboardManagementClient } from "../dashboardManagementClient"; +import { + PrivateLinkResource, + PrivateLinkResourcesListNextOptionalParams, + PrivateLinkResourcesListOptionalParams, + PrivateLinkResourcesListResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse, + PrivateLinkResourcesListNextResponse +} from "../models"; + +/// +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: DashboardManagementClient; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: DashboardManagementClient) { + this.client = client; + } + + /** + * List all private link resources information for this grafana resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, workspaceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(resourceGroupName, workspaceName, options); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + workspaceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(resourceGroupName, workspaceName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + resourceGroupName: string, + workspaceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * List all private link resources information for this grafana resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listOperationSpec + ); + } + + /** + * Get specific private link resource information for this grafana resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateLinkResourceName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + privateLinkResourceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, privateLinkResourceName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: PrivateLinkResourcesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.privateLinkResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/index.ts b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/index.ts index 252ad2d099b5..ccfcf6ca4471 100644 --- a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/index.ts +++ b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/index.ts @@ -8,3 +8,5 @@ export * from "./operations"; export * from "./grafana"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/operations.ts b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/operations.ts index 9537ad805ba5..28f57ff829d0 100644 --- a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/operations.ts +++ b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/operations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { OperationResult, OperationsListOptionalParams } from "../models"; +import { Operation, OperationsListOptionalParams } from "../models"; /// /** Interface representing a Operations. */ @@ -18,5 +18,5 @@ export interface Operations { */ list( options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..64231d766cca --- /dev/null +++ b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsApproveOptionalParams, + PrivateEndpointConnectionsApproveResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Get private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get private endpoint connections. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Manual approve private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + beginApprove( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsApproveOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsApproveResponse + > + >; + /** + * Manual approve private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + beginApproveAndWait( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsApproveOptionalParams + ): Promise; + /** + * Delete private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete private endpoint connection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateLinkResources.ts b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..699aac04f5b9 --- /dev/null +++ b/sdk/dashboard/arm-dashboard/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PrivateLinkResource, + PrivateLinkResourcesListOptionalParams, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * List all private link resources information for this grafana resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + workspaceName: string, + options?: PrivateLinkResourcesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get specific private link resource information for this grafana resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateLinkResourceName + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + privateLinkResourceName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/dashboard/arm-dashboard/test/sampleTest.ts b/sdk/dashboard/arm-dashboard/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/dashboard/arm-dashboard/test/sampleTest.ts +++ b/sdk/dashboard/arm-dashboard/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/dashboard/arm-dashboard/tsconfig.json b/sdk/dashboard/arm-dashboard/tsconfig.json index d6251f79964f..3e6ae96443f3 100644 --- a/sdk/dashboard/arm-dashboard/tsconfig.json +++ b/sdk/dashboard/arm-dashboard/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dashboard": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"