diff --git a/sdk/containerregistry/arm-containerregistry/README.md b/sdk/containerregistry/arm-containerregistry/README.md index fb3e085086d8..6ad1648b1ed9 100644 --- a/sdk/containerregistry/arm-containerregistry/README.md +++ b/sdk/containerregistry/arm-containerregistry/README.md @@ -19,8 +19,9 @@ npm install @azure/arm-containerregistry ##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code @@ -99,4 +100,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcontainerregistry%2Farm-containerregistry%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/containerregistry/arm-containerregistry/README.png) diff --git a/sdk/containerregistry/arm-containerregistry/package.json b/sdk/containerregistry/arm-containerregistry/package.json index ac283ac248ae..da51e0c48f65 100644 --- a/sdk/containerregistry/arm-containerregistry/package.json +++ b/sdk/containerregistry/arm-containerregistry/package.json @@ -4,9 +4,9 @@ "description": "ContainerRegistryManagementClient Library with typescript type definitions for node.js and browser.", "version": "7.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,11 +20,11 @@ "module": "./esm/containerRegistryManagementClient.js", "types": "./esm/containerRegistryManagementClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/containerregistry/arm-containerregistry", "repository": { diff --git a/sdk/containerregistry/arm-containerregistry/rollup.config.js b/sdk/containerregistry/arm-containerregistry/rollup.config.js index 75df723c2ed4..66c48646cb11 100644 --- a/sdk/containerregistry/arm-containerregistry/rollup.config.js +++ b/sdk/containerregistry/arm-containerregistry/rollup.config.js @@ -29,7 +29,7 @@ const config = { */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts index 9458327f3697..6170e06aa4ba 100644 --- a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts +++ b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts @@ -22,6 +22,7 @@ class ContainerRegistryManagementClient extends ContainerRegistryManagementClien replications: operations.Replications; webhooks: operations.Webhooks; runs: operations.Runs; + taskRuns: operations.TaskRuns; tasks: operations.Tasks; scopeMaps: operations.ScopeMaps; tokens: operations.Tokens; @@ -39,6 +40,7 @@ class ContainerRegistryManagementClient extends ContainerRegistryManagementClien this.replications = new operations.Replications(this); this.webhooks = new operations.Webhooks(this); this.runs = new operations.Runs(this); + this.taskRuns = new operations.TaskRuns(this); this.tasks = new operations.Tasks(this); this.scopeMaps = new operations.ScopeMaps(this); this.tokens = new operations.Tokens(this); diff --git a/sdk/containerregistry/arm-containerregistry/src/models/index.ts b/sdk/containerregistry/arm-containerregistry/src/models/index.ts index 749b2633cab0..28471c5cdff3 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/index.ts @@ -157,7 +157,7 @@ export interface OperationMetricSpecificationDefinition { } /** - * The definition of Azure Monitoring metrics list. + * The definition of Azure Monitoring list. */ export interface OperationServiceSpecificationDefinition { /** @@ -205,10 +205,50 @@ export interface Sku { readonly tier?: SkuTier; } +/** + * An interface representing UserIdentityProperties. + */ +export interface UserIdentityProperties { + /** + * The principal id of user assigned identity. + */ + principalId?: string; + /** + * The client id of user assigned identity. + */ + clientId?: string; +} + +/** + * 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. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + * UserAssigned', 'None' + */ + 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 }; +} + /** * The status of an Azure resource at the time the operation was called. */ -export interface Status1 { +export interface Status { /** * The short label for the status. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -290,7 +330,7 @@ export interface NetworkRuleSet { export interface QuarantinePolicy { /** * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' + * 'enabled', 'disabled'. Default value: 'disabled'. */ status?: PolicyStatus; } @@ -300,12 +340,12 @@ export interface QuarantinePolicy { */ export interface TrustPolicy { /** - * The type of trust policy. Possible values include: 'Notary' + * The type of trust policy. Possible values include: 'Notary'. Default value: 'Notary'. */ type?: TrustPolicyType; /** * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' + * 'enabled', 'disabled'. Default value: 'disabled'. */ status?: PolicyStatus; } @@ -315,7 +355,8 @@ export interface TrustPolicy { */ export interface RetentionPolicy { /** - * The number of days to retain manifest before it expires. + * The number of days to retain an untagged manifest after which it gets purged. Default value: + * 7. */ days?: number; /** @@ -325,7 +366,7 @@ export interface RetentionPolicy { readonly lastUpdatedTime?: Date; /** * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' + * 'enabled', 'disabled'. Default value: 'disabled'. */ status?: PolicyStatus; } @@ -348,6 +389,35 @@ export interface Policies { retentionPolicy?: RetentionPolicy; } +/** + * An interface representing KeyVaultProperties. + */ +export interface KeyVaultProperties { + /** + * Key vault uri to access the encryption key. + */ + keyIdentifier?: string; + /** + * The client id of the identity which will be used to access key vault. + */ + identity?: string; +} + +/** + * An interface representing EncryptionProperty. + */ +export interface EncryptionProperty { + /** + * Indicates whether or not the encryption is enabled for container registry. Possible values + * include: 'enabled', 'disabled' + */ + status?: EncryptionStatus; + /** + * Key vault properties. + */ + keyVaultProperties?: KeyVaultProperties; +} + /** * An Azure resource. */ @@ -385,6 +455,10 @@ export interface Registry extends Resource { * The SKU of the container registry. */ sku: Sku; + /** + * The identity of the container registry. + */ + identity?: IdentityProperties; /** * The URL that can be used to log into the container registry. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -405,7 +479,7 @@ export interface Registry extends Resource { * The status of the container registry at the time the operation was called. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly status?: Status1; + readonly status?: Status; /** * The value that indicates whether the admin user is enabled. Default value: false. */ @@ -423,6 +497,10 @@ export interface Registry extends Resource { * The policies for a container registry. */ policies?: Policies; + /** + * The encryption settings of container registry. + */ + encryption?: EncryptionProperty; } /** @@ -437,6 +515,10 @@ export interface RegistryUpdateParameters { * The SKU of the container registry. */ sku?: Sku; + /** + * The identity of the container registry. + */ + identity?: IdentityProperties; /** * The value that indicates whether the admin user is enabled. */ @@ -449,6 +531,10 @@ export interface RegistryUpdateParameters { * The policies for a container registry. */ policies?: Policies; + /** + * The encryption settings of container registry. + */ + encryption?: EncryptionProperty; } /** @@ -536,7 +622,7 @@ export interface Replication extends Resource { * The status of the replication at the time the operation was called. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly status?: Status1; + readonly status?: Status; } /** @@ -1194,43 +1280,55 @@ export interface RunGetLogResult { } /** - * An interface representing UserIdentityProperties. + * The task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ -export interface UserIdentityProperties { +export interface TaskRun extends Resource { /** - * The principal id of user assigned identity. + * Identity for the resource. */ - principalId?: string; + identity?: IdentityProperties; /** - * The client id of user assigned identity. + * The provisioning state of this task run. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - clientId?: string; + readonly provisioningState?: ProvisioningState; + /** + * The request (parameters) for the run + */ + runRequest?: RunRequestUnion; + /** + * The result of this task run + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly runResult?: Run; + /** + * How the run should be forced to rerun even if the run request configuration has not changed + */ + forceUpdateTag?: string; } /** - * Managed identity for the resource. + * The parameters for updating a task run. */ -export interface IdentityProperties { +export interface TaskRunUpdateParameters { /** - * The principal ID of resource identity. + * Identity for the resource. */ - principalId?: string; + identity?: IdentityProperties; /** - * The tenant ID of resource. + * The request (parameters) for the new run */ - tenantId?: string; + runRequest?: RunRequestUnion; /** - * The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - * UserAssigned', 'None' + * How the run should be forced to rerun even if the run request configuration has not changed */ - type?: ResourceIdentityType; + forceUpdateTag?: string; /** - * 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}'. + * The ARM resource tags. */ - userAssignedIdentities?: { [propertyName: string]: UserIdentityProperties }; + tags?: { [propertyName: string]: string }; } /** @@ -1770,6 +1868,30 @@ export interface TaskUpdateParameters { tags?: { [propertyName: string]: string }; } +/** + * An error response from the Azure Container Registry service. + */ +export interface ErrorModel { + /** + * error code. + */ + code: string; + /** + * error message. + */ + message: string; +} + +/** + * An error response from the Azure Container Registry service. + */ +export interface ErrorSchema { + /** + * Azure container registry build API error body. + */ + error?: ErrorModel; +} + /** * The properties of a run argument. */ @@ -2279,8 +2401,8 @@ export interface ScopeMap extends ProxyResource { readonly provisioningState?: ProvisioningState; /** * The list of scoped permissions for registry artifacts. - * E.g. repositories/repository-name/pull, - * repositories/repository-name/delete + * E.g. repositories/repository-name/content/read, + * repositories/repository-name/metadata/write */ actions: string[]; } @@ -2329,7 +2451,7 @@ export interface TokenCertificate { */ export interface TokenPassword { /** - * The password created datetime of the password. + * The creation datetime of the password. */ creationTime?: Date; /** @@ -2337,7 +2459,8 @@ export interface TokenPassword { */ expiry?: Date; /** - * The password name "password" or "password2". Possible values include: 'password1', 'password2' + * The password name "password1" or "password2". Possible values include: 'password1', + * 'password2' */ name?: TokenPasswordName; /** @@ -2386,7 +2509,7 @@ export interface Token extends ProxyResource { * The status of the token example enabled or disabled. Possible values include: 'enabled', * 'disabled' */ - status?: Status; + status?: TokenStatus; } /** @@ -2401,7 +2524,7 @@ export interface TokenUpdateParameters { * The status of the token example enabled or disabled. Possible values include: 'enabled', * 'disabled' */ - status?: Status; + status?: TokenStatus; /** * The credentials that can be used for authenticating the token. */ @@ -2419,11 +2542,10 @@ export interface GenerateCredentialsParameters { tokenId?: string; /** * The expiry date of the generated credentials after which the credentials become invalid. - * Default value: new Date('9999-12-31T15:59:59.9999999-08:00'). */ expiry?: Date; /** - * Specifies name of the password which should be regenerated if any -- password or password2. + * Specifies name of the password which should be regenerated if any -- password1 or password2. * Possible values include: 'password1', 'password2' */ name?: TokenPasswordName; @@ -2537,6 +2659,18 @@ export interface RunListResult extends Array { nextLink?: string; } +/** + * @interface + * The collection of task runs. + * @extends Array + */ +export interface TaskRunListResult extends Array { + /** + * The URI that can be used to request the next set of paged results. + */ + nextLink?: string; +} + /** * @interface * The collection of tasks. @@ -2597,6 +2731,15 @@ export type SkuName = 'Classic' | 'Basic' | 'Standard' | 'Premium'; */ export type SkuTier = 'Classic' | 'Basic' | 'Standard' | 'Premium'; +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; + /** * Defines values for ProvisioningState. * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' @@ -2637,6 +2780,14 @@ export type PolicyStatus = 'enabled' | 'disabled'; */ export type TrustPolicyType = 'Notary'; +/** + * Defines values for EncryptionStatus. + * Possible values include: 'enabled', 'disabled' + * @readonly + * @enum {string} + */ +export type EncryptionStatus = 'enabled' | 'disabled'; + /** * Defines values for PasswordName. * Possible values include: 'password', 'password2' @@ -2710,15 +2861,6 @@ export type Architecture = 'amd64' | 'x86' | '386' | 'arm' | 'arm64'; */ export type Variant = 'v6' | 'v7' | 'v8'; -/** - * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * @readonly - * @enum {string} - */ -export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; - /** * Defines values for TaskStatus. * Possible values include: 'Disabled', 'Enabled' @@ -2816,12 +2958,12 @@ export type TokenCertificateName = 'certificate1' | 'certificate2'; export type TokenPasswordName = 'password1' | 'password2'; /** - * Defines values for Status. + * Defines values for TokenStatus. * Possible values include: 'enabled', 'disabled' * @readonly * @enum {string} */ -export type Status = 'enabled' | 'disabled'; +export type TokenStatus = 'enabled' | 'disabled'; /** * Contains response data for the checkNameAvailability operation. @@ -3703,6 +3845,146 @@ export type RunsListNextResponse = RunListResult & { }; }; +/** + * Contains response data for the get operation. + */ +export type TaskRunsGetResponse = TaskRun & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRun; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type TaskRunsCreateResponse = TaskRun & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRun; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type TaskRunsUpdateResponse = TaskRun & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRun; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TaskRunsListResponse = TaskRunListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRunListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type TaskRunsBeginCreateResponse = TaskRun & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRun; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type TaskRunsBeginUpdateResponse = TaskRun & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRun; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TaskRunsListNextResponse = TaskRunListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TaskRunListResult; + }; +}; + /** * Contains response data for the list operation. */ diff --git a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts index 3b7be0863436..b71f6174316e 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts @@ -339,11 +339,79 @@ export const Sku: msRest.CompositeMapper = { } }; -export const Status1: msRest.CompositeMapper = { +export const UserIdentityProperties: msRest.CompositeMapper = { + serializedName: "UserIdentityProperties", + type: { + name: "Composite", + className: "UserIdentityProperties", + modelProperties: { + principalId: { + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const IdentityProperties: msRest.CompositeMapper = { + serializedName: "IdentityProperties", + type: { + name: "Composite", + className: "IdentityProperties", + 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: "UserIdentityProperties" + } + } + } + } + } + } +}; + +export const Status: msRest.CompositeMapper = { serializedName: "Status", type: { name: "Composite", - className: "Status1", + className: "Status", modelProperties: { displayStatus: { readOnly: true, @@ -485,6 +553,7 @@ export const QuarantinePolicy: msRest.CompositeMapper = { modelProperties: { status: { serializedName: "status", + defaultValue: 'disabled', type: { name: "String" } @@ -501,12 +570,14 @@ export const TrustPolicy: msRest.CompositeMapper = { modelProperties: { type: { serializedName: "type", + defaultValue: 'Notary', type: { name: "String" } }, status: { serializedName: "status", + defaultValue: 'disabled', type: { name: "String" } @@ -523,6 +594,7 @@ export const RetentionPolicy: msRest.CompositeMapper = { modelProperties: { days: { serializedName: "days", + defaultValue: 7, type: { name: "Number" } @@ -536,6 +608,7 @@ export const RetentionPolicy: msRest.CompositeMapper = { }, status: { serializedName: "status", + defaultValue: 'disabled', type: { name: "String" } @@ -575,6 +648,51 @@ export const Policies: msRest.CompositeMapper = { } }; +export const KeyVaultProperties: msRest.CompositeMapper = { + serializedName: "KeyVaultProperties", + type: { + name: "Composite", + className: "KeyVaultProperties", + modelProperties: { + keyIdentifier: { + serializedName: "keyIdentifier", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "String" + } + } + } + } +}; + +export const EncryptionProperty: msRest.CompositeMapper = { + serializedName: "EncryptionProperty", + type: { + name: "Composite", + className: "EncryptionProperty", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + keyVaultProperties: { + serializedName: "keyVaultProperties", + type: { + name: "Composite", + className: "KeyVaultProperties" + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -639,6 +757,13 @@ export const Registry: msRest.CompositeMapper = { className: "Sku" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, loginServer: { readOnly: true, serializedName: "properties.loginServer", @@ -665,7 +790,7 @@ export const Registry: msRest.CompositeMapper = { serializedName: "properties.status", type: { name: "Composite", - className: "Status1" + className: "Status" } }, adminUserEnabled: { @@ -695,6 +820,13 @@ export const Registry: msRest.CompositeMapper = { name: "Composite", className: "Policies" } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "EncryptionProperty" + } } } } @@ -724,6 +856,13 @@ export const RegistryUpdateParameters: msRest.CompositeMapper = { className: "Sku" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, adminUserEnabled: { serializedName: "properties.adminUserEnabled", type: { @@ -743,6 +882,13 @@ export const RegistryUpdateParameters: msRest.CompositeMapper = { name: "Composite", className: "Policies" } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "EncryptionProperty" + } } } } @@ -898,7 +1044,7 @@ export const Replication: msRest.CompositeMapper = { serializedName: "properties.status", type: { name: "Composite", - className: "Status1" + className: "Status" } } } @@ -1965,20 +2111,44 @@ export const RunGetLogResult: msRest.CompositeMapper = { } }; -export const UserIdentityProperties: msRest.CompositeMapper = { - serializedName: "UserIdentityProperties", +export const TaskRun: msRest.CompositeMapper = { + serializedName: "TaskRun", type: { name: "Composite", - className: "UserIdentityProperties", + className: "TaskRun", modelProperties: { - principalId: { - serializedName: "principalId", + ...Resource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityProperties" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", type: { name: "String" } }, - clientId: { - serializedName: "clientId", + runRequest: { + serializedName: "properties.runRequest", + type: { + name: "Composite", + className: "RunRequest" + } + }, + runResult: { + readOnly: true, + serializedName: "properties.runResult", + type: { + name: "Composite", + className: "Run" + } + }, + forceUpdateTag: { + serializedName: "properties.forceUpdateTag", type: { name: "String" } @@ -1987,44 +2157,39 @@ export const UserIdentityProperties: msRest.CompositeMapper = { } }; -export const IdentityProperties: msRest.CompositeMapper = { - serializedName: "IdentityProperties", +export const TaskRunUpdateParameters: msRest.CompositeMapper = { + serializedName: "TaskRunUpdateParameters", type: { name: "Composite", - className: "IdentityProperties", + className: "TaskRunUpdateParameters", modelProperties: { - principalId: { - serializedName: "principalId", + identity: { + serializedName: "identity", type: { - name: "String" + name: "Composite", + className: "IdentityProperties" } }, - tenantId: { - serializedName: "tenantId", + runRequest: { + serializedName: "properties.runRequest", type: { - name: "String" + name: "Composite", + className: "RunRequest" } }, - type: { - serializedName: "type", + forceUpdateTag: { + serializedName: "properties.forceUpdateTag", type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned, UserAssigned", - "None" - ] + name: "String" } }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + tags: { + serializedName: "tags", type: { name: "Dictionary", value: { type: { - name: "Composite", - className: "UserIdentityProperties" + name: "String" } } } @@ -2908,6 +3073,47 @@ export const TaskUpdateParameters: msRest.CompositeMapper = { } }; +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorSchema: msRest.CompositeMapper = { + serializedName: "ErrorSchema", + type: { + name: "Composite", + className: "ErrorSchema", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorModel" + } + } + } + } +}; + export const Argument: msRest.CompositeMapper = { serializedName: "Argument", type: { @@ -3857,7 +4063,6 @@ export const GenerateCredentialsParameters: msRest.CompositeMapper = { }, expiry: { serializedName: "expiry", - defaultValue: new Date('9999-12-31T15:59:59.9999999-08:00'), type: { name: "DateTime" } @@ -4068,6 +4273,34 @@ export const RunListResult: msRest.CompositeMapper = { } }; +export const TaskRunListResult: msRest.CompositeMapper = { + serializedName: "TaskRunListResult", + type: { + name: "Composite", + className: "TaskRunListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TaskRun" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const TaskListResult: msRest.CompositeMapper = { serializedName: "TaskListResult", type: { diff --git a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts index 28bc5f1e102b..79c9d37eee66 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts @@ -26,7 +26,7 @@ export const apiVersion0: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2019-05-01', + defaultValue: '2019-12-01-preview', type: { name: "String" } @@ -140,7 +140,7 @@ export const scopeMapName: msRest.OperationURLParameter = { constraints: { MaxLength: 50, MinLength: 5, - Pattern: /^[a-zA-Z0-9-]*$/ + Pattern: /^[a-zA-Z0-9-_]*$/ }, type: { name: "String" @@ -172,6 +172,16 @@ export const taskName: msRest.OperationURLParameter = { } } }; +export const taskRunName: msRest.OperationURLParameter = { + parameterPath: "taskRunName", + mapper: { + required: true, + serializedName: "taskRunName", + type: { + name: "String" + } + } +}; export const tokenName: msRest.OperationURLParameter = { parameterPath: "tokenName", mapper: { diff --git a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts index 6b1fa361e77a..d86188f33755 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts @@ -21,6 +21,9 @@ export { DockerBuildStep, EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, + ErrorModel, + ErrorSchema, FileTaskRunRequest, FileTaskStep, GenerateCredentialsParameters, @@ -32,6 +35,7 @@ export { ImportSource, ImportSourceCredentials, IPRule, + KeyVaultProperties, NetworkRuleSet, OverrideTaskStepProperties, PlatformProperties, @@ -62,9 +66,10 @@ export { SourceTrigger, SourceTriggerDescriptor, SourceUploadDefinition, - Status1, + Status, StorageAccountProperties, Task, + TaskRun, TaskRunRequest, TaskStepProperties, TimerTrigger, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts index db474e0504a4..d3f4e65f45f4 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts @@ -17,14 +17,20 @@ export { CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, + EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, + FileTaskRunRequest, FileTaskStep, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, Policies, ProxyResource, @@ -36,6 +42,7 @@ export { Resource, RetentionPolicy, Run, + RunRequest, ScopeMap, SecretObject, SetValue, @@ -44,9 +51,11 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status1, + Status, StorageAccountProperties, Task, + TaskRun, + TaskRunRequest, TaskStepProperties, TimerTrigger, TimerTriggerDescriptor, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts index 60c968c59c3a..8eae567a37c3 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts @@ -14,17 +14,24 @@ export { BaseImageDependency, BaseImageTrigger, BaseResource, - CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, + EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, + ErrorModel, + ErrorSchema, + FileTaskRunRequest, FileTaskStep, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, Policies, ProxyResource, @@ -36,6 +43,7 @@ export { Run, RunGetLogResult, RunListResult, + RunRequest, RunUpdateParameters, ScopeMap, SecretObject, @@ -45,9 +53,11 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status1, + Status, StorageAccountProperties, Task, + TaskRun, + TaskRunRequest, TaskStepProperties, TimerTrigger, TimerTriggerDescriptor, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts index 7acf439888cb..650a9506781c 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts @@ -17,14 +17,20 @@ export { CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, + EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, + FileTaskRunRequest, FileTaskStep, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, Policies, ProxyResource, @@ -34,6 +40,7 @@ export { Resource, RetentionPolicy, Run, + RunRequest, ScopeMap, ScopeMapListResult, ScopeMapUpdateParameters, @@ -44,9 +51,11 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status1, + Status, StorageAccountProperties, Task, + TaskRun, + TaskRunRequest, TaskStepProperties, TimerTrigger, TimerTriggerDescriptor, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/taskRunsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/taskRunsMappers.ts new file mode 100644 index 000000000000..1263651fb744 --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/models/taskRunsMappers.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + discriminators, + AgentProperties, + Argument, + AuthInfo, + BaseImageDependency, + BaseImageTrigger, + BaseResource, + Credentials, + CustomRegistryCredentials, + DockerBuildRequest, + DockerBuildStep, + EncodedTaskRunRequest, + EncodedTaskStep, + EncryptionProperty, + ErrorModel, + ErrorSchema, + FileTaskRunRequest, + FileTaskStep, + IdentityProperties, + ImageDescriptor, + ImageUpdateTrigger, + IPRule, + KeyVaultProperties, + NetworkRuleSet, + OverrideTaskStepProperties, + PlatformProperties, + Policies, + ProxyResource, + QuarantinePolicy, + Registry, + Replication, + Resource, + RetentionPolicy, + Run, + RunRequest, + ScopeMap, + SecretObject, + SetValue, + Sku, + SourceProperties, + SourceRegistryCredentials, + SourceTrigger, + SourceTriggerDescriptor, + Status, + StorageAccountProperties, + Task, + TaskRun, + TaskRunListResult, + TaskRunRequest, + TaskRunUpdateParameters, + TaskStepProperties, + TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, + TriggerProperties, + TrustPolicy, + UserIdentityProperties, + VirtualNetworkRule, + Webhook +} from "../models/mappers"; diff --git a/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts index 3cdb2ace5658..533061357dd7 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts @@ -16,20 +16,27 @@ export { BaseImageTrigger, BaseImageTriggerUpdateParameters, BaseResource, - CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, DockerBuildStepUpdateParameters, + EncodedTaskRunRequest, EncodedTaskStep, EncodedTaskStepUpdateParameters, + EncryptionProperty, + ErrorModel, + ErrorSchema, + FileTaskRunRequest, FileTaskStep, FileTaskStepUpdateParameters, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, PlatformUpdateParameters, Policies, @@ -40,6 +47,7 @@ export { Resource, RetentionPolicy, Run, + RunRequest, ScopeMap, SecretObject, SetValue, @@ -50,10 +58,12 @@ export { SourceTriggerDescriptor, SourceTriggerUpdateParameters, SourceUpdateParameters, - Status1, + Status, StorageAccountProperties, Task, TaskListResult, + TaskRun, + TaskRunRequest, TaskStepProperties, TaskStepUpdateParameters, TaskUpdateParameters, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts index 72b11906e68f..f07e5ae30a00 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts @@ -17,14 +17,20 @@ export { CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, + EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, + FileTaskRunRequest, FileTaskStep, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, Policies, ProxyResource, @@ -34,6 +40,7 @@ export { Resource, RetentionPolicy, Run, + RunRequest, ScopeMap, SecretObject, SetValue, @@ -42,9 +49,11 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status1, + Status, StorageAccountProperties, Task, + TaskRun, + TaskRunRequest, TaskStepProperties, TimerTrigger, TimerTriggerDescriptor, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts index ba570b7f3e2f..9031e587d76b 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts @@ -19,20 +19,26 @@ export { CloudError, Credentials, CustomRegistryCredentials, + DockerBuildRequest, DockerBuildStep, + EncodedTaskRunRequest, EncodedTaskStep, + EncryptionProperty, Event, EventContent, EventInfo, EventListResult, EventRequestMessage, EventResponseMessage, + FileTaskRunRequest, FileTaskStep, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, IPRule, + KeyVaultProperties, NetworkRuleSet, + OverrideTaskStepProperties, PlatformProperties, Policies, ProxyResource, @@ -43,6 +49,7 @@ export { Resource, RetentionPolicy, Run, + RunRequest, ScopeMap, SecretObject, SetValue, @@ -52,10 +59,12 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status1, + Status, StorageAccountProperties, Target, Task, + TaskRun, + TaskRunRequest, TaskStepProperties, TimerTrigger, TimerTriggerDescriptor, diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts index 1e3175a05f2c..100a348bd824 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts @@ -13,6 +13,7 @@ export * from "./operations"; export * from "./replications"; export * from "./webhooks"; export * from "./runs"; +export * from "./taskRuns"; export * from "./tasks"; export * from "./scopeMaps"; export * from "./tokens"; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts index 6e7146247bff..b577f9262eae 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts @@ -732,7 +732,7 @@ const getBuildSourceUploadUrlOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.SourceUploadDefinition }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -891,7 +891,7 @@ const beginScheduleRunOperationSpec: msRest.OperationSpec = { }, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts b/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts index 8ce3e9f5e7ed..d49924a790a3 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/runs.ts @@ -252,7 +252,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RunListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -278,7 +278,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Run }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -304,7 +304,7 @@ const getLogSasUrlOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RunGetLogResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -340,7 +340,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Run }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -365,7 +365,7 @@ const beginCancelOperationSpec: msRest.OperationSpec = { 200: {}, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -386,7 +386,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RunListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts b/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts new file mode 100644 index 000000000000..17729964835e --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operations/taskRuns.ts @@ -0,0 +1,402 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/taskRunsMappers"; +import * as Parameters from "../models/parameters"; +import { ContainerRegistryManagementClientContext } from "../containerRegistryManagementClientContext"; + +/** Class representing a TaskRuns. */ +export class TaskRuns { + private readonly client: ContainerRegistryManagementClientContext; + + /** + * Create a TaskRuns. + * @param {ContainerRegistryManagementClientContext} client Reference to the service client. + */ + constructor(client: ContainerRegistryManagementClientContext) { + this.client = client; + } + + /** + * Gets the detailed information for a given task run. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The run request name. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, registryName: string, taskRunName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The run request name. + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, taskRunName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The run request name. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, taskRunName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, registryName: string, taskRunName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + registryName, + taskRunName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a task run for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, registryName: string, taskRunName: string, taskRun: Models.TaskRun, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,registryName,taskRunName,taskRun,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a specified task run resource. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The task run name. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, registryName: string, taskRunName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,registryName,taskRunName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates a task run with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The task run name. + * @param updateParameters The parameters for updating a task run. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, registryName: string, taskRunName: string, updateParameters: Models.TaskRunUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,registryName,taskRunName,updateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Lists all the task runs for a specified container registry. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, registryName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param callback The callback + */ + list(resourceGroupName: string, registryName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, registryName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + registryName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Creates a task run for a container registry with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The name of task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, registryName: string, taskRunName: string, taskRun: Models.TaskRun, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + taskRunName, + taskRun, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes a specified task run resource. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The task run name. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, registryName: string, taskRunName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + taskRunName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Updates a task run with the specified parameters. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskRunName The task run name. + * @param updateParameters The parameters for updating a task run. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, registryName: string, taskRunName: string, updateParameters: Models.TaskRunUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + taskRunName, + updateParameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Lists all the task runs for a specified container registry. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.taskRunName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TaskRun + }, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TaskRunListResult + }, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.taskRunName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "taskRun", + mapper: { + ...Mappers.TaskRun, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TaskRun + }, + 201: { + bodyMapper: Mappers.TaskRun + }, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.taskRunName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.taskRunName + ], + queryParameters: [ + Parameters.apiVersion1 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "updateParameters", + mapper: { + ...Mappers.TaskRunUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.TaskRun + }, + 201: { + bodyMapper: Mappers.TaskRun + }, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TaskRunListResult + }, + default: { + bodyMapper: Mappers.ErrorSchema + } + }, + serializer +}; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts b/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts index 1d473f71bbc9..825be1a6beb4 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/tasks.ts @@ -286,7 +286,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.TaskListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -312,7 +312,7 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -338,7 +338,7 @@ const getDetailsOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -374,7 +374,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -400,7 +400,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -436,7 +436,7 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.Task }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer @@ -457,7 +457,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.TaskListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorSchema } }, serializer diff --git a/sdk/containerregistry/arm-containerregistry/tsconfig.json b/sdk/containerregistry/arm-containerregistry/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/containerregistry/arm-containerregistry/tsconfig.json +++ b/sdk/containerregistry/arm-containerregistry/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true