diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3bbac6c7d7d0..c73bd256eb23 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -12808,7 +12808,7 @@ packages: dev: false file:projects/arm-billing.tgz: - resolution: {integrity: sha512-FXyG1I9p+Y3rCU9yl503SMPYgEWGc+oPBAPeLF5d5kK4FBin4fJqk0D7LK4ZIYusE4OTricpA3cmmO/fNWdbQQ==, tarball: file:projects/arm-billing.tgz} + resolution: {integrity: sha512-X3Ss7x7n5lU/x31DmuXnMD7YKFAfvQ5h1JCo6TndLN7/HLsBeuWm3+lXdncF3lJX57YhDKGoTxW2Ubv1ch3pTA==, tarball: file:projects/arm-billing.tgz} name: '@rush-temp/arm-billing' version: 0.0.0 dependencies: @@ -14159,7 +14159,7 @@ packages: dev: false file:projects/arm-devhub.tgz: - resolution: {integrity: sha512-uM9sv49gEdbbukbPXUkGwEr57/C8G4voHCZVwjayArvzQxpmw0vCRWgmdNtHFUMNF8qxAne7E9v5b0oge6KgsA==, tarball: file:projects/arm-devhub.tgz} + resolution: {integrity: sha512-wGuVnoibzeXG6nlnxzcMJFsfihP+Jshk0FYLVgggAPNh15pCXPtK3+ymMqHASP4WyU17ec/pOhfIjtgDarxJOw==, tarball: file:projects/arm-devhub.tgz} name: '@rush-temp/arm-devhub' version: 0.0.0 dependencies: @@ -14178,6 +14178,7 @@ packages: rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.48)(typescript@5.5.4) tslib: 2.7.0 + tsx: 4.19.0 typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: @@ -14734,7 +14735,7 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-XqGGgdiWd0zbXpqsvvyMXxDy5WANEis+oGAVFWc2QTfgngSoIlFaVLBiBh7r6r4rj/nZm8SExFzaGY7cWp2w3Q==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-e2Puc3ITGaif0OvhG0He9bKI3UK9rWlgN4k4zzgwlJPKoZJsGyDzb/fQPAHG+gbO/OnmH6USZCCRpeUVWcK8oA==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: @@ -16343,7 +16344,7 @@ packages: dev: false file:projects/arm-monitor.tgz: - resolution: {integrity: sha512-kp8BpFXpMU04/C+fUDgnJ5mNmZBFLje3bnypHgQRBiPJlXwseyLZFQdcY7/zC2VdwlAzEmg1RfSYKrUiZKjkLg==, tarball: file:projects/arm-monitor.tgz} + resolution: {integrity: sha512-77Wuc0zmxIBdS17wwCC920i1r2R+pIgJwqnAoIvoj8AqOuEyZKgkXR7rv7Lyjja1ESczzof4BeC5zWmgN5ByGQ==, tarball: file:projects/arm-monitor.tgz} name: '@rush-temp/arm-monitor' version: 0.0.0 dependencies: @@ -22644,7 +22645,7 @@ packages: dev: false file:projects/notification-hubs.tgz: - resolution: {integrity: sha512-pCiK37AcCnfrQYqfF6X8XfoBbQqGDqoC2yX1Ix8whOk0szTDWvfJ+NYpOeSL79kk/Y6soAau6fb11NQVEmymzw==, tarball: file:projects/notification-hubs.tgz} + resolution: {integrity: sha512-+e2HyuiiVOagxBxCfpK6Gh1UBUV4xvlvaWdXooe0k+zAyc+nXPYddrSlFaK3t+Tbtx8oyFqOgiZ5eOKrLVo2dw==, tarball: file:projects/notification-hubs.tgz} name: '@rush-temp/notification-hubs' version: 0.0.0 dependencies: diff --git a/sdk/devhub/arm-devhub/CHANGELOG.md b/sdk/devhub/arm-devhub/CHANGELOG.md index ee1f0b7fee49..03c8bce0b149 100644 --- a/sdk/devhub/arm-devhub/CHANGELOG.md +++ b/sdk/devhub/arm-devhub/CHANGELOG.md @@ -1,18 +1,47 @@ # Release History - -## 1.0.0-beta.4 (Unreleased) - + +## 1.0.0-beta.4 (2024-09-06) +Compared with version 1.0.0-beta.3 + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group IacProfiles + - Added Interface ExportTemplateRequest + - Added Interface IacProfile + - Added Interface IacProfileListResult + - Added Interface IacProfilesCreateOrUpdateOptionalParams + - Added Interface IacProfilesDeleteOptionalParams + - Added Interface IacProfilesExportOptionalParams + - Added Interface IacProfilesGetOptionalParams + - Added Interface IacProfilesListByResourceGroupNextOptionalParams + - Added Interface IacProfilesListByResourceGroupOptionalParams + - Added Interface IacProfilesListNextOptionalParams + - Added Interface IacProfilesListOptionalParams + - Added Interface IacProfilesScaleOptionalParams + - Added Interface IacProfilesSyncOptionalParams + - Added Interface IacProfilesUpdateTagsOptionalParams + - Added Interface IacTemplateDetails + - Added Interface IacTemplateProperties + - Added Interface PrLinkResponse + - Added Interface ScaleProperty + - Added Interface ScaleTemplateRequest + - Added Interface StageProperties + - Added Type Alias IacProfilesCreateOrUpdateResponse + - Added Type Alias IacProfilesExportResponse + - Added Type Alias IacProfilesGetResponse + - Added Type Alias IacProfilesListByResourceGroupNextResponse + - Added Type Alias IacProfilesListByResourceGroupResponse + - Added Type Alias IacProfilesListNextResponse + - Added Type Alias IacProfilesListResponse + - Added Type Alias IacProfilesScaleResponse + - Added Type Alias IacProfilesUpdateTagsResponse + - Added Type Alias QuickStartTemplateType + - Added Enum KnownQuickStartTemplateType + + ## 1.0.0-beta.3 (2023-05-29) -**Features** +### Features Added - Added Interface ArtifactGenerationProperties - Added Interface GeneratePreviewArtifactsOptionalParams @@ -45,7 +74,7 @@ - Added Enum KnownManifestGenerationMode - Added Enum KnownWorkflowRunStatus -**Breaking Changes** +### Breaking Changes - Interface Workflow no longer has parameter namespace - Type of parameter authStatus of interface Workflow is changed from ManifestType to AuthorizationStatus @@ -53,11 +82,11 @@ ## 1.0.0-beta.2 (2023-01-04) -**Features** +### Features Added - Interface WorkflowListByResourceGroupNextOptionalParams no longer has parameter managedClusterResource ## 1.0.0-beta.1 (2022-10-18) -The package of @azure/arm-devhub is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-devhub is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/devhub/arm-devhub/LICENSE b/sdk/devhub/arm-devhub/LICENSE index 3a1d9b6f24f7..7d5934740965 100644 --- a/sdk/devhub/arm-devhub/LICENSE +++ b/sdk/devhub/arm-devhub/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Microsoft +Copyright (c) 2024 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/devhub/arm-devhub/_meta.json b/sdk/devhub/arm-devhub/_meta.json index fa0fe1988884..9ae5e59748dc 100644 --- a/sdk/devhub/arm-devhub/_meta.json +++ b/sdk/devhub/arm-devhub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "5595c3c7082fe447f32e637f06191f67fa8cfab2", + "commit": "3ebad76835d759116cbf3559ba55d783208f37c0", "readme": "specification/developerhub/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\developerhub\\resource-manager\\readme.md --use=@autorest/typescript@6.0.2 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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/developerhub/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.2" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/devhub/arm-devhub/package.json b/sdk/devhub/arm-devhub/package.json index 56812df4f745..e32e92c90601 100644 --- a/sdk/devhub/arm-devhub/package.json +++ b/sdk/devhub/arm-devhub/package.json @@ -10,8 +10,8 @@ "dependencies": { "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -30,19 +30,20 @@ "mkdirp": "^3.0.1", "typescript": "~5.5.3", "uglify-js": "^3.4.9", - "rimraf": "^5.0.5", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^4.0.1", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0", - "@types/mocha": "^10.0.0" + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -75,7 +76,6 @@ "pack": "npm pack 2>&1", "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -104,13 +104,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub" +} \ No newline at end of file diff --git a/sdk/devhub/arm-devhub/review/arm-devhub.api.md b/sdk/devhub/arm-devhub/review/arm-devhub.api.md index e3a6f59eef74..d2d7df50b934 100644 --- a/sdk/devhub/arm-devhub/review/arm-devhub.api.md +++ b/sdk/devhub/arm-devhub/review/arm-devhub.api.md @@ -69,6 +69,8 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { generatePreviewArtifacts(location: string, parameters: ArtifactGenerationProperties, options?: GeneratePreviewArtifactsOptionalParams): Promise; gitHubOAuth(location: string, options?: GitHubOAuthOptionalParams): Promise; gitHubOAuthCallback(location: string, code: string, state: string, options?: GitHubOAuthCallbackOptionalParams): Promise; + // (undocumented) + iacProfiles: IacProfiles; listGitHubOAuth(location: string, options?: ListGitHubOAuthOptionalParams): Promise; // (undocumented) operations: Operations; @@ -108,6 +110,19 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public (undocumented) +export interface ExportTemplateRequest { + // (undocumented) + instanceName?: string; + // (undocumented) + instanceStage?: string; + // (undocumented) + resourceGroupIds?: string[]; + // (undocumented) + siteId?: string; + templateName?: string; +} + // @public export interface GeneratePreviewArtifactsOptionalParams extends coreClient.OperationOptions { } @@ -168,6 +183,134 @@ export interface GitHubWorkflowProfileOidcCredentials { azureTenantId?: string; } +// @public +export interface IacProfile extends TrackedResource { + readonly authStatus?: AuthorizationStatus; + branchName?: string; + readonly etag?: string; + readonly prStatus?: PullRequestStatus; + readonly pullNumber?: number; + repositoryMainBranch?: string; + repositoryName?: string; + repositoryOwner?: string; + // (undocumented) + stages?: StageProperties[]; + storageAccountName?: string; + storageAccountResourceGroup?: string; + storageAccountSubscription?: string; + storageContainerName?: string; + // (undocumented) + templates?: IacTemplateProperties[]; +} + +// @public (undocumented) +export interface IacProfileListResult { + readonly nextLink?: string; + value?: IacProfile[]; +} + +// @public +export interface IacProfiles { + createOrUpdate(resourceGroupName: string, iacProfileName: string, parameters: IacProfile, options?: IacProfilesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, iacProfileName: string, options?: IacProfilesDeleteOptionalParams): Promise; + export(resourceGroupName: string, iacProfileName: string, parameters: ExportTemplateRequest, options?: IacProfilesExportOptionalParams): Promise; + get(resourceGroupName: string, iacProfileName: string, options?: IacProfilesGetOptionalParams): Promise; + list(options?: IacProfilesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: IacProfilesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + scale(resourceGroupName: string, iacProfileName: string, parameters: ScaleTemplateRequest, options?: IacProfilesScaleOptionalParams): Promise; + sync(resourceGroupName: string, iacProfileName: string, options?: IacProfilesSyncOptionalParams): Promise; + updateTags(resourceGroupName: string, iacProfileName: string, parameters: TagsObject, options?: IacProfilesUpdateTagsOptionalParams): Promise; +} + +// @public +export interface IacProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesCreateOrUpdateResponse = IacProfile; + +// @public +export interface IacProfilesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface IacProfilesExportOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesExportResponse = PrLinkResponse; + +// @public +export interface IacProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesGetResponse = IacProfile; + +// @public +export interface IacProfilesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesListByResourceGroupNextResponse = IacProfileListResult; + +// @public +export interface IacProfilesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesListByResourceGroupResponse = IacProfileListResult; + +// @public +export interface IacProfilesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesListNextResponse = IacProfileListResult; + +// @public +export interface IacProfilesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesListResponse = IacProfileListResult; + +// @public +export interface IacProfilesScaleOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesScaleResponse = PrLinkResponse; + +// @public +export interface IacProfilesSyncOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface IacProfilesUpdateTagsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IacProfilesUpdateTagsResponse = IacProfile; + +// @public (undocumented) +export interface IacTemplateDetails { + count?: number; + namingConvention?: string; + productName?: string; +} + +// @public +export interface IacTemplateProperties { + instanceName?: string; + instanceStage?: string; + quickStartTemplateType?: QuickStartTemplateType; + sourceResourceId?: string; + // (undocumented) + templateDetails?: IacTemplateDetails[]; + templateName?: string; +} + // @public export enum KnownActionType { Internal = "Internal" @@ -244,6 +387,15 @@ export enum KnownPullRequestStatus { Unknown = "unknown" } +// @public +export enum KnownQuickStartTemplateType { + ALL = "ALL", + HCI = "HCI", + Hciaks = "HCIAKS", + Hciarcvm = "HCIARCVM", + None = "None" +} + // @public export enum KnownWorkflowRunStatus { Completed = "completed", @@ -302,6 +454,11 @@ export type OperationsListResponse = OperationListResult; // @public export type Origin = string; +// @public (undocumented) +export interface PrLinkResponse { + prLink?: string; +} + // @public export interface ProxyResource extends Resource { } @@ -309,6 +466,9 @@ export interface ProxyResource extends Resource { // @public export type PullRequestStatus = string; +// @public +export type QuickStartTemplateType = string; + // @public export interface Resource { readonly id?: string; @@ -317,6 +477,29 @@ export interface Resource { readonly type?: string; } +// @public (undocumented) +export interface ScaleProperty { + numberOfStores?: number; + region?: string; + stage?: string; +} + +// @public (undocumented) +export interface ScaleTemplateRequest { + // (undocumented) + scaleProperties?: ScaleProperty[]; + templateName?: string; +} + +// @public +export interface StageProperties { + // (undocumented) + dependencies?: string[]; + // (undocumented) + gitEnvironment?: string; + stageName?: string; +} + // @public export interface SystemData { createdAt?: Date; diff --git a/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts b/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts index cc1dca59a197..9ab6484dbfa4 100644 --- a/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts +++ b/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts @@ -11,11 +11,19 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, WorkflowOperationsImpl } from "./operations"; -import { Operations, WorkflowOperations } from "./operationsInterfaces"; +import { + OperationsImpl, + WorkflowOperationsImpl, + IacProfilesImpl, +} from "./operations"; +import { + Operations, + WorkflowOperations, + IacProfiles, +} from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -28,7 +36,7 @@ import { ListGitHubOAuthResponse, ArtifactGenerationProperties, GeneratePreviewArtifactsOptionalParams, - GeneratePreviewArtifactsResponse + GeneratePreviewArtifactsResponse, } from "./models"; export class DeveloperHubServiceClient extends coreClient.ServiceClient { @@ -39,13 +47,13 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { /** * Initializes a new instance of the DeveloperHubServiceClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: DeveloperHubServiceClientOptionalParams + options?: DeveloperHubServiceClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -60,7 +68,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { } const defaults: DeveloperHubServiceClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; const packageDetails = `azsdk-js-arm-devhub/1.0.0-beta.4`; @@ -73,20 +81,21 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -96,7 +105,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -106,9 +115,9 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -116,9 +125,10 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-10-11-preview"; + this.apiVersion = options.apiVersion || "2024-05-01-preview"; this.operations = new OperationsImpl(this); this.workflowOperations = new WorkflowOperationsImpl(this); + this.iacProfiles = new IacProfilesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -131,7 +141,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -145,29 +155,29 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } /** * Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ gitHubOAuth( location: string, - options?: GitHubOAuthOptionalParams + options?: GitHubOAuthOptionalParams, ): Promise { return this.sendOperationRequest( { location, options }, - gitHubOAuthOperationSpec + gitHubOAuthOperationSpec, ); } /** * Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param code The code response from authenticating the GitHub App. * @param state The state response from authenticating the GitHub App. * @param options The options parameters. @@ -176,139 +186,136 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { location: string, code: string, state: string, - options?: GitHubOAuthCallbackOptionalParams + options?: GitHubOAuthCallbackOptionalParams, ): Promise { return this.sendOperationRequest( { location, code, state, options }, - gitHubOAuthCallbackOperationSpec + gitHubOAuthCallbackOperationSpec, ); } /** * Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param options The options parameters. */ listGitHubOAuth( location: string, - options?: ListGitHubOAuthOptionalParams + options?: ListGitHubOAuthOptionalParams, ): Promise { return this.sendOperationRequest( { location, options }, - listGitHubOAuthOperationSpec + listGitHubOAuthOperationSpec, ); } /** * Generate preview dockerfile and manifests. - * @param location The name of Azure region. + * @param location The name of the Azure region. * @param parameters Properties used for generating artifacts such as Dockerfiles and manifests. * @param options The options parameters. */ generatePreviewArtifacts( location: string, parameters: ArtifactGenerationProperties, - options?: GeneratePreviewArtifactsOptionalParams + options?: GeneratePreviewArtifactsOptionalParams, ): Promise { return this.sendOperationRequest( { location, parameters, options }, - generatePreviewArtifactsOperationSpec + generatePreviewArtifactsOperationSpec, ); } operations: Operations; workflowOperations: WorkflowOperations; + iacProfiles: IacProfiles; } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const gitHubOAuthOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default/getGitHubOAuthInfo", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default/getGitHubOAuthInfo", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.GitHubOAuthInfoResponse + bodyMapper: Mappers.GitHubOAuthInfoResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const gitHubOAuthCallbackOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth/default", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.GitHubOAuthResponse + bodyMapper: Mappers.GitHubOAuthResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.code, Parameters.state], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listGitHubOAuthOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/githuboauth", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.GitHubOAuthListResponse + bodyMapper: Mappers.GitHubOAuthListResponse, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const generatePreviewArtifactsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/generatePreviewArtifacts", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/generatePreviewArtifacts", httpMethod: "POST", responses: { 200: { bodyMapper: { - type: { name: "Dictionary", value: { type: { name: "String" } } } - } + type: { name: "Dictionary", value: { type: { name: "String" } } }, + }, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; diff --git a/sdk/devhub/arm-devhub/src/models/index.ts b/sdk/devhub/arm-devhub/src/models/index.ts index 51c7df78ea61..dec5ebc7fcdf 100644 --- a/sdk/devhub/arm-devhub/src/models/index.ts +++ b/sdk/devhub/arm-devhub/src/models/index.ts @@ -138,7 +138,7 @@ export interface GitHubOAuthInfoResponse { /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -286,6 +286,77 @@ export interface TagsObject { tags?: { [propertyName: string]: string }; } +export interface IacProfileListResult { + /** The list of IacProfiles. */ + value?: IacProfile[]; + /** + * The URL to the next set of IacProfile results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Properties of a Stage. */ +export interface StageProperties { + /** Stage Name */ + stageName?: string; + dependencies?: string[]; + gitEnvironment?: string; +} + +/** Properties of a IacTemplate. */ +export interface IacTemplateProperties { + /** Template Name */ + templateName?: string; + /** the source store of the template */ + sourceResourceId?: string; + /** the source stage of the template */ + instanceStage?: string; + /** the sample instance name of the template */ + instanceName?: string; + templateDetails?: IacTemplateDetails[]; + /** Determines the authorization status of requests. */ + quickStartTemplateType?: QuickStartTemplateType; +} + +export interface IacTemplateDetails { + /** The name of the products. */ + productName?: string; + /** Count of the product */ + count?: number; + /** Naming convention of this product */ + namingConvention?: string; +} + +export interface ExportTemplateRequest { + /** Template Name */ + templateName?: string; + resourceGroupIds?: string[]; + siteId?: string; + instanceName?: string; + instanceStage?: string; +} + +export interface PrLinkResponse { + /** The link of the pull request. */ + prLink?: string; +} + +export interface ScaleTemplateRequest { + /** Template Name */ + templateName?: string; + scaleProperties?: ScaleProperty[]; +} + +export interface ScaleProperty { + /** The region of the store */ + region?: string; + /** The stage of the store */ + stage?: string; + /** Number of the store */ + numberOfStores?: number; +} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} @@ -373,6 +444,48 @@ export interface Workflow extends TrackedResource { readonly authStatus?: AuthorizationStatus; } +/** Resource representation of a IacProfile. */ +export interface IacProfile extends TrackedResource { + /** + * A unique read-only string that changes whenever the resource is updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; + stages?: StageProperties[]; + templates?: IacTemplateProperties[]; + /** Terraform Storage Account Subscription */ + storageAccountSubscription?: string; + /** Terraform Storage Account Resource Group */ + storageAccountResourceGroup?: string; + /** Terraform Storage Account Name */ + storageAccountName?: string; + /** Terraform Container Name */ + storageContainerName?: string; + /** Repository Name */ + repositoryName?: string; + /** Repository Main Branch */ + repositoryMainBranch?: string; + /** Repository Owner */ + repositoryOwner?: string; + /** + * Determines the authorization status of requests. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly authStatus?: AuthorizationStatus; + /** + * The number associated with the submitted pull request. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pullNumber?: number; + /** + * The status of the Pull Request submitted against the users repository. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prStatus?: PullRequestStatus; + /** Repository Branch Name */ + branchName?: string; +} + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -380,7 +493,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -397,7 +510,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -418,7 +531,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -438,7 +551,7 @@ export enum KnownManifestType { /** Repositories using helm */ Helm = "helm", /** Repositories using kubernetes manifests */ - Kube = "kube" + Kube = "kube", } /** @@ -460,7 +573,7 @@ export enum KnownPullRequestStatus { /** Pull Request merged into repository. */ Merged = "merged", /** Workflow no longer found within repository. */ - Removed = "removed" + Removed = "removed", } /** @@ -482,7 +595,7 @@ export enum KnownWorkflowRunStatus { /** Workflow run is inprogress */ Inprogress = "inprogress", /** Workflow run is completed */ - Completed = "completed" + Completed = "completed", } /** @@ -503,7 +616,7 @@ export enum KnownAuthorizationStatus { /** Requests returned NotFound response */ NotFound = "NotFound", /** Requests returned other error response */ - Error = "Error" + Error = "Error", } /** @@ -544,7 +657,7 @@ export enum KnownGenerationLanguage { /** rust language */ Rust = "rust", /** swift language */ - Swift = "swift" + Swift = "swift", } /** @@ -573,7 +686,7 @@ export enum KnownDockerfileGenerationMode { /** Dockerfiles will be generated */ Enabled = "enabled", /** Dockerfiles will not be generated */ - Disabled = "disabled" + Disabled = "disabled", } /** @@ -591,7 +704,7 @@ export enum KnownManifestGenerationMode { /** Manifests will be generated */ Enabled = "enabled", /** Manifests will not be generated */ - Disabled = "disabled" + Disabled = "disabled", } /** @@ -609,7 +722,7 @@ export enum KnownGenerationManifestType { /** Helm manifests */ Helm = "helm", /** Kubernetes manifests */ - Kube = "kube" + Kube = "kube", } /** @@ -622,6 +735,33 @@ export enum KnownGenerationManifestType { */ export type GenerationManifestType = string; +/** Known values of {@link QuickStartTemplateType} that the service accepts. */ +export enum KnownQuickStartTemplateType { + /** The template has not use quick start template */ + None = "None", + /** The template use quick start template of HCI */ + HCI = "HCI", + /** The template use quick start template of HCI and AKS */ + Hciaks = "HCIAKS", + /** The template use quick start template of HCI and ArcVM */ + Hciarcvm = "HCIARCVM", + /** The template use quick start template of All supported products */ + ALL = "ALL", +} + +/** + * Defines values for QuickStartTemplateType. \ + * {@link KnownQuickStartTemplateType} can be used interchangeably with QuickStartTemplateType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: The template has not use quick start template \ + * **HCI**: The template use quick start template of HCI \ + * **HCIAKS**: The template use quick start template of HCI and AKS \ + * **HCIARCVM**: The template use quick start template of HCI and ArcVM \ + * **ALL**: The template use quick start template of All supported products + */ +export type QuickStartTemplateType = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -720,6 +860,77 @@ export interface WorkflowListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type WorkflowListByResourceGroupNextResponse = WorkflowListResult; +/** Optional parameters. */ +export interface IacProfilesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type IacProfilesListResponse = IacProfileListResult; + +/** Optional parameters. */ +export interface IacProfilesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type IacProfilesListByResourceGroupResponse = IacProfileListResult; + +/** Optional parameters. */ +export interface IacProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type IacProfilesGetResponse = IacProfile; + +/** Optional parameters. */ +export interface IacProfilesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type IacProfilesCreateOrUpdateResponse = IacProfile; + +/** Optional parameters. */ +export interface IacProfilesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface IacProfilesUpdateTagsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateTags operation. */ +export type IacProfilesUpdateTagsResponse = IacProfile; + +/** Optional parameters. */ +export interface IacProfilesExportOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the export operation. */ +export type IacProfilesExportResponse = PrLinkResponse; + +/** Optional parameters. */ +export interface IacProfilesScaleOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the scale operation. */ +export type IacProfilesScaleResponse = PrLinkResponse; + +/** Optional parameters. */ +export interface IacProfilesSyncOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface IacProfilesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type IacProfilesListNextResponse = IacProfileListResult; + +/** Optional parameters. */ +export interface IacProfilesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type IacProfilesListByResourceGroupNextResponse = IacProfileListResult; + /** Optional parameters. */ export interface DeveloperHubServiceClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/devhub/arm-devhub/src/models/mappers.ts b/sdk/devhub/arm-devhub/src/models/mappers.ts index c9730163475e..6a0fa962a0a3 100644 --- a/sdk/devhub/arm-devhub/src/models/mappers.ts +++ b/sdk/devhub/arm-devhub/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,39 +46,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -90,32 +90,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -127,11 +127,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -143,22 +143,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -168,10 +168,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -181,13 +181,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -199,19 +199,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const GitHubOAuthCallRequest: coreClient.CompositeMapper = { @@ -222,11 +222,11 @@ export const GitHubOAuthCallRequest: coreClient.CompositeMapper = { redirectUrl: { serializedName: "redirectUrl", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const GitHubOAuthInfoResponse: coreClient.CompositeMapper = { @@ -237,17 +237,17 @@ export const GitHubOAuthInfoResponse: coreClient.CompositeMapper = { authURL: { serializedName: "authURL", type: { - name: "String" - } + name: "String", + }, }, token: { serializedName: "token", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -259,32 +259,32 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -295,41 +295,41 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, }; export const GitHubOAuthListResponse: coreClient.CompositeMapper = { @@ -344,13 +344,13 @@ export const GitHubOAuthListResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "GitHubOAuthResponse" - } - } - } - } - } - } + className: "GitHubOAuthResponse", + }, + }, + }, + }, + }, + }, }; export const WorkflowListResult: coreClient.CompositeMapper = { @@ -365,20 +365,20 @@ export const WorkflowListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Workflow" - } - } - } + className: "Workflow", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeploymentProperties: coreClient.CompositeMapper = { @@ -389,8 +389,8 @@ export const DeploymentProperties: coreClient.CompositeMapper = { manifestType: { serializedName: "manifestType", type: { - name: "String" - } + name: "String", + }, }, kubeManifestLocations: { serializedName: "kubeManifestLocations", @@ -398,32 +398,32 @@ export const DeploymentProperties: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" - } - } - } + name: "String", + }, + }, + }, }, helmChartPath: { serializedName: "helmChartPath", type: { - name: "String" - } + name: "String", + }, }, helmValues: { serializedName: "helmValues", type: { - name: "String" - } + name: "String", + }, }, overrides: { serializedName: "overrides", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; export const Acr: coreClient.CompositeMapper = { @@ -434,52 +434,53 @@ export const Acr: coreClient.CompositeMapper = { acrSubscriptionId: { serializedName: "acrSubscriptionId", type: { - name: "String" - } + name: "String", + }, }, acrResourceGroup: { serializedName: "acrResourceGroup", type: { - name: "String" - } + name: "String", + }, }, acrRegistryName: { serializedName: "acrRegistryName", type: { - name: "String" - } + name: "String", + }, }, acrRepositoryName: { serializedName: "acrRepositoryName", type: { - name: "String" - } - } - } - } -}; - -export const GitHubWorkflowProfileOidcCredentials: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GitHubWorkflowProfileOidcCredentials", - modelProperties: { - azureClientId: { - serializedName: "azureClientId", - type: { - name: "String" - } + name: "String", + }, }, - azureTenantId: { - serializedName: "azureTenantId", - type: { - name: "String" - } - } - } - } + }, + }, }; +export const GitHubWorkflowProfileOidcCredentials: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GitHubWorkflowProfileOidcCredentials", + modelProperties: { + azureClientId: { + serializedName: "azureClientId", + type: { + name: "String", + }, + }, + azureTenantId: { + serializedName: "azureTenantId", + type: { + name: "String", + }, + }, + }, + }, + }; + export const WorkflowRun: coreClient.CompositeMapper = { type: { name: "Composite", @@ -489,31 +490,31 @@ export const WorkflowRun: coreClient.CompositeMapper = { serializedName: "succeeded", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, workflowRunURL: { serializedName: "workflowRunURL", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, lastRunAt: { serializedName: "lastRunAt", readOnly: true, type: { - name: "DateTime" - } + name: "DateTime", + }, }, workflowRunStatus: { serializedName: "workflowRunStatus", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ArtifactGenerationProperties: coreClient.CompositeMapper = { @@ -524,83 +525,83 @@ export const ArtifactGenerationProperties: coreClient.CompositeMapper = { generationLanguage: { serializedName: "generationLanguage", type: { - name: "String" - } + name: "String", + }, }, languageVersion: { serializedName: "languageVersion", type: { - name: "String" - } + name: "String", + }, }, builderVersion: { serializedName: "builderVersion", type: { - name: "String" - } + name: "String", + }, }, port: { serializedName: "port", type: { - name: "String" - } + name: "String", + }, }, appName: { serializedName: "appName", type: { - name: "String" - } + name: "String", + }, }, dockerfileOutputDirectory: { serializedName: "dockerfileOutputDirectory", type: { - name: "String" - } + name: "String", + }, }, manifestOutputDirectory: { serializedName: "manifestOutputDirectory", type: { - name: "String" - } + name: "String", + }, }, dockerfileGenerationMode: { serializedName: "dockerfileGenerationMode", type: { - name: "String" - } + name: "String", + }, }, manifestGenerationMode: { serializedName: "manifestGenerationMode", type: { - name: "String" - } + name: "String", + }, }, manifestType: { serializedName: "manifestType", type: { - name: "String" - } + name: "String", + }, }, imageName: { serializedName: "imageName", type: { - name: "String" - } + name: "String", + }, }, namespace: { serializedName: "namespace", type: { - name: "String" - } + name: "String", + }, }, imageTag: { serializedName: "imageTag", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const DeleteWorkflowResponse: coreClient.CompositeMapper = { @@ -611,11 +612,11 @@ export const DeleteWorkflowResponse: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TagsObject: coreClient.CompositeMapper = { @@ -627,11 +628,262 @@ export const TagsObject: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const IacProfileListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacProfileListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IacProfile", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const StageProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StageProperties", + modelProperties: { + stageName: { + serializedName: "stageName", + type: { + name: "String", + }, + }, + dependencies: { + serializedName: "dependencies", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + gitEnvironment: { + serializedName: "gitEnvironment", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const IacTemplateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacTemplateProperties", + modelProperties: { + templateName: { + serializedName: "templateName", + type: { + name: "String", + }, + }, + sourceResourceId: { + serializedName: "sourceResourceId", + type: { + name: "String", + }, + }, + instanceStage: { + serializedName: "instanceStage", + type: { + name: "String", + }, + }, + instanceName: { + serializedName: "instanceName", + type: { + name: "String", + }, + }, + templateDetails: { + serializedName: "templateDetails", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IacTemplateDetails", + }, + }, + }, + }, + quickStartTemplateType: { + serializedName: "quickStartTemplateType", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const IacTemplateDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacTemplateDetails", + modelProperties: { + productName: { + serializedName: "productName", + type: { + name: "String", + }, + }, + count: { + serializedName: "count", + type: { + name: "Number", + }, + }, + namingConvention: { + serializedName: "namingConvention", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ExportTemplateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExportTemplateRequest", + modelProperties: { + templateName: { + serializedName: "templateName", + type: { + name: "String", + }, + }, + resourceGroupIds: { + serializedName: "resourceGroupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + siteId: { + serializedName: "siteId", + type: { + name: "String", + }, + }, + instanceName: { + serializedName: "instanceName", + type: { + name: "String", + }, + }, + instanceStage: { + serializedName: "instanceStage", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrLinkResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrLinkResponse", + modelProperties: { + prLink: { + serializedName: "prLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ScaleTemplateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleTemplateRequest", + modelProperties: { + templateName: { + serializedName: "templateName", + type: { + name: "String", + }, + }, + scaleProperties: { + serializedName: "scaleProperties", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleProperty", + }, + }, + }, + }, + }, + }, +}; + +export const ScaleProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleProperty", + modelProperties: { + region: { + serializedName: "region", + type: { + name: "String", + }, + }, + stage: { + serializedName: "stage", + type: { + name: "String", + }, + }, + numberOfStores: { + serializedName: "numberOfStores", + type: { + name: "Number", + }, + }, + }, + }, }; export const ProxyResource: coreClient.CompositeMapper = { @@ -639,9 +891,9 @@ export const ProxyResource: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties - } - } + ...Resource.type.modelProperties, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -654,18 +906,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const GitHubOAuthResponse: coreClient.CompositeMapper = { @@ -677,11 +929,11 @@ export const GitHubOAuthResponse: coreClient.CompositeMapper = { username: { serializedName: "properties.username", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Workflow: coreClient.CompositeMapper = { @@ -694,185 +946,297 @@ export const Workflow: coreClient.CompositeMapper = { serializedName: "properties.artifactGenerationProperties.generationLanguage", type: { - name: "String" - } + name: "String", + }, }, languageVersion: { serializedName: "properties.artifactGenerationProperties.languageVersion", type: { - name: "String" - } + name: "String", + }, }, builderVersion: { serializedName: "properties.artifactGenerationProperties.builderVersion", type: { - name: "String" - } + name: "String", + }, }, port: { serializedName: "properties.artifactGenerationProperties.port", type: { - name: "String" - } + name: "String", + }, }, appName: { serializedName: "properties.artifactGenerationProperties.appName", type: { - name: "String" - } + name: "String", + }, }, dockerfileOutputDirectory: { serializedName: "properties.artifactGenerationProperties.dockerfileOutputDirectory", type: { - name: "String" - } + name: "String", + }, }, manifestOutputDirectory: { serializedName: "properties.artifactGenerationProperties.manifestOutputDirectory", type: { - name: "String" - } + name: "String", + }, }, dockerfileGenerationMode: { serializedName: "properties.artifactGenerationProperties.dockerfileGenerationMode", type: { - name: "String" - } + name: "String", + }, }, manifestGenerationMode: { serializedName: "properties.artifactGenerationProperties.manifestGenerationMode", type: { - name: "String" - } + name: "String", + }, }, manifestType: { serializedName: "properties.artifactGenerationProperties.manifestType", type: { - name: "String" - } + name: "String", + }, }, imageName: { serializedName: "properties.artifactGenerationProperties.imageName", type: { - name: "String" - } + name: "String", + }, }, namespacePropertiesArtifactGenerationPropertiesNamespace: { serializedName: "properties.artifactGenerationProperties.namespace", type: { - name: "String" - } + name: "String", + }, }, imageTag: { serializedName: "properties.artifactGenerationProperties.imageTag", type: { - name: "String" - } + name: "String", + }, }, repositoryOwner: { serializedName: "properties.githubWorkflowProfile.repositoryOwner", type: { - name: "String" - } + name: "String", + }, }, repositoryName: { serializedName: "properties.githubWorkflowProfile.repositoryName", type: { - name: "String" - } + name: "String", + }, }, branchName: { serializedName: "properties.githubWorkflowProfile.branchName", type: { - name: "String" - } + name: "String", + }, }, dockerfile: { serializedName: "properties.githubWorkflowProfile.dockerfile", type: { - name: "String" - } + name: "String", + }, }, dockerBuildContext: { serializedName: "properties.githubWorkflowProfile.dockerBuildContext", type: { - name: "String" - } + name: "String", + }, }, deploymentProperties: { serializedName: "properties.githubWorkflowProfile.deploymentProperties", type: { name: "Composite", - className: "DeploymentProperties" - } + className: "DeploymentProperties", + }, }, namespacePropertiesGithubWorkflowProfileNamespace: { serializedName: "properties.githubWorkflowProfile.namespace", type: { - name: "String" - } + name: "String", + }, }, acr: { serializedName: "properties.githubWorkflowProfile.acr", type: { name: "Composite", - className: "Acr" - } + className: "Acr", + }, }, oidcCredentials: { serializedName: "properties.githubWorkflowProfile.oidcCredentials", type: { name: "Composite", - className: "GitHubWorkflowProfileOidcCredentials" - } + className: "GitHubWorkflowProfileOidcCredentials", + }, }, aksResourceId: { serializedName: "properties.githubWorkflowProfile.aksResourceId", type: { - name: "String" - } + name: "String", + }, }, prURL: { serializedName: "properties.githubWorkflowProfile.prURL", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, pullNumber: { serializedName: "properties.githubWorkflowProfile.pullNumber", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, prStatus: { serializedName: "properties.githubWorkflowProfile.prStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, lastWorkflowRun: { serializedName: "properties.githubWorkflowProfile.lastWorkflowRun", type: { name: "Composite", - className: "WorkflowRun" - } + className: "WorkflowRun", + }, }, authStatus: { serializedName: "properties.githubWorkflowProfile.authStatus", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const IacProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacProfile", + modelProperties: { + ...TrackedResource.type.modelProperties, + etag: { + serializedName: "etag", + readOnly: true, + type: { + name: "String", + }, + }, + stages: { + serializedName: "properties.stages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StageProperties", + }, + }, + }, + }, + templates: { + serializedName: "properties.templates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IacTemplateProperties", + }, + }, + }, + }, + storageAccountSubscription: { + serializedName: + "properties.terraformProfile.storageAccountSubscription", + type: { + name: "String", + }, + }, + storageAccountResourceGroup: { + serializedName: + "properties.terraformProfile.storageAccountResourceGroup", + type: { + name: "String", + }, + }, + storageAccountName: { + serializedName: "properties.terraformProfile.storageAccountName", + type: { + name: "String", + }, + }, + storageContainerName: { + serializedName: "properties.terraformProfile.storageContainerName", + type: { + name: "String", + }, + }, + repositoryName: { + serializedName: "properties.githubProfile.repositoryName", + type: { + name: "String", + }, + }, + repositoryMainBranch: { + serializedName: "properties.githubProfile.repositoryMainBranch", + type: { + name: "String", + }, + }, + repositoryOwner: { + serializedName: "properties.githubProfile.repositoryOwner", + type: { + name: "String", + }, + }, + authStatus: { + serializedName: "properties.githubProfile.authStatus", + readOnly: true, + type: { + name: "String", + }, + }, + pullNumber: { + serializedName: "properties.githubProfile.pullNumber", + readOnly: true, + type: { + name: "Number", + }, + }, + prStatus: { + serializedName: "properties.githubProfile.prStatus", + readOnly: true, + type: { + name: "String", + }, + }, + branchName: { + serializedName: "properties.githubProfile.branchName", + type: { + name: "String", + }, + }, + }, + }, }; diff --git a/sdk/devhub/arm-devhub/src/models/parameters.ts b/sdk/devhub/arm-devhub/src/models/parameters.ts index e70be20d8749..d8262268dbfe 100644 --- a/sdk/devhub/arm-devhub/src/models/parameters.ts +++ b/sdk/devhub/arm-devhub/src/models/parameters.ts @@ -9,13 +9,16 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { GitHubOAuthCallRequest as GitHubOAuthCallRequestMapper, ArtifactGenerationProperties as ArtifactGenerationPropertiesMapper, Workflow as WorkflowMapper, - TagsObject as TagsObjectMapper + TagsObject as TagsObjectMapper, + IacProfile as IacProfileMapper, + ExportTemplateRequest as ExportTemplateRequestMapper, + ScaleTemplateRequest as ScaleTemplateRequestMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -25,9 +28,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -36,22 +39,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-10-11-preview", + defaultValue: "2024-05-01-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -61,42 +64,39 @@ export const contentType: OperationParameter = { isConstant: true, serializedName: "Content-Type", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters: OperationParameter = { parameterPath: ["options", "parameters"], - mapper: GitHubOAuthCallRequestMapper + mapper: GitHubOAuthCallRequestMapper, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1 - }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "Uuid", + }, + }, }; export const location: OperationURLParameter = { parameterPath: "location", mapper: { constraints: { - MinLength: 1 + MinLength: 1, }, serializedName: "location", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const code: OperationQueryParameter = { @@ -105,9 +105,9 @@ export const code: OperationQueryParameter = { serializedName: "code", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const state: OperationQueryParameter = { @@ -116,14 +116,14 @@ export const state: OperationQueryParameter = { serializedName: "state", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: ArtifactGenerationPropertiesMapper + mapper: ArtifactGenerationPropertiesMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -131,14 +131,14 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const managedClusterResource: OperationQueryParameter = { @@ -146,9 +146,9 @@ export const managedClusterResource: OperationQueryParameter = { mapper: { serializedName: "managedClusterResource", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const workflowName: OperationURLParameter = { @@ -156,27 +156,27 @@ export const workflowName: OperationURLParameter = { mapper: { constraints: { Pattern: new RegExp( - "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$" + "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", ), MaxLength: 63, - MinLength: 1 + MinLength: 1, }, serializedName: "workflowName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const parameters2: OperationParameter = { parameterPath: "parameters", - mapper: WorkflowMapper + mapper: WorkflowMapper, }; export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: TagsObjectMapper + mapper: TagsObjectMapper, }; export const nextLink: OperationURLParameter = { @@ -185,8 +185,41 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, + }, + skipEncoding: true, +}; + +export const iacProfileName: OperationURLParameter = { + parameterPath: "iacProfileName", + mapper: { + constraints: { + Pattern: new RegExp( + "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", + ), + MaxLength: 63, + MinLength: 1, + }, + serializedName: "iacProfileName", + required: true, + type: { + name: "String", + }, }, - skipEncoding: true +}; + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: IacProfileMapper, +}; + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: ExportTemplateRequestMapper, +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ScaleTemplateRequestMapper, }; diff --git a/sdk/devhub/arm-devhub/src/operations/iacProfiles.ts b/sdk/devhub/arm-devhub/src/operations/iacProfiles.ts new file mode 100644 index 000000000000..6a03072700b3 --- /dev/null +++ b/sdk/devhub/arm-devhub/src/operations/iacProfiles.ts @@ -0,0 +1,595 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { IacProfiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DeveloperHubServiceClient } from "../developerHubServiceClient"; +import { + IacProfile, + IacProfilesListNextOptionalParams, + IacProfilesListOptionalParams, + IacProfilesListResponse, + IacProfilesListByResourceGroupNextOptionalParams, + IacProfilesListByResourceGroupOptionalParams, + IacProfilesListByResourceGroupResponse, + IacProfilesGetOptionalParams, + IacProfilesGetResponse, + IacProfilesCreateOrUpdateOptionalParams, + IacProfilesCreateOrUpdateResponse, + IacProfilesDeleteOptionalParams, + TagsObject, + IacProfilesUpdateTagsOptionalParams, + IacProfilesUpdateTagsResponse, + ExportTemplateRequest, + IacProfilesExportOptionalParams, + IacProfilesExportResponse, + ScaleTemplateRequest, + IacProfilesScaleOptionalParams, + IacProfilesScaleResponse, + IacProfilesSyncOptionalParams, + IacProfilesListNextResponse, + IacProfilesListByResourceGroupNextResponse, +} from "../models"; + +/// +/** Class containing IacProfiles operations. */ +export class IacProfilesImpl implements IacProfiles { + private readonly client: DeveloperHubServiceClient; + + /** + * Initialize a new instance of the class IacProfiles class. + * @param client Reference to the service client + */ + constructor(client: DeveloperHubServiceClient) { + this.client = client; + } + + /** + * Gets a list of IacProfiles associated with the specified subscription. + * @param options The options parameters. + */ + public list( + options?: IacProfilesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: IacProfilesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: IacProfilesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: IacProfilesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of iacProfiles within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: IacProfilesListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: IacProfilesListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: IacProfilesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: IacProfilesListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Gets a list of IacProfiles associated with the specified subscription. + * @param options The options parameters. + */ + private _list( + options?: IacProfilesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets a list of iacProfiles within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: IacProfilesListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets a IacProfile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a IacProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters Resource representation of a IacProfile. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + iacProfileName: string, + parameters: IacProfile, + options?: IacProfilesCreateOrUpdateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, parameters, options }, + createOrUpdateOperationSpec, + ); + } + + /** + * Deletes a IacProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesDeleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, options }, + deleteOperationSpec, + ); + } + + /** + * Updates tags on a IacProfile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters Parameters supplied to the Update TagsObject Tags operation. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + iacProfileName: string, + parameters: TagsObject, + options?: IacProfilesUpdateTagsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, parameters, options }, + updateTagsOperationSpec, + ); + } + + /** + * Export a template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters + * @param options The options parameters. + */ + export( + resourceGroupName: string, + iacProfileName: string, + parameters: ExportTemplateRequest, + options?: IacProfilesExportOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, parameters, options }, + exportOperationSpec, + ); + } + + /** + * Scale by template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters + * @param options The options parameters. + */ + scale( + resourceGroupName: string, + iacProfileName: string, + parameters: ScaleTemplateRequest, + options?: IacProfilesScaleOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, parameters, options }, + scaleOperationSpec, + ); + } + + /** + * Sync template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + sync( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesSyncOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, iacProfileName, options }, + syncOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: IacProfilesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: IacProfilesListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/iacProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IacProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IacProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IacProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.IacProfile, + }, + 201: { + bodyMapper: Mappers.IacProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateTagsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.IacProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const exportOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}/export", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PrLinkResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const scaleOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}/scale", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PrLinkResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const syncOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/iacProfiles/{iacProfileName}/sync", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.iacProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IacProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IacProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/devhub/arm-devhub/src/operations/index.ts b/sdk/devhub/arm-devhub/src/operations/index.ts index 11fd3b56b25b..9d21a88d6ee9 100644 --- a/sdk/devhub/arm-devhub/src/operations/index.ts +++ b/sdk/devhub/arm-devhub/src/operations/index.ts @@ -8,3 +8,4 @@ export * from "./operations"; export * from "./workflowOperations"; +export * from "./iacProfiles"; diff --git a/sdk/devhub/arm-devhub/src/operations/operations.ts b/sdk/devhub/arm-devhub/src/operations/operations.ts index ba910c88aceb..6eb024d5458e 100644 --- a/sdk/devhub/arm-devhub/src/operations/operations.ts +++ b/sdk/devhub/arm-devhub/src/operations/operations.ts @@ -13,7 +13,7 @@ import * as Parameters from "../models/parameters"; import { DeveloperHubServiceClient } from "../developerHubServiceClient"; import { OperationsListOptionalParams, - OperationsListResponse + OperationsListResponse, } from "../models"; /** Class containing Operations operations. */ @@ -33,7 +33,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -46,14 +46,14 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/devhub/arm-devhub/src/operations/workflowOperations.ts b/sdk/devhub/arm-devhub/src/operations/workflowOperations.ts index a0d943abc114..bd16cb0af23b 100644 --- a/sdk/devhub/arm-devhub/src/operations/workflowOperations.ts +++ b/sdk/devhub/arm-devhub/src/operations/workflowOperations.ts @@ -31,7 +31,7 @@ import { WorkflowUpdateTagsOptionalParams, WorkflowUpdateTagsResponse, WorkflowListNextResponse, - WorkflowListByResourceGroupNextResponse + WorkflowListByResourceGroupNextResponse, } from "../models"; /// @@ -52,7 +52,7 @@ export class WorkflowOperationsImpl implements WorkflowOperations { * @param options The options parameters. */ public list( - options?: WorkflowListOptionalParams + options?: WorkflowListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -67,13 +67,13 @@ export class WorkflowOperationsImpl implements WorkflowOperations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: WorkflowListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: WorkflowListResponse; let continuationToken = settings?.continuationToken; @@ -94,7 +94,7 @@ export class WorkflowOperationsImpl implements WorkflowOperations { } private async *listPagingAll( - options?: WorkflowListOptionalParams + options?: WorkflowListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -108,7 +108,7 @@ export class WorkflowOperationsImpl implements WorkflowOperations { */ public listByResourceGroup( resourceGroupName: string, - options?: WorkflowListByResourceGroupOptionalParams + options?: WorkflowListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -125,16 +125,16 @@ export class WorkflowOperationsImpl implements WorkflowOperations { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: WorkflowListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: WorkflowListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -149,7 +149,7 @@ export class WorkflowOperationsImpl implements WorkflowOperations { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -160,11 +160,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: WorkflowListByResourceGroupOptionalParams + options?: WorkflowListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -175,7 +175,7 @@ export class WorkflowOperationsImpl implements WorkflowOperations { * @param options The options parameters. */ private _list( - options?: WorkflowListOptionalParams + options?: WorkflowListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -187,11 +187,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { */ private _listByResourceGroup( resourceGroupName: string, - options?: WorkflowListByResourceGroupOptionalParams + options?: WorkflowListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } @@ -204,11 +204,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { get( resourceGroupName: string, workflowName: string, - options?: WorkflowGetOptionalParams + options?: WorkflowGetOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workflowName, options }, - getOperationSpec + getOperationSpec, ); } @@ -223,11 +223,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { resourceGroupName: string, workflowName: string, parameters: Workflow, - options?: WorkflowCreateOrUpdateOptionalParams + options?: WorkflowCreateOrUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workflowName, parameters, options }, - createOrUpdateOperationSpec + createOrUpdateOperationSpec, ); } @@ -240,11 +240,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { delete( resourceGroupName: string, workflowName: string, - options?: WorkflowDeleteOptionalParams + options?: WorkflowDeleteOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workflowName, options }, - deleteOperationSpec + deleteOperationSpec, ); } @@ -259,11 +259,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { resourceGroupName: string, workflowName: string, parameters: TagsObject, - options?: WorkflowUpdateTagsOptionalParams + options?: WorkflowUpdateTagsOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, workflowName, parameters, options }, - updateTagsOperationSpec + updateTagsOperationSpec, ); } @@ -274,11 +274,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { */ private _listNext( nextLink: string, - options?: WorkflowListNextOptionalParams + options?: WorkflowListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } @@ -291,11 +291,11 @@ export class WorkflowOperationsImpl implements WorkflowOperations { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: WorkflowListByResourceGroupNextOptionalParams + options?: WorkflowListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -307,74 +307,71 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WorkflowListResult + bodyMapper: Mappers.WorkflowListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WorkflowListResult + bodyMapper: Mappers.WorkflowListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion, Parameters.managedClusterResource], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Workflow + bodyMapper: Mappers.Workflow, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.workflowName + Parameters.workflowName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Workflow + bodyMapper: Mappers.Workflow, }, 201: { - bodyMapper: Mappers.Workflow + bodyMapper: Mappers.Workflow, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], @@ -382,46 +379,44 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.workflowName + Parameters.workflowName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.DeleteWorkflowResponse + bodyMapper: Mappers.DeleteWorkflowResponse, }, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.workflowName + Parameters.workflowName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const updateTagsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevHub/workflows/{workflowName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.Workflow + bodyMapper: Mappers.Workflow, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], @@ -429,48 +424,48 @@ const updateTagsOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.workflowName + Parameters.workflowName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WorkflowListResult + bodyMapper: Mappers.WorkflowListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.WorkflowListResult + bodyMapper: Mappers.WorkflowListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.nextLink + Parameters.nextLink, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/devhub/arm-devhub/src/operationsInterfaces/iacProfiles.ts b/sdk/devhub/arm-devhub/src/operationsInterfaces/iacProfiles.ts new file mode 100644 index 000000000000..9a511c5bea81 --- /dev/null +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/iacProfiles.ts @@ -0,0 +1,135 @@ +/* + * 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 { + IacProfile, + IacProfilesListOptionalParams, + IacProfilesListByResourceGroupOptionalParams, + IacProfilesGetOptionalParams, + IacProfilesGetResponse, + IacProfilesCreateOrUpdateOptionalParams, + IacProfilesCreateOrUpdateResponse, + IacProfilesDeleteOptionalParams, + TagsObject, + IacProfilesUpdateTagsOptionalParams, + IacProfilesUpdateTagsResponse, + ExportTemplateRequest, + IacProfilesExportOptionalParams, + IacProfilesExportResponse, + ScaleTemplateRequest, + IacProfilesScaleOptionalParams, + IacProfilesScaleResponse, + IacProfilesSyncOptionalParams, +} from "../models"; + +/// +/** Interface representing a IacProfiles. */ +export interface IacProfiles { + /** + * Gets a list of IacProfiles associated with the specified subscription. + * @param options The options parameters. + */ + list( + options?: IacProfilesListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a list of iacProfiles within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: IacProfilesListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets a IacProfile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesGetOptionalParams, + ): Promise; + /** + * Creates or updates a IacProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters Resource representation of a IacProfile. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + iacProfileName: string, + parameters: IacProfile, + options?: IacProfilesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Deletes a IacProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesDeleteOptionalParams, + ): Promise; + /** + * Updates tags on a IacProfile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters Parameters supplied to the Update TagsObject Tags operation. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + iacProfileName: string, + parameters: TagsObject, + options?: IacProfilesUpdateTagsOptionalParams, + ): Promise; + /** + * Export a template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters + * @param options The options parameters. + */ + export( + resourceGroupName: string, + iacProfileName: string, + parameters: ExportTemplateRequest, + options?: IacProfilesExportOptionalParams, + ): Promise; + /** + * Scale by template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param parameters + * @param options The options parameters. + */ + scale( + resourceGroupName: string, + iacProfileName: string, + parameters: ScaleTemplateRequest, + options?: IacProfilesScaleOptionalParams, + ): Promise; + /** + * Sync template + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param iacProfileName The name of the IacProfile. + * @param options The options parameters. + */ + sync( + resourceGroupName: string, + iacProfileName: string, + options?: IacProfilesSyncOptionalParams, + ): Promise; +} diff --git a/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts b/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts index 11fd3b56b25b..9d21a88d6ee9 100644 --- a/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts @@ -8,3 +8,4 @@ export * from "./operations"; export * from "./workflowOperations"; +export * from "./iacProfiles"; diff --git a/sdk/devhub/arm-devhub/src/operationsInterfaces/operations.ts b/sdk/devhub/arm-devhub/src/operationsInterfaces/operations.ts index 21d0ce0caa70..e3ada04a8936 100644 --- a/sdk/devhub/arm-devhub/src/operationsInterfaces/operations.ts +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/operations.ts @@ -8,7 +8,7 @@ import { OperationsListOptionalParams, - OperationsListResponse + OperationsListResponse, } from "../models"; /** Interface representing a Operations. */ diff --git a/sdk/devhub/arm-devhub/src/operationsInterfaces/workflowOperations.ts b/sdk/devhub/arm-devhub/src/operationsInterfaces/workflowOperations.ts index 9f1eccf4de8a..8b167bb508d5 100644 --- a/sdk/devhub/arm-devhub/src/operationsInterfaces/workflowOperations.ts +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/workflowOperations.ts @@ -19,7 +19,7 @@ import { WorkflowDeleteResponse, TagsObject, WorkflowUpdateTagsOptionalParams, - WorkflowUpdateTagsResponse + WorkflowUpdateTagsResponse, } from "../models"; /// @@ -30,7 +30,7 @@ export interface WorkflowOperations { * @param options The options parameters. */ list( - options?: WorkflowListOptionalParams + options?: WorkflowListOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a list of workflows within a resource group. @@ -39,7 +39,7 @@ export interface WorkflowOperations { */ listByResourceGroup( resourceGroupName: string, - options?: WorkflowListByResourceGroupOptionalParams + options?: WorkflowListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; /** * Gets a workflow. @@ -50,7 +50,7 @@ export interface WorkflowOperations { get( resourceGroupName: string, workflowName: string, - options?: WorkflowGetOptionalParams + options?: WorkflowGetOptionalParams, ): Promise; /** * Creates or updates a workflow @@ -63,7 +63,7 @@ export interface WorkflowOperations { resourceGroupName: string, workflowName: string, parameters: Workflow, - options?: WorkflowCreateOrUpdateOptionalParams + options?: WorkflowCreateOrUpdateOptionalParams, ): Promise; /** * Deletes a workflow @@ -74,7 +74,7 @@ export interface WorkflowOperations { delete( resourceGroupName: string, workflowName: string, - options?: WorkflowDeleteOptionalParams + options?: WorkflowDeleteOptionalParams, ): Promise; /** * Updates tags on a workflow. @@ -87,6 +87,6 @@ export interface WorkflowOperations { resourceGroupName: string, workflowName: string, parameters: TagsObject, - options?: WorkflowUpdateTagsOptionalParams + options?: WorkflowUpdateTagsOptionalParams, ): Promise; } diff --git a/sdk/devhub/arm-devhub/src/pagingHelper.ts b/sdk/devhub/arm-devhub/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/devhub/arm-devhub/src/pagingHelper.ts +++ b/sdk/devhub/arm-devhub/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/devhub/arm-devhub/test/sampleTest.ts b/sdk/devhub/arm-devhub/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/devhub/arm-devhub/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +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 (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/devhub/arm-devhub/tsconfig.json b/sdk/devhub/arm-devhub/tsconfig.json index 30881a69d030..3e6ae96443f3 100644 --- a/sdk/devhub/arm-devhub/tsconfig.json +++ b/sdk/devhub/arm-devhub/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-devhub": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"