diff --git a/sdk/containerregistry/arm-containerregistry/CHANGELOG.md b/sdk/containerregistry/arm-containerregistry/CHANGELOG.md index df1519e16334..c30127558bf5 100644 --- a/sdk/containerregistry/arm-containerregistry/CHANGELOG.md +++ b/sdk/containerregistry/arm-containerregistry/CHANGELOG.md @@ -1,15 +1,68 @@ # Release History + +## 11.0.0-beta.1 (2023-08-09) + +**Features** -## 10.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group CacheRules + - Added operation group CredentialSets + - Added Interface AuthCredential + - Added Interface CacheRule + - Added Interface CacheRulesCreateHeaders + - Added Interface CacheRulesCreateOptionalParams + - Added Interface CacheRulesDeleteHeaders + - Added Interface CacheRulesDeleteOptionalParams + - Added Interface CacheRulesGetOptionalParams + - Added Interface CacheRulesListNextOptionalParams + - Added Interface CacheRulesListOptionalParams + - Added Interface CacheRulesListResult + - Added Interface CacheRulesUpdateHeaders + - Added Interface CacheRulesUpdateOptionalParams + - Added Interface CacheRuleUpdateParameters + - Added Interface CredentialHealth + - Added Interface CredentialSet + - Added Interface CredentialSetListResult + - Added Interface CredentialSetsCreateHeaders + - Added Interface CredentialSetsCreateOptionalParams + - Added Interface CredentialSetsDeleteHeaders + - Added Interface CredentialSetsDeleteOptionalParams + - Added Interface CredentialSetsGetOptionalParams + - Added Interface CredentialSetsListNextOptionalParams + - Added Interface CredentialSetsListOptionalParams + - Added Interface CredentialSetsUpdateHeaders + - Added Interface CredentialSetsUpdateOptionalParams + - Added Interface CredentialSetUpdateParameters + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorResponseAutoGenerated + - Added Interface IdentityPropertiesAutoGenerated + - Added Interface UserIdentityPropertiesAutoGenerated + - Added Type Alias CacheRulesCreateResponse + - Added Type Alias CacheRulesDeleteResponse + - Added Type Alias CacheRulesGetResponse + - Added Type Alias CacheRulesListNextResponse + - Added Type Alias CacheRulesListResponse + - Added Type Alias CacheRulesUpdateResponse + - Added Type Alias CredentialHealthStatus + - Added Type Alias CredentialName + - Added Type Alias CredentialSetsCreateResponse + - Added Type Alias CredentialSetsDeleteResponse + - Added Type Alias CredentialSetsGetResponse + - Added Type Alias CredentialSetsListNextResponse + - Added Type Alias CredentialSetsListResponse + - Added Type Alias CredentialSetsUpdateResponse + - Added Enum KnownCredentialHealthStatus + - Added Enum KnownCredentialName -### Other Changes +**Breaking Changes** + - Type of parameter error of interface ErrorResponse is changed from ErrorResponseBody to ErrorDetail + - Type of parameter identity of interface Task is changed from IdentityProperties to IdentityPropertiesAutoGenerated + - Type of parameter identity of interface TaskRun is changed from IdentityProperties to IdentityPropertiesAutoGenerated + - Type of parameter identity of interface TaskRunUpdateParameters is changed from IdentityProperties to IdentityPropertiesAutoGenerated + - Type of parameter identity of interface TaskUpdateParameters is changed from IdentityProperties to IdentityPropertiesAutoGenerated + + ## 10.1.0 (2023-03-21) **Features** diff --git a/sdk/containerregistry/arm-containerregistry/README.md b/sdk/containerregistry/arm-containerregistry/README.md index 80150a6ae8ac..d33f73c6a797 100644 --- a/sdk/containerregistry/arm-containerregistry/README.md +++ b/sdk/containerregistry/arm-containerregistry/README.md @@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerregistry/arm-containerregistry) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-containerregistry) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerregistry) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerregistry?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/containerregistry/arm-containerregistry/_meta.json b/sdk/containerregistry/arm-containerregistry/_meta.json index 7b00b971d697..cc088cfec8ba 100644 --- a/sdk/containerregistry/arm-containerregistry/_meta.json +++ b/sdk/containerregistry/arm-containerregistry/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ddcde53422ff186f5b69fb32338ecac3d11c3bca", + "commit": "38dc1ed30fb82657a02c95cc762f716c2ac36f0e", "readme": "specification/containerregistry/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerregistry\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.10 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.10" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/containerregistry/arm-containerregistry/package.json b/sdk/containerregistry/arm-containerregistry/package.json index a7661a17b32a..8c5ae5c2c6a0 100644 --- a/sdk/containerregistry/arm-containerregistry/package.json +++ b/sdk/containerregistry/arm-containerregistry/package.json @@ -3,12 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerRegistryManagementClient.", - "version": "10.1.1", + "version": "11.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerregistry/arm-containerregistry", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerregistry?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerregistry/arm-containerregistry" +} \ No newline at end of file diff --git a/sdk/containerregistry/arm-containerregistry/review/arm-containerregistry.api.md b/sdk/containerregistry/arm-containerregistry/review/arm-containerregistry.api.md index 9de776fdab9c..a1162d13e539 100644 --- a/sdk/containerregistry/arm-containerregistry/review/arm-containerregistry.api.md +++ b/sdk/containerregistry/arm-containerregistry/review/arm-containerregistry.api.md @@ -135,6 +135,14 @@ export interface Argument { value: string; } +// @public +export interface AuthCredential { + readonly credentialHealth?: CredentialHealth; + name?: CredentialName; + passwordSecretIdentifier?: string; + usernameSecretIdentifier?: string; +} + // @public export interface AuthInfo { expiresIn?: number; @@ -186,6 +194,104 @@ export interface BaseImageTriggerUpdateParameters { updateTriggerPayloadType?: UpdateTriggerPayloadType; } +// @public +export interface CacheRule extends ProxyResource { + readonly creationDate?: Date; + credentialSetResourceId?: string; + readonly provisioningState?: ProvisioningState; + sourceRepository?: string; + targetRepository?: string; +} + +// @public +export interface CacheRules { + beginCreate(resourceGroupName: string, registryName: string, cacheRuleName: string, cacheRuleCreateParameters: CacheRule, options?: CacheRulesCreateOptionalParams): Promise, CacheRulesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, registryName: string, cacheRuleName: string, cacheRuleCreateParameters: CacheRule, options?: CacheRulesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, registryName: string, cacheRuleName: string, options?: CacheRulesDeleteOptionalParams): Promise, CacheRulesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, registryName: string, cacheRuleName: string, options?: CacheRulesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, registryName: string, cacheRuleName: string, cacheRuleUpdateParameters: CacheRuleUpdateParameters, options?: CacheRulesUpdateOptionalParams): Promise, CacheRulesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, registryName: string, cacheRuleName: string, cacheRuleUpdateParameters: CacheRuleUpdateParameters, options?: CacheRulesUpdateOptionalParams): Promise; + get(resourceGroupName: string, registryName: string, cacheRuleName: string, options?: CacheRulesGetOptionalParams): Promise; + list(resourceGroupName: string, registryName: string, options?: CacheRulesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CacheRulesCreateHeaders { + // (undocumented) + azureAsyncOperation?: string; +} + +// @public +export interface CacheRulesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CacheRulesCreateResponse = CacheRule; + +// @public +export interface CacheRulesDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface CacheRulesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CacheRulesDeleteResponse = CacheRulesDeleteHeaders; + +// @public +export interface CacheRulesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CacheRulesGetResponse = CacheRule; + +// @public +export interface CacheRulesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CacheRulesListNextResponse = CacheRulesListResult; + +// @public +export interface CacheRulesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CacheRulesListResponse = CacheRulesListResult; + +// @public +export interface CacheRulesListResult { + nextLink?: string; + value?: CacheRule[]; +} + +// @public +export interface CacheRulesUpdateHeaders { + // (undocumented) + azureAsyncOperation?: string; +} + +// @public +export interface CacheRulesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CacheRulesUpdateResponse = CacheRule; + +// @public +export interface CacheRuleUpdateParameters { + credentialSetResourceId?: string; +} + // @public export interface CallbackConfig { customHeaders?: { @@ -205,6 +311,10 @@ export class ContainerRegistryManagementClient extends coreClient.ServiceClient // (undocumented) agentPools: AgentPools; // (undocumented) + cacheRules: CacheRules; + // (undocumented) + credentialSets: CredentialSets; + // (undocumented) operations: Operations; // (undocumented) privateEndpointConnections: PrivateEndpointConnections; @@ -237,6 +347,19 @@ export interface ContainerRegistryManagementClientOptionalParams extends coreCli // @public export type CreatedByType = string; +// @public +export interface CredentialHealth { + errorCode?: string; + errorMessage?: string; + status?: CredentialHealthStatus; +} + +// @public +export type CredentialHealthStatus = string; + +// @public +export type CredentialName = string; + // @public export interface Credentials { customRegistries?: { @@ -245,6 +368,105 @@ export interface Credentials { sourceRegistry?: SourceRegistryCredentials; } +// @public +export interface CredentialSet extends ProxyResource { + authCredentials?: AuthCredential[]; + readonly creationDate?: Date; + identity?: IdentityProperties; + loginServer?: string; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface CredentialSetListResult { + nextLink?: string; + value?: CredentialSet[]; +} + +// @public +export interface CredentialSets { + beginCreate(resourceGroupName: string, registryName: string, credentialSetName: string, credentialSetCreateParameters: CredentialSet, options?: CredentialSetsCreateOptionalParams): Promise, CredentialSetsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, registryName: string, credentialSetName: string, credentialSetCreateParameters: CredentialSet, options?: CredentialSetsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, registryName: string, credentialSetName: string, options?: CredentialSetsDeleteOptionalParams): Promise, CredentialSetsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, registryName: string, credentialSetName: string, options?: CredentialSetsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, registryName: string, credentialSetName: string, credentialSetUpdateParameters: CredentialSetUpdateParameters, options?: CredentialSetsUpdateOptionalParams): Promise, CredentialSetsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, registryName: string, credentialSetName: string, credentialSetUpdateParameters: CredentialSetUpdateParameters, options?: CredentialSetsUpdateOptionalParams): Promise; + get(resourceGroupName: string, registryName: string, credentialSetName: string, options?: CredentialSetsGetOptionalParams): Promise; + list(resourceGroupName: string, registryName: string, options?: CredentialSetsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CredentialSetsCreateHeaders { + // (undocumented) + azureAsyncOperation?: string; +} + +// @public +export interface CredentialSetsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CredentialSetsCreateResponse = CredentialSet; + +// @public +export interface CredentialSetsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface CredentialSetsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CredentialSetsDeleteResponse = CredentialSetsDeleteHeaders; + +// @public +export interface CredentialSetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CredentialSetsGetResponse = CredentialSet; + +// @public +export interface CredentialSetsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CredentialSetsListNextResponse = CredentialSetListResult; + +// @public +export interface CredentialSetsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CredentialSetsListResponse = CredentialSetListResult; + +// @public +export interface CredentialSetsUpdateHeaders { + // (undocumented) + azureAsyncOperation?: string; +} + +// @public +export interface CredentialSetsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CredentialSetsUpdateResponse = CredentialSet; + +// @public +export interface CredentialSetUpdateParameters { + authCredentials?: AuthCredential[]; + identity?: IdentityProperties; +} + // @public export interface CustomRegistryCredentials { identity?: string; @@ -331,8 +553,28 @@ export interface EncryptionProperty { // @public export type EncryptionStatus = string; +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ErrorResponseAutoGenerated { error?: ErrorResponseBody; } @@ -450,11 +692,21 @@ export function getContinuationToken(page: unknown): string | undefined; // @public export interface IdentityProperties { + readonly principalId?: string; + readonly tenantId?: string; + type?: ResourceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserIdentityProperties; + }; +} + +// @public +export interface IdentityPropertiesAutoGenerated { principalId?: string; tenantId?: string; type?: ResourceIdentityType; userAssignedIdentities?: { - [propertyName: string]: UserIdentityProperties; + [propertyName: string]: UserIdentityPropertiesAutoGenerated; }; } @@ -568,6 +820,17 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownCredentialHealthStatus { + Healthy = "Healthy", + Unhealthy = "Unhealthy" +} + +// @public +export enum KnownCredentialName { + Credential1 = "Credential1" +} + // @public export enum KnownDefaultAction { Allow = "Allow", @@ -1802,7 +2065,7 @@ export interface Task extends Resource { agentPoolName?: string; readonly creationDate?: Date; credentials?: Credentials; - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; isSystemTask?: boolean; logTemplate?: string; platform?: PlatformProperties; @@ -1822,7 +2085,7 @@ export interface TaskListResult { // @public export interface TaskRun extends ProxyResource { forceUpdateTag?: string; - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; location?: string; readonly provisioningState?: ProvisioningState; runRequest?: RunRequestUnion; @@ -1910,7 +2173,7 @@ export type TaskRunsUpdateResponse = TaskRun; // @public export interface TaskRunUpdateParameters { forceUpdateTag?: string; - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; location?: string; runRequest?: RunRequestUnion; tags?: { @@ -2012,7 +2275,7 @@ export interface TaskUpdateParameters { agentConfiguration?: AgentProperties; agentPoolName?: string; credentials?: Credentials; - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; logTemplate?: string; platform?: PlatformUpdateParameters; status?: TaskStatus; @@ -2209,6 +2472,12 @@ export type UpdateTriggerPayloadType = string; // @public (undocumented) export interface UserIdentityProperties { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public (undocumented) +export interface UserIdentityPropertiesAutoGenerated { clientId?: string; principalId?: string; } diff --git a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts index 9dbee0188530..d3f18d40ca26 100644 --- a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts +++ b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts @@ -10,6 +10,8 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + CacheRulesImpl, + CredentialSetsImpl, RegistriesImpl, OperationsImpl, PrivateEndpointConnectionsImpl, @@ -23,6 +25,8 @@ import { TasksImpl } from "./operations"; import { + CacheRules, + CredentialSets, Registries, Operations, PrivateEndpointConnections, @@ -68,7 +72,7 @@ export class ContainerRegistryManagementClient extends coreClient.ServiceClient credential: credentials }; - const packageDetails = `azsdk-js-arm-containerregistry/10.1.1`; + const packageDetails = `azsdk-js-arm-containerregistry/11.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -121,6 +125,8 @@ export class ContainerRegistryManagementClient extends coreClient.ServiceClient // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.cacheRules = new CacheRulesImpl(this); + this.credentialSets = new CredentialSetsImpl(this); this.registries = new RegistriesImpl(this); this.operations = new OperationsImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); @@ -134,6 +140,8 @@ export class ContainerRegistryManagementClient extends coreClient.ServiceClient this.tasks = new TasksImpl(this); } + cacheRules: CacheRules; + credentialSets: CredentialSets; registries: Registries; operations: Operations; privateEndpointConnections: PrivateEndpointConnections; diff --git a/sdk/containerregistry/arm-containerregistry/src/models/index.ts b/sdk/containerregistry/arm-containerregistry/src/models/index.ts index a5d259413c81..9a43eaac1be4 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/index.ts @@ -25,6 +25,189 @@ export type TaskStepUpdateParametersUnion = | FileTaskStepUpdateParameters | EncodedTaskStepUpdateParameters; +/** The result of a request to list cache rules for a container registry. */ +export interface CacheRulesListResult { + /** The list of cache rules. */ + value?: CacheRule[]; + /** If provided, client must use NextLink URI to request next list of cache rules. */ + nextLink?: string; +} + +/** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. */ +export interface ProxyResource { + /** + * The resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: LastModifiedByType; + /** The timestamp of resource modification (UTC). */ + lastModifiedAt?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The parameters for updating a cache rule. */ +export interface CacheRuleUpdateParameters { + /** The ARM resource ID of the credential store which is associated with the Cache rule. */ + credentialSetResourceId?: string; +} + +/** The result of a request to list credential sets for a container registry. */ +export interface CredentialSetListResult { + /** The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list of credential sets. */ + value?: CredentialSet[]; + /** The URI that can be used to request the next list of credential sets. */ + nextLink?: string; +} + +/** Managed identity for the resource. */ +export interface IdentityProperties { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityType; + /** + * The list of user identities associated with the resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties }; +} + +export interface UserIdentityProperties { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** Authentication credential stored for an upstream. */ +export interface AuthCredential { + /** The name of the credential. */ + name?: CredentialName; + /** KeyVault Secret URI for accessing the username. */ + usernameSecretIdentifier?: string; + /** KeyVault Secret URI for accessing the password. */ + passwordSecretIdentifier?: string; + /** + * This provides data pertaining to the health of the auth credential. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly credentialHealth?: CredentialHealth; +} + +/** The health of the auth credential. */ +export interface CredentialHealth { + /** The health status of credential. */ + status?: CredentialHealthStatus; + /** Error code representing the health check error. */ + errorCode?: string; + /** Descriptive message representing the health check error. */ + errorMessage?: string; +} + +/** The parameters for updating a credential set */ +export interface CredentialSetUpdateParameters { + /** Identities associated with the resource. This is used to access the KeyVault secrets. */ + identity?: IdentityProperties; + /** + * List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential. + */ + authCredentials?: AuthCredential[]; +} + export interface ImportImageParameters { /** The source of the image. */ source: ImportSource; @@ -172,46 +355,6 @@ export interface PrivateLinkServiceConnectionState { actionsRequired?: ActionsRequired; } -/** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. */ -export interface ProxyResource { - /** - * The resource ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Metadata pertaining to creation and last modification of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: LastModifiedByType; - /** The timestamp of resource modification (UTC). */ - lastModifiedAt?: Date; -} - /** The result of a request to list container registries. */ export interface RegistryListResult { /** The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next list of container registries. */ @@ -231,30 +374,6 @@ export interface Sku { readonly tier?: SkuTier; } -/** Managed identity for the resource. */ -export interface IdentityProperties { - /** The principal ID of resource identity. */ - principalId?: string; - /** The tenant ID of resource. */ - tenantId?: string; - /** The identity type. */ - type?: ResourceIdentityType; - /** - * The list of user identities associated with the resource. The user identity - * dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties }; -} - -export interface UserIdentityProperties { - /** The principal id of user assigned identity. */ - principalId?: string; - /** The client id of user assigned identity. */ - clientId?: string; -} - /** The status of an Azure resource at the time the operation was called. */ export interface Status { /** @@ -461,34 +580,6 @@ export interface PrivateLinkResource { requiredZoneNames?: string[]; } -/** An error response from the Azure Container Registry service. */ -export interface ErrorResponse { - /** Azure container registry build API error body. */ - error?: ErrorResponseBody; -} - -/** An error response from the Azure Container Registry service. */ -export interface ErrorResponseBody { - /** error code. */ - code: string; - /** error message. */ - message: string; - /** target of the particular error. */ - target?: string; - /** an array of additional nested error response info objects, as described by this contract. */ - details?: InnerErrorDescription[]; -} - -/** inner error. */ -export interface InnerErrorDescription { - /** error code. */ - code: string; - /** error message. */ - message: string; - /** target of the particular error. */ - target?: string; -} - /** The response from the ListCredentials operation. */ export interface RegistryListCredentialsResult { /** The username for a container registry. */ @@ -775,6 +866,34 @@ export interface CallbackConfig { customHeaders?: { [propertyName: string]: string }; } +/** An error response from the Azure Container Registry service. */ +export interface ErrorResponseAutoGenerated { + /** Azure container registry build API error body. */ + error?: ErrorResponseBody; +} + +/** An error response from the Azure Container Registry service. */ +export interface ErrorResponseBody { + /** error code. */ + code: string; + /** error message. */ + message: string; + /** target of the particular error. */ + target?: string; + /** an array of additional nested error response info objects, as described by this contract. */ + details?: InnerErrorDescription[]; +} + +/** inner error. */ +export interface InnerErrorDescription { + /** error code. */ + code: string; + /** error message. */ + message: string; + /** target of the particular error. */ + target?: string; +} + /** The parameters for updating an agent pool. */ export interface AgentPoolUpdateParameters { /** The ARM resource tags. */ @@ -906,10 +1025,36 @@ export interface RunGetLogResult { logArtifactLink?: string; } +/** Managed identity for the resource. */ +export interface IdentityPropertiesAutoGenerated { + /** The principal ID of resource identity. */ + principalId?: string; + /** The tenant ID of resource. */ + tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityType; + /** + * The list of user identities associated with the resource. The user identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { + [propertyName: string]: UserIdentityPropertiesAutoGenerated; + }; +} + +export interface UserIdentityPropertiesAutoGenerated { + /** The principal id of user assigned identity. */ + principalId?: string; + /** The client id of user assigned identity. */ + clientId?: string; +} + /** The parameters for updating a task run. */ export interface TaskRunUpdateParameters { /** Identity for the resource. */ - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; /** The location of the resource */ location?: string; /** The ARM resource tags. */ @@ -1099,7 +1244,7 @@ export interface SecretObject { /** The parameters for updating a task. */ export interface TaskUpdateParameters { /** Identity for the resource. */ - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; /** The ARM resource tags. */ tags?: { [propertyName: string]: string }; /** The current status of task. */ @@ -1293,16 +1438,62 @@ export interface OverrideTaskStepProperties { /** The file against which run has to be queued. */ file?: string; /** - * Gets or sets the collection of override arguments to be used when - * executing a build step. + * Gets or sets the collection of override arguments to be used when + * executing a build step. + */ + arguments?: Argument[]; + /** The name of the target build stage for the docker build. */ + target?: string; + /** The collection of overridable values that can be passed when running a Task. */ + values?: SetValue[]; + /** Base64 encoded update trigger token that will be attached with the base image trigger webhook. */ + updateTriggerToken?: string; +} + +/** An object that represents a cache rule for a container registry. */ +export interface CacheRule extends ProxyResource { + /** The ARM resource ID of the credential store which is associated with the cache rule. */ + credentialSetResourceId?: string; + /** Source repository pulled from upstream. */ + sourceRepository?: string; + /** + * Target repository specified in docker pull command. + * Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + */ + targetRepository?: string; + /** + * The creation date of the cache rule. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationDate?: Date; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** An object that represents a credential set resource for a container registry. */ +export interface CredentialSet extends ProxyResource { + /** Identities associated with the resource. This is used to access the KeyVault secrets. */ + identity?: IdentityProperties; + /** The credentials are stored for this upstream or login server. */ + loginServer?: string; + /** + * List of authentication credentials stored for an upstream. + * Usually consists of a primary and an optional secondary credential. + */ + authCredentials?: AuthCredential[]; + /** + * The creation date of credential store resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creationDate?: Date; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - arguments?: Argument[]; - /** The name of the target build stage for the docker build. */ - target?: string; - /** The collection of overridable values that can be passed when running a Task. */ - values?: SetValue[]; - /** Base64 encoded update trigger token that will be attached with the base image trigger webhook. */ - updateTriggerToken?: string; + readonly provisioningState?: ProvisioningState; } /** An object that represents a private endpoint connection for a container registry. */ @@ -1425,7 +1616,7 @@ export interface Run extends ProxyResource { */ export interface TaskRun extends ProxyResource { /** Identity for the resource. */ - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; /** The location of the resource */ location?: string; /** @@ -1557,7 +1748,7 @@ export interface AgentPool extends Resource { */ export interface Task extends Resource { /** Identity for the resource. */ - identity?: IdentityProperties; + identity?: IdentityPropertiesAutoGenerated; /** * The provisioning state of the task. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1775,6 +1966,36 @@ export interface EncodedTaskStepUpdateParameters values?: SetValue[]; } +/** Defines headers for CacheRules_create operation. */ +export interface CacheRulesCreateHeaders { + azureAsyncOperation?: string; +} + +/** Defines headers for CacheRules_delete operation. */ +export interface CacheRulesDeleteHeaders { + location?: string; +} + +/** Defines headers for CacheRules_update operation. */ +export interface CacheRulesUpdateHeaders { + azureAsyncOperation?: string; +} + +/** Defines headers for CredentialSets_create operation. */ +export interface CredentialSetsCreateHeaders { + azureAsyncOperation?: string; +} + +/** Defines headers for CredentialSets_delete operation. */ +export interface CredentialSetsDeleteHeaders { + location?: string; +} + +/** Defines headers for CredentialSets_update operation. */ +export interface CredentialSetsUpdateHeaders { + azureAsyncOperation?: string; +} + /** Defines headers for Registries_importImage operation. */ export interface RegistriesImportImageHeaders { location?: string; @@ -1870,66 +2091,6 @@ export interface WebhooksUpdateHeaders { azureAsyncOperation?: string; } -/** Known values of {@link ImportMode} that the service accepts. */ -export enum KnownImportMode { - /** NoForce */ - NoForce = "NoForce", - /** Force */ - Force = "Force" -} - -/** - * Defines values for ImportMode. \ - * {@link KnownImportMode} can be used interchangeably with ImportMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NoForce** \ - * **Force** - */ -export type ImportMode = string; - -/** Known values of {@link ConnectionStatus} that the service accepts. */ -export enum KnownConnectionStatus { - /** Approved */ - Approved = "Approved", - /** Pending */ - Pending = "Pending", - /** Rejected */ - Rejected = "Rejected", - /** Disconnected */ - Disconnected = "Disconnected" -} - -/** - * Defines values for ConnectionStatus. \ - * {@link KnownConnectionStatus} can be used interchangeably with ConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Approved** \ - * **Pending** \ - * **Rejected** \ - * **Disconnected** - */ -export type ConnectionStatus = string; - -/** Known values of {@link ActionsRequired} that the service accepts. */ -export enum KnownActionsRequired { - /** None */ - None = "None", - /** Recreate */ - Recreate = "Recreate" -} - -/** - * Defines values for ActionsRequired. \ - * {@link KnownActionsRequired} can be used interchangeably with ActionsRequired, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **Recreate** - */ -export type ActionsRequired = string; - /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { /** Creating */ @@ -2008,6 +2169,99 @@ export enum KnownLastModifiedByType { */ export type LastModifiedByType = string; +/** Known values of {@link CredentialName} that the service accepts. */ +export enum KnownCredentialName { + /** Credential1 */ + Credential1 = "Credential1" +} + +/** + * Defines values for CredentialName. \ + * {@link KnownCredentialName} can be used interchangeably with CredentialName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Credential1** + */ +export type CredentialName = string; + +/** Known values of {@link CredentialHealthStatus} that the service accepts. */ +export enum KnownCredentialHealthStatus { + /** Healthy */ + Healthy = "Healthy", + /** Unhealthy */ + Unhealthy = "Unhealthy" +} + +/** + * Defines values for CredentialHealthStatus. \ + * {@link KnownCredentialHealthStatus} can be used interchangeably with CredentialHealthStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Healthy** \ + * **Unhealthy** + */ +export type CredentialHealthStatus = string; + +/** Known values of {@link ImportMode} that the service accepts. */ +export enum KnownImportMode { + /** NoForce */ + NoForce = "NoForce", + /** Force */ + Force = "Force" +} + +/** + * Defines values for ImportMode. \ + * {@link KnownImportMode} can be used interchangeably with ImportMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NoForce** \ + * **Force** + */ +export type ImportMode = string; + +/** Known values of {@link ConnectionStatus} that the service accepts. */ +export enum KnownConnectionStatus { + /** Approved */ + Approved = "Approved", + /** Pending */ + Pending = "Pending", + /** Rejected */ + Rejected = "Rejected", + /** Disconnected */ + Disconnected = "Disconnected" +} + +/** + * Defines values for ConnectionStatus. \ + * {@link KnownConnectionStatus} can be used interchangeably with ConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approved** \ + * **Pending** \ + * **Rejected** \ + * **Disconnected** + */ +export type ConnectionStatus = string; + +/** Known values of {@link ActionsRequired} that the service accepts. */ +export enum KnownActionsRequired { + /** None */ + None = "None", + /** Recreate */ + Recreate = "Recreate" +} + +/** + * Defines values for ActionsRequired. \ + * {@link KnownActionsRequired} can be used interchangeably with ActionsRequired, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Recreate** + */ +export type ActionsRequired = string; + /** Known values of {@link SkuName} that the service accepts. */ export enum KnownSkuName { /** Classic */ @@ -2664,6 +2918,120 @@ export type ResourceIdentityType = /** Defines values for PasswordName. */ export type PasswordName = "password" | "password2"; +/** Optional parameters. */ +export interface CacheRulesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CacheRulesListResponse = CacheRulesListResult; + +/** Optional parameters. */ +export interface CacheRulesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CacheRulesGetResponse = CacheRule; + +/** Optional parameters. */ +export interface CacheRulesCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CacheRulesCreateResponse = CacheRule; + +/** Optional parameters. */ +export interface CacheRulesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CacheRulesDeleteResponse = CacheRulesDeleteHeaders; + +/** Optional parameters. */ +export interface CacheRulesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CacheRulesUpdateResponse = CacheRule; + +/** Optional parameters. */ +export interface CacheRulesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type CacheRulesListNextResponse = CacheRulesListResult; + +/** Optional parameters. */ +export interface CredentialSetsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CredentialSetsListResponse = CredentialSetListResult; + +/** Optional parameters. */ +export interface CredentialSetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CredentialSetsGetResponse = CredentialSet; + +/** Optional parameters. */ +export interface CredentialSetsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CredentialSetsCreateResponse = CredentialSet; + +/** Optional parameters. */ +export interface CredentialSetsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CredentialSetsDeleteResponse = CredentialSetsDeleteHeaders; + +/** Optional parameters. */ +export interface CredentialSetsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CredentialSetsUpdateResponse = CredentialSet; + +/** Optional parameters. */ +export interface CredentialSetsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type CredentialSetsListNextResponse = CredentialSetListResult; + /** Optional parameters. */ export interface RegistriesImportImageOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts index f1268ea30588..2849969dc0c0 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts @@ -8,6 +8,409 @@ import * as coreClient from "@azure/core-client"; +export const CacheRulesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRulesListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CacheRule" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const CacheRuleUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRuleUpdateParameters", + modelProperties: { + credentialSetResourceId: { + serializedName: "properties.credentialSetResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSetListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSetListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CredentialSet" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const IdentityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityProperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserIdentityProperties" } + } + } + } + } + } +}; + +export const UserIdentityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserIdentityProperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AuthCredential: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AuthCredential", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + usernameSecretIdentifier: { + serializedName: "usernameSecretIdentifier", + type: { + name: "String" + } + }, + passwordSecretIdentifier: { + serializedName: "passwordSecretIdentifier", + type: { + name: "String" + } + }, + credentialHealth: { + serializedName: "credentialHealth", + type: { + name: "Composite", + className: "CredentialHealth" + } + } + } + } +}; + +export const CredentialHealth: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialHealth", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSetUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSetUpdateParameters", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + authCredentials: { + serializedName: "properties.authCredentials", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AuthCredential" + } + } + } + } + } + } +}; + export const ImportImageParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -356,177 +759,26 @@ export const RegistryNameStatus: coreClient.CompositeMapper = { name: "Boolean" } }, - reason: { - serializedName: "reason", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - } - } - } -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String" - } - } - } - } -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" - } - } - } - } -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + reason: { + serializedName: "reason", type: { name: "String" } }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + message: { + serializedName: "message", type: { - name: "DateTime" + name: "String" } } } } }; -export const RegistryListResult: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegistryListResult", + className: "PrivateEndpointConnectionListResult", modelProperties: { value: { serializedName: "value", @@ -535,7 +787,7 @@ export const RegistryListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Registry" + className: "PrivateEndpointConnection" } } } @@ -550,21 +802,13 @@ export const RegistryListResult: coreClient.CompositeMapper = { } }; -export const Sku: coreClient.CompositeMapper = { +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Sku", + className: "PrivateEndpoint", modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String" - } - }, - tier: { - serializedName: "tier", - readOnly: true, + id: { + serializedName: "id", type: { name: "String" } @@ -573,61 +817,75 @@ export const Sku: coreClient.CompositeMapper = { } }; -export const IdentityProperties: coreClient.CompositeMapper = { +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IdentityProperties", + className: "PrivateLinkServiceConnectionState", modelProperties: { - principalId: { - serializedName: "principalId", + status: { + serializedName: "status", type: { name: "String" } }, - tenantId: { - serializedName: "tenantId", + description: { + serializedName: "description", type: { name: "String" } }, - type: { - serializedName: "type", + actionsRequired: { + serializedName: "actionsRequired", type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ] + name: "String" } - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + } + } + } +}; + +export const RegistryListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegistryListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserIdentityProperties" } + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Registry" + } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const UserIdentityProperties: coreClient.CompositeMapper = { +export const Sku: coreClient.CompositeMapper = { type: { name: "Composite", - className: "UserIdentityProperties", + className: "Sku", modelProperties: { - principalId: { - serializedName: "principalId", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - clientId: { - serializedName: "clientId", + tier: { + serializedName: "tier", + readOnly: true, type: { name: "String" } @@ -1164,92 +1422,6 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { } }; -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorResponseBody" - } - } - } - } -}; - -export const ErrorResponseBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponseBody", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - type: { - name: "String" - } - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InnerErrorDescription" - } - } - } - } - } - } -}; - -export const InnerErrorDescription: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InnerErrorDescription", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - type: { - name: "String" - } - } - } - } -}; - export const RegistryListCredentialsResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2071,33 +2243,119 @@ export const EventResponseMessage: coreClient.CompositeMapper = { name: "String" } }, - version: { - serializedName: "version", + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const CallbackConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CallbackConfig", + modelProperties: { + serviceUri: { + serializedName: "serviceUri", + required: true, + type: { + name: "String" + } + }, + customHeaders: { + serializedName: "customHeaders", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseBody" + } + } + } + } +}; + +export const ErrorResponseBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseBody", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InnerErrorDescription" + } + } } } } } }; -export const CallbackConfig: coreClient.CompositeMapper = { +export const InnerErrorDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CallbackConfig", + className: "InnerErrorDescription", modelProperties: { - serviceUri: { - serializedName: "serviceUri", + code: { + serializedName: "code", required: true, type: { name: "String" } }, - customHeaders: { - serializedName: "customHeaders", + message: { + serializedName: "message", + required: true, type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" } } } @@ -2473,6 +2731,72 @@ export const RunGetLogResult: coreClient.CompositeMapper = { } }; +export const IdentityPropertiesAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityPropertiesAutoGenerated", + modelProperties: { + principalId: { + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserIdentityPropertiesAutoGenerated" + } + } + } + } + } + } +}; + +export const UserIdentityPropertiesAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserIdentityPropertiesAutoGenerated", + modelProperties: { + principalId: { + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + export const TaskRunUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2482,7 +2806,7 @@ export const TaskRunUpdateParameters: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "IdentityProperties" + className: "IdentityPropertiesAutoGenerated" } }, location: { @@ -2981,7 +3305,7 @@ export const TaskUpdateParameters: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "IdentityProperties" + className: "IdentityPropertiesAutoGenerated" } }, tags: { @@ -3574,6 +3898,97 @@ export const OverrideTaskStepProperties: coreClient.CompositeMapper = { } }; +export const CacheRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRule", + modelProperties: { + ...ProxyResource.type.modelProperties, + credentialSetResourceId: { + serializedName: "properties.credentialSetResourceId", + type: { + name: "String" + } + }, + sourceRepository: { + serializedName: "properties.sourceRepository", + type: { + name: "String" + } + }, + targetRepository: { + serializedName: "properties.targetRepository", + type: { + name: "String" + } + }, + creationDate: { + serializedName: "properties.creationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSet", + modelProperties: { + ...ProxyResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + loginServer: { + serializedName: "properties.loginServer", + type: { + name: "String" + } + }, + authCredentials: { + serializedName: "properties.authCredentials", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AuthCredential" + } + } + } + }, + creationDate: { + serializedName: "properties.creationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3867,7 +4282,7 @@ export const TaskRun: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "IdentityProperties" + className: "IdentityPropertiesAutoGenerated" } }, location: { @@ -4164,7 +4579,7 @@ export const Task: coreClient.CompositeMapper = { serializedName: "identity", type: { name: "Composite", - className: "IdentityProperties" + className: "IdentityPropertiesAutoGenerated" } }, provisioningState: { @@ -4836,6 +5251,96 @@ export const EncodedTaskStepUpdateParameters: coreClient.CompositeMapper = { } }; +export const CacheRulesCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRulesCreateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const CacheRulesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRulesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CacheRulesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CacheRulesUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSetsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSetsCreateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSetsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSetsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const CredentialSetsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CredentialSetsUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + export const RegistriesImportImageHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts index bb5413bc34e7..7dc87ccfe030 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts @@ -12,6 +12,10 @@ import { OperationQueryParameter } from "@azure/core-client"; import { + CacheRule as CacheRuleMapper, + CacheRuleUpdateParameters as CacheRuleUpdateParametersMapper, + CredentialSet as CredentialSetMapper, + CredentialSetUpdateParameters as CredentialSetUpdateParametersMapper, ImportImageParameters as ImportImageParametersMapper, RegistryNameCheckRequest as RegistryNameCheckRequestMapper, Registry as RegistryMapper, @@ -37,23 +41,18 @@ import { TaskUpdateParameters as TaskUpdateParametersMapper } from "../models/mappers"; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { defaultValue: "application/json", isConstant: true, - serializedName: "Content-Type", + serializedName: "Accept", type: { name: "String" } } }; -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: ImportImageParametersMapper -}; - export const $host: OperationURLParameter = { parameterPath: "$host", mapper: { @@ -69,7 +68,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-12-01", + defaultValue: "2023-07-01", isConstant: true, serializedName: "api-version", type: { @@ -120,23 +119,92 @@ export const registryName: OperationURLParameter = { } }; -export const registryNameCheckRequest: OperationParameter = { - parameterPath: "registryNameCheckRequest", - mapper: RegistryNameCheckRequestMapper +export const cacheRuleName: OperationURLParameter = { + parameterPath: "cacheRuleName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9-]*$"), + MaxLength: 50, + MinLength: 5 + }, + serializedName: "cacheRuleName", + required: true, + type: { + name: "String" + } + } }; -export const accept: OperationParameter = { - parameterPath: "accept", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", isConstant: true, - serializedName: "Accept", + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const cacheRuleCreateParameters: OperationParameter = { + parameterPath: "cacheRuleCreateParameters", + mapper: CacheRuleMapper +}; + +export const cacheRuleUpdateParameters: OperationParameter = { + parameterPath: "cacheRuleUpdateParameters", + mapper: CacheRuleUpdateParametersMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const credentialSetName: OperationURLParameter = { + parameterPath: "credentialSetName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9-]*$"), + MaxLength: 50, + MinLength: 5 + }, + serializedName: "credentialSetName", + required: true, type: { name: "String" } } }; +export const credentialSetCreateParameters: OperationParameter = { + parameterPath: "credentialSetCreateParameters", + mapper: CredentialSetMapper +}; + +export const credentialSetUpdateParameters: OperationParameter = { + parameterPath: "credentialSetUpdateParameters", + mapper: CredentialSetUpdateParametersMapper +}; + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: ImportImageParametersMapper +}; + +export const registryNameCheckRequest: OperationParameter = { + parameterPath: "registryNameCheckRequest", + mapper: RegistryNameCheckRequestMapper +}; + export const registry: OperationParameter = { parameterPath: "registry", mapper: RegistryMapper @@ -199,18 +267,6 @@ export const apiVersion1: OperationQueryParameter = { } }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/agentPools.ts b/sdk/containerregistry/arm-containerregistry/src/operations/agentPools.ts index f85fc2c3a841..8b87280af369 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/agentPools.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/agentPools.ts @@ -511,7 +511,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPool }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -543,7 +543,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPool }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.agentPool, @@ -555,7 +555,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.agentPoolName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -569,7 +569,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -601,7 +601,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPool }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.updateParameters, @@ -613,7 +613,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.agentPoolName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -626,7 +626,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPoolListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -648,7 +648,7 @@ const getQueueStatusOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPoolQueueStatus }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -670,15 +670,15 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.AgentPoolListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.registryName, - Parameters.resourceGroupName1, - Parameters.nextLink + Parameters.nextLink, + Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/cacheRules.ts b/sdk/containerregistry/arm-containerregistry/src/operations/cacheRules.ts new file mode 100644 index 000000000000..092e5ed068c9 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operations/cacheRules.ts @@ -0,0 +1,661 @@ +/* + * 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 { CacheRules } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerRegistryManagementClient } from "../containerRegistryManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CacheRule, + CacheRulesListNextOptionalParams, + CacheRulesListOptionalParams, + CacheRulesListResponse, + CacheRulesGetOptionalParams, + CacheRulesGetResponse, + CacheRulesCreateOptionalParams, + CacheRulesCreateResponse, + CacheRulesDeleteOptionalParams, + CacheRulesDeleteResponse, + CacheRuleUpdateParameters, + CacheRulesUpdateOptionalParams, + CacheRulesUpdateResponse, + CacheRulesListNextResponse +} from "../models"; + +/// +/** Class containing CacheRules operations. */ +export class CacheRulesImpl implements CacheRules { + private readonly client: ContainerRegistryManagementClient; + + /** + * Initialize a new instance of the class CacheRules class. + * @param client Reference to the service client + */ + constructor(client: ContainerRegistryManagementClient) { + this.client = client; + } + + /** + * Lists all cache rule resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + registryName: string, + options?: CacheRulesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, registryName, 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( + resourceGroupName, + registryName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + registryName: string, + options?: CacheRulesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: CacheRulesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, registryName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + registryName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + registryName: string, + options?: CacheRulesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + registryName, + options + )) { + yield* page; + } + } + + /** + * Lists all cache rule resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + registryName: string, + options?: CacheRulesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, options }, + listOperationSpec + ); + } + + /** + * Gets the properties of the specified cache rule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, cacheRuleName, options }, + getOperationSpec + ); + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleCreateParameters: CacheRule, + options?: CacheRulesCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleCreateParameters, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + CacheRulesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleCreateParameters: CacheRule, + options?: CacheRulesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleCreateParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a cache rule resource from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, registryName, cacheRuleName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + CacheRulesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a cache rule resource from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + registryName, + cacheRuleName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleUpdateParameters: CacheRuleUpdateParameters, + options?: CacheRulesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleUpdateParameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + CacheRulesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Updates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleUpdateParameters: CacheRuleUpdateParameters, + options?: CacheRulesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + registryName, + cacheRuleName, + cacheRuleUpdateParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + registryName: string, + nextLink: string, + options?: CacheRulesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CacheRulesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CacheRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.cacheRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CacheRule + }, + 201: { + bodyMapper: Mappers.CacheRule + }, + 202: { + bodyMapper: Mappers.CacheRule + }, + 204: { + bodyMapper: Mappers.CacheRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.cacheRuleCreateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.cacheRuleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CacheRulesDeleteHeaders + }, + 201: { + headersMapper: Mappers.CacheRulesDeleteHeaders + }, + 202: { + headersMapper: Mappers.CacheRulesDeleteHeaders + }, + 204: { + headersMapper: Mappers.CacheRulesDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.cacheRuleName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CacheRule + }, + 201: { + bodyMapper: Mappers.CacheRule + }, + 202: { + bodyMapper: Mappers.CacheRule + }, + 204: { + bodyMapper: Mappers.CacheRule + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.cacheRuleUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.cacheRuleName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CacheRulesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/credentialSets.ts b/sdk/containerregistry/arm-containerregistry/src/operations/credentialSets.ts new file mode 100644 index 000000000000..6904ea02873a --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operations/credentialSets.ts @@ -0,0 +1,661 @@ +/* + * 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 { CredentialSets } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerRegistryManagementClient } from "../containerRegistryManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CredentialSet, + CredentialSetsListNextOptionalParams, + CredentialSetsListOptionalParams, + CredentialSetsListResponse, + CredentialSetsGetOptionalParams, + CredentialSetsGetResponse, + CredentialSetsCreateOptionalParams, + CredentialSetsCreateResponse, + CredentialSetsDeleteOptionalParams, + CredentialSetsDeleteResponse, + CredentialSetUpdateParameters, + CredentialSetsUpdateOptionalParams, + CredentialSetsUpdateResponse, + CredentialSetsListNextResponse +} from "../models"; + +/// +/** Class containing CredentialSets operations. */ +export class CredentialSetsImpl implements CredentialSets { + private readonly client: ContainerRegistryManagementClient; + + /** + * Initialize a new instance of the class CredentialSets class. + * @param client Reference to the service client + */ + constructor(client: ContainerRegistryManagementClient) { + this.client = client; + } + + /** + * Lists all credential set resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + registryName: string, + options?: CredentialSetsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, registryName, 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( + resourceGroupName, + registryName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + registryName: string, + options?: CredentialSetsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: CredentialSetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, registryName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + registryName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + registryName: string, + options?: CredentialSetsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + registryName, + options + )) { + yield* page; + } + } + + /** + * Lists all credential set resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + registryName: string, + options?: CredentialSetsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, options }, + listOperationSpec + ); + } + + /** + * Gets the properties of the specified credential set resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, credentialSetName, options }, + getOperationSpec + ); + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetCreateParameters: CredentialSet, + options?: CredentialSetsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + registryName, + credentialSetName, + credentialSetCreateParameters, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + CredentialSetsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Creates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetCreateParameters: CredentialSet, + options?: CredentialSetsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + registryName, + credentialSetName, + credentialSetCreateParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a credential set from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, registryName, credentialSetName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + CredentialSetsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a credential set from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + registryName, + credentialSetName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetUpdateParameters: CredentialSetUpdateParameters, + options?: CredentialSetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + registryName, + credentialSetName, + credentialSetUpdateParameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + CredentialSetsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Updates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetUpdateParameters: CredentialSetUpdateParameters, + options?: CredentialSetsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + registryName, + credentialSetName, + credentialSetUpdateParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + registryName: string, + nextLink: string, + options?: CredentialSetsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, registryName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CredentialSetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CredentialSet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.credentialSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CredentialSet + }, + 201: { + bodyMapper: Mappers.CredentialSet + }, + 202: { + bodyMapper: Mappers.CredentialSet + }, + 204: { + bodyMapper: Mappers.CredentialSet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.credentialSetCreateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.credentialSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CredentialSetsDeleteHeaders + }, + 201: { + headersMapper: Mappers.CredentialSetsDeleteHeaders + }, + 202: { + headersMapper: Mappers.CredentialSetsDeleteHeaders + }, + 204: { + headersMapper: Mappers.CredentialSetsDeleteHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.credentialSetName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CredentialSet + }, + 201: { + bodyMapper: Mappers.CredentialSet + }, + 202: { + bodyMapper: Mappers.CredentialSet + }, + 204: { + bodyMapper: Mappers.CredentialSet + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.credentialSetUpdateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.credentialSetName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CredentialSetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts index 0ab4a622281f..ecf0ebdee073 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./cacheRules"; +export * from "./credentialSets"; export * from "./registries"; export * from "./operations"; export * from "./privateEndpointConnections"; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/privateEndpointConnections.ts b/sdk/containerregistry/arm-containerregistry/src/operations/privateEndpointConnections.ts index 20bc38d6aaa7..8304b6c2b4f3 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/privateEndpointConnections.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/privateEndpointConnections.ts @@ -451,7 +451,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.privateEndpointConnectionName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts index 6fc5854e3fbb..5fa6ae05ec51 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts @@ -1104,7 +1104,7 @@ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.registryNameCheckRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1185,7 +1185,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.registryName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1229,7 +1229,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.registryName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1330,7 +1330,7 @@ const regenerateCredentialOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.registryName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1363,7 +1363,7 @@ const generateCredentialsOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.registryName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1385,7 +1385,7 @@ const scheduleRunOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Run }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.runRequest, @@ -1396,7 +1396,7 @@ const scheduleRunOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.resourceGroupName1 ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -1409,7 +1409,7 @@ const getBuildSourceUploadUrlOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SourceUploadDefinition }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/replications.ts b/sdk/containerregistry/arm-containerregistry/src/operations/replications.ts index 70b262bf5b39..943fd83ac6a5 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/replications.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/replications.ts @@ -550,7 +550,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.replicationName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -596,7 +596,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.replicationName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts b/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts index d7e82f399af0..349ca30ab6d2 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts @@ -400,7 +400,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RunListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1, Parameters.filter, Parameters.top], @@ -422,7 +422,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Run }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -454,7 +454,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Run }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.runUpdateParameters, @@ -466,7 +466,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.runId ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -479,7 +479,7 @@ const getLogSasUrlOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RunGetLogResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -503,7 +503,7 @@ const cancelOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -525,15 +525,15 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RunListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.registryName, - Parameters.resourceGroupName1, - Parameters.nextLink + Parameters.nextLink, + Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts b/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts index a9eea01fdebb..89bbb38408e4 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts @@ -559,7 +559,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.scopeMapName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -617,7 +617,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.scopeMapName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts b/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts index d428c4aaaa6d..4a5a904185dd 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts @@ -505,7 +505,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRun }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -537,7 +537,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRun }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.taskRun, @@ -549,7 +549,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.taskRunName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -563,7 +563,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -595,7 +595,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRun }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.updateParameters1, @@ -607,7 +607,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.taskRunName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -620,7 +620,7 @@ const getDetailsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRun }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -643,7 +643,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRunListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -664,15 +664,15 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskRunListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.registryName, - Parameters.resourceGroupName1, - Parameters.nextLink + Parameters.nextLink, + Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts b/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts index 34c1271d96cc..0519307124bf 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts @@ -505,7 +505,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -527,7 +527,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -559,7 +559,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.taskCreateParameters, @@ -571,7 +571,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.taskName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -585,7 +585,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -617,7 +617,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, requestBody: Parameters.taskUpdateParameters, @@ -629,7 +629,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName1, Parameters.taskName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -642,7 +642,7 @@ const getDetailsOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, queryParameters: [Parameters.apiVersion1], @@ -664,15 +664,15 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.TaskListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseAutoGenerated } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.registryName, - Parameters.resourceGroupName1, - Parameters.nextLink + Parameters.nextLink, + Parameters.resourceGroupName1 ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts b/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts index 0b7c210f1227..994da66b5a64 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts @@ -553,7 +553,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.tokenName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -611,7 +611,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.tokenName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/webhooks.ts b/sdk/containerregistry/arm-containerregistry/src/operations/webhooks.ts index a91ff3e13dc9..8cffdaff5620 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/webhooks.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/webhooks.ts @@ -731,7 +731,7 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.webhookName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; @@ -777,7 +777,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.registryName, Parameters.webhookName ], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/cacheRules.ts b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/cacheRules.ts new file mode 100644 index 000000000000..2627ed487e00 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/cacheRules.ts @@ -0,0 +1,153 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CacheRule, + CacheRulesListOptionalParams, + CacheRulesGetOptionalParams, + CacheRulesGetResponse, + CacheRulesCreateOptionalParams, + CacheRulesCreateResponse, + CacheRulesDeleteOptionalParams, + CacheRulesDeleteResponse, + CacheRuleUpdateParameters, + CacheRulesUpdateOptionalParams, + CacheRulesUpdateResponse +} from "../models"; + +/// +/** Interface representing a CacheRules. */ +export interface CacheRules { + /** + * Lists all cache rule resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + registryName: string, + options?: CacheRulesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified cache rule resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesGetOptionalParams + ): Promise; + /** + * Creates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleCreateParameters: CacheRule, + options?: CacheRulesCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesCreateResponse + > + >; + /** + * Creates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleCreateParameters The parameters for creating a cache rule. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleCreateParameters: CacheRule, + options?: CacheRulesCreateOptionalParams + ): Promise; + /** + * Deletes a cache rule resource from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesDeleteResponse + > + >; + /** + * Deletes a cache rule resource from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + options?: CacheRulesDeleteOptionalParams + ): Promise; + /** + * Updates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleUpdateParameters: CacheRuleUpdateParameters, + options?: CacheRulesUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CacheRulesUpdateResponse + > + >; + /** + * Updates a cache rule for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param cacheRuleName The name of the cache rule. + * @param cacheRuleUpdateParameters The parameters for updating a cache rule. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + registryName: string, + cacheRuleName: string, + cacheRuleUpdateParameters: CacheRuleUpdateParameters, + options?: CacheRulesUpdateOptionalParams + ): Promise; +} diff --git a/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/credentialSets.ts b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/credentialSets.ts new file mode 100644 index 000000000000..1da83819a2e6 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/credentialSets.ts @@ -0,0 +1,153 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CredentialSet, + CredentialSetsListOptionalParams, + CredentialSetsGetOptionalParams, + CredentialSetsGetResponse, + CredentialSetsCreateOptionalParams, + CredentialSetsCreateResponse, + CredentialSetsDeleteOptionalParams, + CredentialSetsDeleteResponse, + CredentialSetUpdateParameters, + CredentialSetsUpdateOptionalParams, + CredentialSetsUpdateResponse +} from "../models"; + +/// +/** Interface representing a CredentialSets. */ +export interface CredentialSets { + /** + * Lists all credential set resources for the specified container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + registryName: string, + options?: CredentialSetsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified credential set resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsGetOptionalParams + ): Promise; + /** + * Creates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetCreateParameters: CredentialSet, + options?: CredentialSetsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsCreateResponse + > + >; + /** + * Creates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetCreateParameters The parameters for creating a credential set. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetCreateParameters: CredentialSet, + options?: CredentialSetsCreateOptionalParams + ): Promise; + /** + * Deletes a credential set from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsDeleteOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsDeleteResponse + > + >; + /** + * Deletes a credential set from a container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + options?: CredentialSetsDeleteOptionalParams + ): Promise; + /** + * Updates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetUpdateParameters: CredentialSetUpdateParameters, + options?: CredentialSetsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + CredentialSetsUpdateResponse + > + >; + /** + * Updates a credential set for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the container registry. + * @param credentialSetName The name of the credential set. + * @param credentialSetUpdateParameters The parameters for updating a credential set. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + registryName: string, + credentialSetName: string, + credentialSetUpdateParameters: CredentialSetUpdateParameters, + options?: CredentialSetsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/index.ts b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/index.ts index 0ab4a622281f..ecf0ebdee073 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operationsInterfaces/index.ts @@ -6,6 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./cacheRules"; +export * from "./credentialSets"; export * from "./registries"; export * from "./operations"; export * from "./privateEndpointConnections"; diff --git a/sdk/containerregistry/arm-containerregistry/test/sampleTest.ts b/sdk/containerregistry/arm-containerregistry/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/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/containerregistry/arm-containerregistry/tsconfig.json b/sdk/containerregistry/arm-containerregistry/tsconfig.json index 87bcf4efb4f3..3e6ae96443f3 100644 --- a/sdk/containerregistry/arm-containerregistry/tsconfig.json +++ b/sdk/containerregistry/arm-containerregistry/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-containerregistry": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"