diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 4065375e268b..fcd6812e6a3e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14478,7 +14478,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: @@ -14497,6 +14497,7 @@ packages: rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) tslib: 2.7.0 + tsx: 4.19.0 typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: diff --git a/sdk/devhub/arm-devhub/CHANGELOG.md b/sdk/devhub/arm-devhub/CHANGELOG.md index 60f0e06733d0..ee5c3c472f48 100644 --- a/sdk/devhub/arm-devhub/CHANGELOG.md +++ b/sdk/devhub/arm-devhub/CHANGELOG.md @@ -1,15 +1,100 @@ # Release History - -## 1.0.0-beta.4 (Unreleased) - + +## 1.0.0-beta.4 (2024-09-12) +Compared with version 1.0.0-beta.3 + ### Features Added -### Breaking Changes + - Added operation group AdooAuthOperations + - Added operation group IacProfiles + - Added Interface AdooAuth + - Added Interface AdooAuthCallRequest + - Added Interface AdooAuthGetOptionalParams + - Added Interface AdooAuthInfoResponse + - Added Interface AdooAuthListNextOptionalParams + - Added Interface AdooAuthListOptionalParams + - Added Interface AdooAuthListResponse + - Added Interface AdooAuthResponse + - Added Interface ADORepository + - Added Interface AzurePipelineProfile + - Added Interface Build + - Added Interface Deployment + - Added Interface ExportTemplateRequest + - Added Interface GetAdooAuthInfoOptionalParams + - Added Interface GitHubOAuthProperties + - Added Interface GitHubWorkflowProfile + - 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 PullRequest + - Added Interface ScaleProperty + - Added Interface ScaleTemplateRequest + - Added Interface StageProperties + - Added Interface WorkflowProperties + - Added Type Alias AdooAuthGetResponse + - Added Type Alias AdooAuthListNextResponse + - Added Type Alias AdooAuthListOperationResponse + - Added Type Alias GetAdooAuthInfoResponse + - 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 + - Interface GitHubOAuthResponse has a new optional parameter properties + - Interface Workflow has a new optional parameter properties + - Added Enum KnownQuickStartTemplateType -### Bugs Fixed - -### Other Changes +### Breaking Changes + - Interface GitHubOAuthResponse no longer has parameter username + - Interface Workflow no longer has parameter acr + - Interface Workflow no longer has parameter aksResourceId + - Interface Workflow no longer has parameter appName + - Interface Workflow no longer has parameter authStatus + - Interface Workflow no longer has parameter branchName + - Interface Workflow no longer has parameter builderVersion + - Interface Workflow no longer has parameter deploymentProperties + - Interface Workflow no longer has parameter dockerBuildContext + - Interface Workflow no longer has parameter dockerfile + - Interface Workflow no longer has parameter dockerfileGenerationMode + - Interface Workflow no longer has parameter dockerfileOutputDirectory + - Interface Workflow no longer has parameter generationLanguage + - Interface Workflow no longer has parameter imageName + - Interface Workflow no longer has parameter imageTag + - Interface Workflow no longer has parameter languageVersion + - Interface Workflow no longer has parameter lastWorkflowRun + - Interface Workflow no longer has parameter manifestGenerationMode + - Interface Workflow no longer has parameter manifestOutputDirectory + - Interface Workflow no longer has parameter manifestType + - Interface Workflow no longer has parameter namespacePropertiesArtifactGenerationPropertiesNamespace + - Interface Workflow no longer has parameter namespacePropertiesGithubWorkflowProfileNamespace + - Interface Workflow no longer has parameter oidcCredentials + - Interface Workflow no longer has parameter port + - Interface Workflow no longer has parameter prStatus + - Interface Workflow no longer has parameter prURL + - Interface Workflow no longer has parameter pullNumber + - Interface Workflow no longer has parameter repositoryName + - Interface Workflow no longer has parameter repositoryOwner + + ## 1.0.0-beta.3 (2023-05-29) ### Features Added @@ -60,4 +145,4 @@ ## 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..b05157a43d4c 100644 --- a/sdk/devhub/arm-devhub/_meta.json +++ b/sdk/devhub/arm-devhub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "5595c3c7082fe447f32e637f06191f67fa8cfab2", + "commit": "498c8332a9c9946f7d5f59d918325b38f828e488", "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.12", + "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..bf1daf28dbc7 100644 --- a/sdk/devhub/arm-devhub/review/arm-devhub.api.md +++ b/sdk/devhub/arm-devhub/review/arm-devhub.api.md @@ -19,6 +19,69 @@ export interface Acr { // @public export type ActionType = string; +// @public +export interface AdooAuth { + username?: string; +} + +// @public +export interface AdooAuthCallRequest { + redirectUrl?: string; +} + +// @public +export interface AdooAuthGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AdooAuthGetResponse = AdooAuthResponse; + +// @public +export interface AdooAuthInfoResponse { + authURL?: string; + token?: string; +} + +// @public +export interface AdooAuthListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AdooAuthListNextResponse = AdooAuthListResponse; + +// @public +export type AdooAuthListOperationResponse = AdooAuthListResponse; + +// @public +export interface AdooAuthListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface AdooAuthListResponse { + readonly nextLink?: string; + value?: AdooAuthResponse[]; +} + +// @public +export interface AdooAuthOperations { + get(location: string, options?: AdooAuthGetOptionalParams): Promise; + list(location: string, options?: AdooAuthListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AdooAuthResponse extends ProxyResource { + properties?: AdooAuth; +} + +// @public +export interface ADORepository { + adoOrganization?: string; + branchName?: string; + projectName?: string; + repositoryName?: string; + repositoryOwner?: string; +} + // @public export interface ArtifactGenerationProperties { appName?: string; @@ -39,6 +102,27 @@ export interface ArtifactGenerationProperties { // @public export type AuthorizationStatus = string; +// @public +export interface AzurePipelineProfile { + acr?: string; + armServiceConnection?: string; + readonly authStatus?: AuthorizationStatus; + build?: Build; + clusterId?: string; + deployment?: Deployment; + // (undocumented) + lastWorkflowRun?: WorkflowRun; + namespace?: string; + pullRequest?: PullRequest; + repository?: ADORepository; +} + +// @public +export interface Build { + dockerBuildContext?: string; + dockerfile?: string; +} + // @public export type CreatedByType = string; @@ -47,8 +131,8 @@ export interface DeleteWorkflowResponse { status?: string; } -// @public (undocumented) -export interface DeploymentProperties { +// @public +export interface Deployment { helmChartPath?: string; helmValues?: string; // (undocumented) @@ -65,10 +149,15 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DeveloperHubServiceClientOptionalParams); // (undocumented) + adooAuthOperations: AdooAuthOperations; + // (undocumented) apiVersion: string; generatePreviewArtifacts(location: string, parameters: ArtifactGenerationProperties, options?: GeneratePreviewArtifactsOptionalParams): Promise; + getAdooAuthInfo(location: string, options?: GetAdooAuthInfoOptionalParams): 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 +197,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 { } @@ -123,6 +225,14 @@ export type GenerationLanguage = string; // @public export type GenerationManifestType = string; +// @public +export interface GetAdooAuthInfoOptionalParams extends coreClient.OperationOptions { + parameters?: AdooAuthCallRequest; +} + +// @public +export type GetAdooAuthInfoResponse = AdooAuthInfoResponse; + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -158,16 +268,169 @@ export interface GitHubOAuthOptionalParams extends coreClient.OperationOptions { } // @public -export interface GitHubOAuthResponse extends ProxyResource { +export interface GitHubOAuthProperties { username?: string; } +// @public +export interface GitHubOAuthResponse extends ProxyResource { + properties?: GitHubOAuthProperties; +} + +// @public +export interface GitHubWorkflowProfile { + acr?: Acr; + aksResourceId?: string; + readonly authStatus?: AuthorizationStatus; + branchName?: string; + deploymentProperties?: Deployment; + dockerBuildContext?: string; + dockerfile?: string; + // (undocumented) + lastWorkflowRun?: WorkflowRun; + namespace?: string; + oidcCredentials?: GitHubWorkflowProfileOidcCredentials; + readonly prStatus?: PullRequestStatus; + readonly prURL?: string; + readonly pullNumber?: number; + repositoryName?: string; + repositoryOwner?: string; +} + // @public export interface GitHubWorkflowProfileOidcCredentials { azureClientId?: string; 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; + readonly quickStartTemplateType?: QuickStartTemplateType; + sourceResourceId?: string; + // (undocumented) + templateDetails?: IacTemplateDetails[]; + templateName?: string; +} + // @public export enum KnownActionType { Internal = "Internal" @@ -244,6 +507,14 @@ export enum KnownPullRequestStatus { Unknown = "unknown" } +// @public +export enum KnownQuickStartTemplateType { + HCI = "HCI", + Hciaks = "HCIAKS", + Hciarcvm = "HCIARCVM", + None = "None" +} + // @public export enum KnownWorkflowRunStatus { Completed = "completed", @@ -302,13 +573,28 @@ export type OperationsListResponse = OperationListResult; // @public export type Origin = string; +// @public (undocumented) +export interface PrLinkResponse { + prLink?: string; +} + // @public export interface ProxyResource extends Resource { } +// @public +export interface PullRequest { + readonly prStatus?: PullRequestStatus; + readonly prURL?: string; + readonly pullNumber?: number; +} + // @public export type PullRequestStatus = string; +// @public +export type QuickStartTemplateType = string; + // @public export interface Resource { readonly id?: string; @@ -317,6 +603,29 @@ export interface Resource { readonly type?: string; } +// @public (undocumented) +export interface ScaleProperty { + numberOfStore?: number; + region?: string; + stage?: string; +} + +// @public (undocumented) +export interface ScaleTemplateRequest { + // (undocumented) + scaleRequirement?: ScaleProperty[]; + templateName?: string; +} + +// @public +export interface StageProperties { + // (undocumented) + dependencies?: string[]; + // (undocumented) + gitEnvironment?: string; + stageName?: string; +} + // @public export interface SystemData { createdAt?: Date; @@ -344,36 +653,7 @@ export interface TrackedResource extends Resource { // @public export interface Workflow extends TrackedResource { - acr?: Acr; - aksResourceId?: string; - appName?: string; - readonly authStatus?: AuthorizationStatus; - branchName?: string; - builderVersion?: string; - // (undocumented) - deploymentProperties?: DeploymentProperties; - dockerBuildContext?: string; - dockerfile?: string; - dockerfileGenerationMode?: DockerfileGenerationMode; - dockerfileOutputDirectory?: string; - generationLanguage?: GenerationLanguage; - imageName?: string; - imageTag?: string; - languageVersion?: string; - // (undocumented) - lastWorkflowRun?: WorkflowRun; - manifestGenerationMode?: ManifestGenerationMode; - manifestOutputDirectory?: string; - manifestType?: GenerationManifestType; - namespacePropertiesArtifactGenerationPropertiesNamespace?: string; - namespacePropertiesGithubWorkflowProfileNamespace?: string; - oidcCredentials?: GitHubWorkflowProfileOidcCredentials; - port?: string; - readonly prStatus?: PullRequestStatus; - readonly prURL?: string; - readonly pullNumber?: number; - repositoryName?: string; - repositoryOwner?: string; + properties?: WorkflowProperties; } // @public @@ -442,11 +722,18 @@ export interface WorkflowOperations { updateTags(resourceGroupName: string, workflowName: string, parameters: TagsObject, options?: WorkflowUpdateTagsOptionalParams): Promise; } +// @public +export interface WorkflowProperties { + artifactGenerationProperties?: ArtifactGenerationProperties; + azurePipelineProfile?: AzurePipelineProfile; + githubWorkflowProfile?: GitHubWorkflowProfile; +} + // @public (undocumented) export interface WorkflowRun { readonly lastRunAt?: Date; readonly succeeded?: boolean; - workflowRunStatus?: WorkflowRunStatus; + readonly workflowRunStatus?: WorkflowRunStatus; readonly workflowRunURL?: string; } diff --git a/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts b/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts index cc1dca59a197..75aa2b70b7f6 100644 --- a/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts +++ b/sdk/devhub/arm-devhub/src/developerHubServiceClient.ts @@ -11,11 +11,21 @@ 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, + AdooAuthOperationsImpl, + IacProfilesImpl, +} from "./operations"; +import { + Operations, + WorkflowOperations, + AdooAuthOperations, + IacProfiles, +} from "./operationsInterfaces"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; import { @@ -28,7 +38,9 @@ import { ListGitHubOAuthResponse, ArtifactGenerationProperties, GeneratePreviewArtifactsOptionalParams, - GeneratePreviewArtifactsResponse + GeneratePreviewArtifactsResponse, + GetAdooAuthInfoOptionalParams, + GetAdooAuthInfoResponse, } from "./models"; export class DeveloperHubServiceClient extends coreClient.ServiceClient { @@ -39,13 +51,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 +72,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 +85,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 +109,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -106,9 +119,9 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -116,9 +129,11 @@ 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-08-01-preview"; this.operations = new OperationsImpl(this); this.workflowOperations = new WorkflowOperationsImpl(this); + this.adooAuthOperations = new AdooAuthOperationsImpl(this); + this.iacProfiles = new IacProfilesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -131,7 +146,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 +160,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 +191,174 @@ 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, + ); + } + + /** + * Gets ADOOAuth info used to authenticate users with ADO. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + getAdooAuthInfo( + location: string, + options?: GetAdooAuthInfoOptionalParams, + ): Promise { + return this.sendOperationRequest( + { location, options }, + getAdooAuthInfoOperationSpec, ); } operations: Operations; workflowOperations: WorkflowOperations; + adooAuthOperations: AdooAuthOperations; + 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, +}; +const getAdooAuthInfoOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/adooauth/default/getADOOAuthInfo", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AdooAuthInfoResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + 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..77780b313ca5 100644 --- a/sdk/devhub/arm-devhub/src/models/index.ts +++ b/sdk/devhub/arm-devhub/src/models/index.ts @@ -135,10 +135,16 @@ export interface GitHubOAuthInfoResponse { token?: string; } +/** The response from List GitHubOAuth operation. */ +export interface GitHubOAuthProperties { + /** user making request */ + username?: string; +} + /** 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; @@ -192,7 +198,63 @@ export interface WorkflowListResult { readonly nextLink?: string; } -export interface DeploymentProperties { +/** Workflow properties */ +export interface WorkflowProperties { + /** Profile of a github workflow. */ + githubWorkflowProfile?: GitHubWorkflowProfile; + /** Properties for generating artifacts like dockerfile and manifests. */ + artifactGenerationProperties?: ArtifactGenerationProperties; + /** Profile of an azure pipeline. */ + azurePipelineProfile?: AzurePipelineProfile; +} + +/** GitHub Workflow Profile */ +export interface GitHubWorkflowProfile { + /** Repository Owner */ + repositoryOwner?: string; + /** Repository Name */ + repositoryName?: string; + /** Repository Branch Name */ + branchName?: string; + /** Path to the Dockerfile within the repository. */ + dockerfile?: string; + /** Path to Dockerfile Build Context within the repository. */ + dockerBuildContext?: string; + /** Deployment details of the repository associated with the workflow. */ + deploymentProperties?: Deployment; + /** Kubernetes namespace the application is deployed to. */ + namespace?: string; + /** Information on the azure container registry */ + acr?: Acr; + /** The fields needed for OIDC with GitHub. */ + oidcCredentials?: GitHubWorkflowProfileOidcCredentials; + /** The Azure Kubernetes Cluster Resource the application will be deployed to. */ + aksResourceId?: string; + /** + * The URL to the Pull Request submitted against the users repository. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prURL?: string; + /** + * 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; + lastWorkflowRun?: WorkflowRun; + /** + * Determines the authorization status of requests. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly authStatus?: AuthorizationStatus; +} + +/** Deployment details of the repository associated with the workflow. */ +export interface Deployment { /** Determines the type of manifests within the repository. */ manifestType?: ManifestType; kubeManifestLocations?: string[]; @@ -240,8 +302,11 @@ export interface WorkflowRun { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly lastRunAt?: Date; - /** Describes the status of the workflow run */ - workflowRunStatus?: WorkflowRunStatus; + /** + * Describes the status of the workflow run + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly workflowRunStatus?: WorkflowRunStatus; } /** Properties used for generating artifacts such as Dockerfiles and manifests. */ @@ -274,6 +339,73 @@ export interface ArtifactGenerationProperties { imageTag?: string; } +/** Azure Pipeline Profile */ +export interface AzurePipelineProfile { + /** Details of the ADO repository associated with the workflow. */ + repository?: ADORepository; + /** The name of the ARM Service Connection the pipeline is associated with. */ + armServiceConnection?: string; + /** Build details of the repository associated with the workflow. */ + build?: Build; + /** Deployment details of the repository associated with the workflow. */ + deployment?: Deployment; + /** Kubernetes namespace the application is deployed to. */ + namespace?: string; + /** Resource identifier for azure container registry repository associated with the workflow. */ + acr?: string; + /** The Azure Kubernetes Cluster Resource the application will be deployed to. */ + clusterId?: string; + /** Details of the pull request containing the workflow. */ + pullRequest?: PullRequest; + lastWorkflowRun?: WorkflowRun; + /** + * Determines the authorization status of requests. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly authStatus?: AuthorizationStatus; +} + +/** Details of the ADO repository associated with the workflow. */ +export interface ADORepository { + /** The owner of the repository the workflow is associated with. */ + repositoryOwner?: string; + /** The name of the repository the workflow is associated with. */ + repositoryName?: string; + /** The name of the branch the workflow is associated with. */ + branchName?: string; + /** The name of the Azure DevOps organization the pipeline is associated with. */ + adoOrganization?: string; + /** The name of the project the pipeline is associated with. */ + projectName?: string; +} + +/** Build details of the repository associated with the workflow. */ +export interface Build { + /** Path to the Dockerfile within the repository. */ + dockerfile?: string; + /** Path to Dockerfile Build Context within the repository. */ + dockerBuildContext?: string; +} + +/** Details of the pull request containing the workflow. */ +export interface PullRequest { + /** + * The URL to the Pull Request submitted against the users repository. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly prURL?: string; + /** + * 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; +} + /** delete response if content must be provided on delete operation */ export interface DeleteWorkflowResponse { /** delete status message */ @@ -286,6 +418,111 @@ export interface TagsObject { tags?: { [propertyName: string]: string }; } +/** ADOOAuth request object */ +export interface AdooAuthCallRequest { + /** The URL the client will redirect to on successful authentication. If empty, no redirect will occur. */ + redirectUrl?: string; +} + +/** Response containing ADO OAuth information */ +export interface AdooAuthInfoResponse { + /** URL used to authorize ADO app using Entra ID */ + authURL?: string; + /** OAuth token used to make calls to ADO APIs */ + token?: string; +} + +/** The properties of ADO OAuth. */ +export interface AdooAuth { + /** user making request */ + username?: string; +} + +/** The response from List ADOOAuth operation. */ +export interface AdooAuthListResponse { + /** Singleton list response containing one ADOOAuthResponse */ + value?: AdooAuthResponse[]; + /** + * The URL to the next set of ADO OAuth results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly 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; + scaleRequirement?: ScaleProperty[]; +} + +export interface ScaleProperty { + /** The region of the store */ + region?: string; + /** The stage of the store */ + stage?: string; + /** Number of the store */ + numberOfStore?: 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 {} @@ -299,62 +536,50 @@ export interface TrackedResource extends Resource { /** Singleton response of GitHubOAuth containing */ export interface GitHubOAuthResponse extends ProxyResource { - /** user making request */ - username?: string; + /** Properties of a workflow. */ + properties?: GitHubOAuthProperties; +} + +/** Singleton response of ADO OAuth. */ +export interface AdooAuthResponse extends ProxyResource { + /** Details of ADO OAuth. */ + properties?: AdooAuth; } /** Resource representation of a workflow */ export interface Workflow extends TrackedResource { - /** The programming language used. */ - generationLanguage?: GenerationLanguage; - /** The version of the language image used for execution in the generated dockerfile. */ - languageVersion?: string; - /** The version of the language image used for building the code in the generated dockerfile. */ - builderVersion?: string; - /** The port the application is exposed on. */ - port?: string; - /** The name of the app. */ - appName?: string; - /** The directory to output the generated Dockerfile to. */ - dockerfileOutputDirectory?: string; - /** The directory to output the generated manifests to. */ - manifestOutputDirectory?: string; - /** The mode of generation to be used for generating Dockerfiles. */ - dockerfileGenerationMode?: DockerfileGenerationMode; - /** The mode of generation to be used for generating Manifest. */ - manifestGenerationMode?: ManifestGenerationMode; - /** Determines the type of manifests to be generated. */ - manifestType?: GenerationManifestType; - /** The name of the image to be generated. */ - imageName?: string; - /** The namespace to deploy the application to. */ - namespacePropertiesArtifactGenerationPropertiesNamespace?: string; - /** The tag to apply to the generated image. */ - imageTag?: string; - /** Repository Owner */ - repositoryOwner?: string; + /** Properties of a workflow. */ + properties?: WorkflowProperties; +} + +/** 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 Branch Name */ - branchName?: string; - /** Path to the Dockerfile within the repository. */ - dockerfile?: string; - /** Path to Dockerfile Build Context within the repository. */ - dockerBuildContext?: string; - deploymentProperties?: DeploymentProperties; - /** Kubernetes namespace the application is deployed to. */ - namespacePropertiesGithubWorkflowProfileNamespace?: string; - /** Information on the azure container registry */ - acr?: Acr; - /** The fields needed for OIDC with GitHub. */ - oidcCredentials?: GitHubWorkflowProfileOidcCredentials; - /** The Azure Kubernetes Cluster Resource the application will be deployed to. */ - aksResourceId?: string; + /** Repository Main Branch */ + repositoryMainBranch?: string; + /** Repository Owner */ + repositoryOwner?: string; /** - * The URL to the Pull Request submitted against the users repository. + * Determines the authorization status of requests. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly prURL?: string; + 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. @@ -365,12 +590,8 @@ export interface Workflow extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly prStatus?: PullRequestStatus; - lastWorkflowRun?: WorkflowRun; - /** - * Determines the authorization status of requests. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly authStatus?: AuthorizationStatus; + /** Repository Branch Name */ + branchName?: string; } /** Known values of {@link Origin} that the service accepts. */ @@ -380,7 +601,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -397,7 +618,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -418,7 +639,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -438,7 +659,7 @@ export enum KnownManifestType { /** Repositories using helm */ Helm = "helm", /** Repositories using kubernetes manifests */ - Kube = "kube" + Kube = "kube", } /** @@ -460,7 +681,7 @@ export enum KnownPullRequestStatus { /** Pull Request merged into repository. */ Merged = "merged", /** Workflow no longer found within repository. */ - Removed = "removed" + Removed = "removed", } /** @@ -482,7 +703,7 @@ export enum KnownWorkflowRunStatus { /** Workflow run is inprogress */ Inprogress = "inprogress", /** Workflow run is completed */ - Completed = "completed" + Completed = "completed", } /** @@ -503,7 +724,7 @@ export enum KnownAuthorizationStatus { /** Requests returned NotFound response */ NotFound = "NotFound", /** Requests returned other error response */ - Error = "Error" + Error = "Error", } /** @@ -544,7 +765,7 @@ export enum KnownGenerationLanguage { /** rust language */ Rust = "rust", /** swift language */ - Swift = "swift" + Swift = "swift", } /** @@ -573,7 +794,7 @@ export enum KnownDockerfileGenerationMode { /** Dockerfiles will be generated */ Enabled = "enabled", /** Dockerfiles will not be generated */ - Disabled = "disabled" + Disabled = "disabled", } /** @@ -591,7 +812,7 @@ export enum KnownManifestGenerationMode { /** Manifests will be generated */ Enabled = "enabled", /** Manifests will not be generated */ - Disabled = "disabled" + Disabled = "disabled", } /** @@ -609,7 +830,7 @@ export enum KnownGenerationManifestType { /** Helm manifests */ Helm = "helm", /** Kubernetes manifests */ - Kube = "kube" + Kube = "kube", } /** @@ -622,6 +843,30 @@ 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", +} + +/** + * 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 + */ +export type QuickStartTemplateType = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -661,6 +906,16 @@ export type GeneratePreviewArtifactsResponse = { [propertyName: string]: string; }; +/** Optional parameters. */ +export interface GetAdooAuthInfoOptionalParams + extends coreClient.OperationOptions { + /** The fields required in ADO OAuth call request. */ + parameters?: AdooAuthCallRequest; +} + +/** Contains response data for the getAdooAuthInfo operation. */ +export type GetAdooAuthInfoResponse = AdooAuthInfoResponse; + /** Optional parameters. */ export interface WorkflowListOptionalParams extends coreClient.OperationOptions {} @@ -720,6 +975,98 @@ export interface WorkflowListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type WorkflowListByResourceGroupNextResponse = WorkflowListResult; +/** Optional parameters. */ +export interface AdooAuthGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AdooAuthGetResponse = AdooAuthResponse; + +/** Optional parameters. */ +export interface AdooAuthListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type AdooAuthListOperationResponse = AdooAuthListResponse; + +/** Optional parameters. */ +export interface AdooAuthListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type AdooAuthListNextResponse = AdooAuthListResponse; + +/** 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..ea808cf2a977 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,32 @@ export const GitHubOAuthInfoResponse: coreClient.CompositeMapper = { authURL: { serializedName: "authURL", type: { - name: "String" - } + name: "String", + }, }, token: { serializedName: "token", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, +}; + +export const GitHubOAuthProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GitHubOAuthProperties", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -259,32 +274,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 +310,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 +359,13 @@ export const GitHubOAuthListResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "GitHubOAuthResponse" - } - } - } - } - } - } + className: "GitHubOAuthResponse", + }, + }, + }, + }, + }, + }, }; export const WorkflowListResult: coreClient.CompositeMapper = { @@ -365,32 +380,169 @@ 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 WorkflowProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkflowProperties", + modelProperties: { + githubWorkflowProfile: { + serializedName: "githubWorkflowProfile", + type: { + name: "Composite", + className: "GitHubWorkflowProfile", + }, + }, + artifactGenerationProperties: { + serializedName: "artifactGenerationProperties", + type: { + name: "Composite", + className: "ArtifactGenerationProperties", + }, + }, + azurePipelineProfile: { + serializedName: "azurePipelineProfile", + type: { + name: "Composite", + className: "AzurePipelineProfile", + }, + }, + }, + }, }; -export const DeploymentProperties: coreClient.CompositeMapper = { +export const GitHubWorkflowProfile: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DeploymentProperties", + className: "GitHubWorkflowProfile", + modelProperties: { + repositoryOwner: { + serializedName: "repositoryOwner", + type: { + name: "String", + }, + }, + repositoryName: { + serializedName: "repositoryName", + type: { + name: "String", + }, + }, + branchName: { + serializedName: "branchName", + type: { + name: "String", + }, + }, + dockerfile: { + serializedName: "dockerfile", + type: { + name: "String", + }, + }, + dockerBuildContext: { + serializedName: "dockerBuildContext", + type: { + name: "String", + }, + }, + deploymentProperties: { + serializedName: "deploymentProperties", + type: { + name: "Composite", + className: "Deployment", + }, + }, + namespace: { + serializedName: "namespace", + type: { + name: "String", + }, + }, + acr: { + serializedName: "acr", + type: { + name: "Composite", + className: "Acr", + }, + }, + oidcCredentials: { + serializedName: "oidcCredentials", + type: { + name: "Composite", + className: "GitHubWorkflowProfileOidcCredentials", + }, + }, + aksResourceId: { + serializedName: "aksResourceId", + type: { + name: "String", + }, + }, + prURL: { + serializedName: "prURL", + readOnly: true, + type: { + name: "String", + }, + }, + pullNumber: { + serializedName: "pullNumber", + readOnly: true, + type: { + name: "Number", + }, + }, + prStatus: { + serializedName: "prStatus", + readOnly: true, + type: { + name: "String", + }, + }, + lastWorkflowRun: { + serializedName: "lastWorkflowRun", + type: { + name: "Composite", + className: "WorkflowRun", + }, + }, + authStatus: { + serializedName: "authStatus", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Deployment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Deployment", modelProperties: { manifestType: { serializedName: "manifestType", type: { - name: "String" - } + name: "String", + }, }, kubeManifestLocations: { serializedName: "kubeManifestLocations", @@ -398,32 +550,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 +586,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 +642,32 @@ 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", + readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ArtifactGenerationProperties: coreClient.CompositeMapper = { @@ -524,83 +678,248 @@ 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 AzurePipelineProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzurePipelineProfile", + modelProperties: { + repository: { + serializedName: "repository", + type: { + name: "Composite", + className: "ADORepository", + }, + }, + armServiceConnection: { + serializedName: "armServiceConnection", + type: { + name: "String", + }, + }, + build: { + serializedName: "build", + type: { + name: "Composite", + className: "Build", + }, + }, + deployment: { + serializedName: "deployment", + type: { + name: "Composite", + className: "Deployment", + }, + }, + namespace: { + serializedName: "namespace", + type: { + name: "String", + }, + }, + acr: { + serializedName: "acr", + type: { + name: "String", + }, + }, + clusterId: { + serializedName: "clusterId", + type: { + name: "String", + }, + }, + pullRequest: { + serializedName: "pullRequest", + type: { + name: "Composite", + className: "PullRequest", + }, + }, + lastWorkflowRun: { + serializedName: "lastWorkflowRun", + type: { + name: "Composite", + className: "WorkflowRun", + }, + }, + authStatus: { + serializedName: "authStatus", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ADORepository: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ADORepository", + modelProperties: { + repositoryOwner: { + serializedName: "repositoryOwner", + type: { + name: "String", + }, + }, + repositoryName: { + serializedName: "repositoryName", + type: { + name: "String", + }, + }, + branchName: { + serializedName: "branchName", + type: { + name: "String", + }, + }, + adoOrganization: { + serializedName: "adoOrganization", + type: { + name: "String", + }, + }, + projectName: { + serializedName: "projectName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Build: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Build", + modelProperties: { + dockerfile: { + serializedName: "dockerfile", + type: { + name: "String", + }, + }, + dockerBuildContext: { + serializedName: "dockerBuildContext", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PullRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PullRequest", + modelProperties: { + prURL: { + serializedName: "prURL", + readOnly: true, + type: { + name: "String", + }, + }, + pullNumber: { + serializedName: "pullNumber", + readOnly: true, + type: { + name: "Number", + }, + }, + prStatus: { + serializedName: "prStatus", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, }; export const DeleteWorkflowResponse: coreClient.CompositeMapper = { @@ -611,11 +930,11 @@ export const DeleteWorkflowResponse: coreClient.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const TagsObject: coreClient.CompositeMapper = { @@ -627,252 +946,537 @@ export const TagsObject: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } + value: { type: { name: "String" } }, + }, + }, + }, + }, }; -export const ProxyResource: coreClient.CompositeMapper = { +export const AdooAuthCallRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "AdooAuthCallRequest", modelProperties: { - ...Resource.type.modelProperties - } - } + redirectUrl: { + serializedName: "redirectUrl", + type: { + name: "String", + }, + }, + }, + }, }; -export const TrackedResource: coreClient.CompositeMapper = { +export const AdooAuthInfoResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "AdooAuthInfoResponse", modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + authURL: { + serializedName: "authURL", type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + name: "String", + }, }, - location: { - serializedName: "location", - required: true, + token: { + serializedName: "token", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const GitHubOAuthResponse: coreClient.CompositeMapper = { +export const AdooAuth: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GitHubOAuthResponse", + className: "AdooAuth", modelProperties: { - ...ProxyResource.type.modelProperties, username: { - serializedName: "properties.username", + serializedName: "username", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; -export const Workflow: coreClient.CompositeMapper = { +export const AdooAuthListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Workflow", + className: "AdooAuthListResponse", modelProperties: { - ...TrackedResource.type.modelProperties, - generationLanguage: { - serializedName: - "properties.artifactGenerationProperties.generationLanguage", + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AdooAuthResponse", + }, + }, + }, }, - languageVersion: { - serializedName: - "properties.artifactGenerationProperties.languageVersion", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - builderVersion: { - serializedName: - "properties.artifactGenerationProperties.builderVersion", + }, + }, +}; + +export const IacProfileListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacProfileListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IacProfile", + }, + }, + }, }, - port: { - serializedName: "properties.artifactGenerationProperties.port", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - appName: { - serializedName: "properties.artifactGenerationProperties.appName", + }, + }, +}; + +export const StageProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StageProperties", + modelProperties: { + stageName: { + serializedName: "stageName", type: { - name: "String" - } + name: "String", + }, }, - dockerfileOutputDirectory: { - serializedName: - "properties.artifactGenerationProperties.dockerfileOutputDirectory", + dependencies: { + serializedName: "dependencies", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - manifestOutputDirectory: { - serializedName: - "properties.artifactGenerationProperties.manifestOutputDirectory", + gitEnvironment: { + serializedName: "gitEnvironment", type: { - name: "String" - } + name: "String", + }, }, - dockerfileGenerationMode: { - serializedName: - "properties.artifactGenerationProperties.dockerfileGenerationMode", + }, + }, +}; + +export const IacTemplateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacTemplateProperties", + modelProperties: { + templateName: { + serializedName: "templateName", type: { - name: "String" - } + name: "String", + }, }, - manifestGenerationMode: { - serializedName: - "properties.artifactGenerationProperties.manifestGenerationMode", + sourceResourceId: { + serializedName: "sourceResourceId", type: { - name: "String" - } + name: "String", + }, }, - manifestType: { - serializedName: "properties.artifactGenerationProperties.manifestType", + instanceStage: { + serializedName: "instanceStage", type: { - name: "String" - } + name: "String", + }, }, - imageName: { - serializedName: "properties.artifactGenerationProperties.imageName", + instanceName: { + serializedName: "instanceName", type: { - name: "String" - } + name: "String", + }, }, - namespacePropertiesArtifactGenerationPropertiesNamespace: { - serializedName: "properties.artifactGenerationProperties.namespace", + templateDetails: { + serializedName: "templateDetails", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IacTemplateDetails", + }, + }, + }, }, - imageTag: { - serializedName: "properties.artifactGenerationProperties.imageTag", + quickStartTemplateType: { + serializedName: "quickStartTemplateType", + readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - repositoryOwner: { - serializedName: "properties.githubWorkflowProfile.repositoryOwner", + }, + }, +}; + +export const IacTemplateDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacTemplateDetails", + modelProperties: { + productName: { + serializedName: "productName", type: { - name: "String" - } + name: "String", + }, }, - repositoryName: { - serializedName: "properties.githubWorkflowProfile.repositoryName", + count: { + serializedName: "count", type: { - name: "String" - } + name: "Number", + }, }, - branchName: { - serializedName: "properties.githubWorkflowProfile.branchName", + namingConvention: { + serializedName: "namingConvention", type: { - name: "String" - } + name: "String", + }, }, - dockerfile: { - serializedName: "properties.githubWorkflowProfile.dockerfile", + }, + }, +}; + +export const ExportTemplateRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExportTemplateRequest", + modelProperties: { + templateName: { + serializedName: "templateName", type: { - name: "String" - } + name: "String", + }, }, - dockerBuildContext: { - serializedName: "properties.githubWorkflowProfile.dockerBuildContext", + resourceGroupIds: { + serializedName: "resourceGroupIds", type: { - name: "String" - } + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, }, - deploymentProperties: { - serializedName: "properties.githubWorkflowProfile.deploymentProperties", + siteId: { + serializedName: "siteId", type: { - name: "Composite", - className: "DeploymentProperties" - } + name: "String", + }, }, - namespacePropertiesGithubWorkflowProfileNamespace: { - serializedName: "properties.githubWorkflowProfile.namespace", + instanceName: { + serializedName: "instanceName", type: { - name: "String" - } + name: "String", + }, }, - acr: { - serializedName: "properties.githubWorkflowProfile.acr", + 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", + }, + }, + scaleRequirement: { + serializedName: "scaleRequirement", + 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", + }, + }, + numberOfStore: { + serializedName: "numberOfStore", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const GitHubOAuthResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GitHubOAuthResponse", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "Acr" - } + className: "GitHubOAuthProperties", + }, }, - oidcCredentials: { - serializedName: "properties.githubWorkflowProfile.oidcCredentials", + }, + }, +}; + +export const AdooAuthResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AdooAuthResponse", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", type: { name: "Composite", - className: "GitHubWorkflowProfileOidcCredentials" - } + className: "AdooAuth", + }, }, - aksResourceId: { - serializedName: "properties.githubWorkflowProfile.aksResourceId", + }, + }, +}; + +export const Workflow: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workflow", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", type: { - name: "String" - } + name: "Composite", + className: "WorkflowProperties", + }, }, - prURL: { - serializedName: "properties.githubWorkflowProfile.prURL", + }, + }, +}; + +export const IacProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IacProfile", + modelProperties: { + ...TrackedResource.type.modelProperties, + etag: { + serializedName: "etag", readOnly: true, type: { - name: "String" - } + 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.githubWorkflowProfile.pullNumber", + serializedName: "properties.githubProfile.pullNumber", readOnly: true, type: { - name: "Number" - } + name: "Number", + }, }, prStatus: { - serializedName: "properties.githubWorkflowProfile.prStatus", + serializedName: "properties.githubProfile.prStatus", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, - lastWorkflowRun: { - serializedName: "properties.githubWorkflowProfile.lastWorkflowRun", + branchName: { + serializedName: "properties.githubProfile.branchName", type: { - name: "Composite", - className: "WorkflowRun" - } + name: "String", + }, }, - authStatus: { - serializedName: "properties.githubWorkflowProfile.authStatus", - readOnly: true, - 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..5642dfff57f2 100644 --- a/sdk/devhub/arm-devhub/src/models/parameters.ts +++ b/sdk/devhub/arm-devhub/src/models/parameters.ts @@ -9,13 +9,17 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { GitHubOAuthCallRequest as GitHubOAuthCallRequestMapper, ArtifactGenerationProperties as ArtifactGenerationPropertiesMapper, + AdooAuthCallRequest as AdooAuthCallRequestMapper, 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 +29,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -36,22 +40,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-08-01-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const contentType: OperationParameter = { @@ -61,42 +65,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 +106,9 @@ export const code: OperationQueryParameter = { serializedName: "code", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; export const state: OperationQueryParameter = { @@ -116,14 +117,19 @@ 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 parameters2: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: AdooAuthCallRequestMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -131,14 +137,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 +152,9 @@ export const managedClusterResource: OperationQueryParameter = { mapper: { serializedName: "managedClusterResource", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const workflowName: OperationURLParameter = { @@ -156,27 +162,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 = { +export const parameters3: OperationParameter = { parameterPath: "parameters", - mapper: WorkflowMapper + mapper: WorkflowMapper, }; -export const parameters3: OperationParameter = { +export const parameters4: OperationParameter = { parameterPath: "parameters", - mapper: TagsObjectMapper + mapper: TagsObjectMapper, }; export const nextLink: OperationURLParameter = { @@ -185,8 +191,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 parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: IacProfileMapper, +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: ExportTemplateRequestMapper, +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: ScaleTemplateRequestMapper, }; diff --git a/sdk/devhub/arm-devhub/src/operations/adooAuthOperations.ts b/sdk/devhub/arm-devhub/src/operations/adooAuthOperations.ts new file mode 100644 index 000000000000..48d6ec245386 --- /dev/null +++ b/sdk/devhub/arm-devhub/src/operations/adooAuthOperations.ts @@ -0,0 +1,206 @@ +/* + * 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 { AdooAuthOperations } 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 { + AdooAuthResponse, + AdooAuthListNextOptionalParams, + AdooAuthListOptionalParams, + AdooAuthListOperationResponse, + AdooAuthGetOptionalParams, + AdooAuthGetResponse, + AdooAuthListNextResponse, +} from "../models"; + +/// +/** Class containing AdooAuthOperations operations. */ +export class AdooAuthOperationsImpl implements AdooAuthOperations { + private readonly client: DeveloperHubServiceClient; + + /** + * Initialize a new instance of the class AdooAuthOperations class. + * @param client Reference to the service client + */ + constructor(client: DeveloperHubServiceClient) { + this.client = client; + } + + /** + * Callback URL to hit once authenticated with ADO to have the service store the OAuth token. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + public list( + location: string, + options?: AdooAuthListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, 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(location, options, settings); + }, + }; + } + + private async *listPagingPage( + location: string, + options?: AdooAuthListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: AdooAuthListOperationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(location, continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + location: string, + options?: AdooAuthListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * Callback URL to hit once authenticated with Entra ID to have the service store the OAuth token. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + get( + location: string, + options?: AdooAuthGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + getOperationSpec, + ); + } + + /** + * Callback URL to hit once authenticated with ADO to have the service store the OAuth token. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + private _list( + location: string, + options?: AdooAuthListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param location The name of the Azure region. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + nextLink: string, + options?: AdooAuthListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { location, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/adooauth/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AdooAuthResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevHub/locations/{location}/adooauth", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AdooAuthListResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AdooAuthListResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; 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..53434ae076f0 --- /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.parameters5, + 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.parameters4, + 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.parameters6, + 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.parameters7, + 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..257d1dade54e 100644 --- a/sdk/devhub/arm-devhub/src/operations/index.ts +++ b/sdk/devhub/arm-devhub/src/operations/index.ts @@ -8,3 +8,5 @@ export * from "./operations"; export * from "./workflowOperations"; +export * from "./adooAuthOperations"; +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..d1096fac0dae 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,170 +307,165 @@ 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, + requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [ 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, + requestBody: Parameters.parameters4, queryParameters: [Parameters.apiVersion], urlParameters: [ 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/adooAuthOperations.ts b/sdk/devhub/arm-devhub/src/operationsInterfaces/adooAuthOperations.ts new file mode 100644 index 000000000000..ab8b2b2ade6c --- /dev/null +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/adooAuthOperations.ts @@ -0,0 +1,38 @@ +/* + * 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 { + AdooAuthResponse, + AdooAuthListOptionalParams, + AdooAuthGetOptionalParams, + AdooAuthGetResponse, +} from "../models"; + +/// +/** Interface representing a AdooAuthOperations. */ +export interface AdooAuthOperations { + /** + * Callback URL to hit once authenticated with ADO to have the service store the OAuth token. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + list( + location: string, + options?: AdooAuthListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Callback URL to hit once authenticated with Entra ID to have the service store the OAuth token. + * @param location The name of the Azure region. + * @param options The options parameters. + */ + get( + location: string, + options?: AdooAuthGetOptionalParams, + ): Promise; +} 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..257d1dade54e 100644 --- a/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts +++ b/sdk/devhub/arm-devhub/src/operationsInterfaces/index.ts @@ -8,3 +8,5 @@ export * from "./operations"; export * from "./workflowOperations"; +export * from "./adooAuthOperations"; +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"