diff --git a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts index fec95885a3b7..9458327f3697 100644 --- a/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts +++ b/sdk/containerregistry/arm-containerregistry/src/containerRegistryManagementClient.ts @@ -23,6 +23,8 @@ class ContainerRegistryManagementClient extends ContainerRegistryManagementClien webhooks: operations.Webhooks; runs: operations.Runs; tasks: operations.Tasks; + scopeMaps: operations.ScopeMaps; + tokens: operations.Tokens; /** * Initializes a new instance of the ContainerRegistryManagementClient class. @@ -38,6 +40,8 @@ class ContainerRegistryManagementClient extends ContainerRegistryManagementClien this.webhooks = new operations.Webhooks(this); this.runs = new operations.Runs(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 5484f2ed92b8..f2c206fa1c2d 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/index.ts @@ -208,7 +208,7 @@ export interface Sku { /** * The status of an Azure resource at the time the operation was called. */ -export interface Status { +export interface Status1 { /** * The short label for the status. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -284,6 +284,70 @@ export interface NetworkRuleSet { ipRules?: IPRule[]; } +/** + * The quarantine policy for a container registry. + */ +export interface QuarantinePolicy { + /** + * The value that indicates whether the policy is enabled or not. Possible values include: + * 'enabled', 'disabled' + */ + status?: PolicyStatus; +} + +/** + * The content trust policy for a container registry. + */ +export interface TrustPolicy { + /** + * The type of trust policy. Possible values include: 'Notary' + */ + type?: TrustPolicyType; + /** + * The value that indicates whether the policy is enabled or not. Possible values include: + * 'enabled', 'disabled' + */ + status?: PolicyStatus; +} + +/** + * The retention policy for a container registry. + */ +export interface RetentionPolicy { + /** + * The number of days to retain manifest before it expires. + */ + days?: number; + /** + * The timestamp when the policy was last updated. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastUpdatedTime?: Date; + /** + * The value that indicates whether the policy is enabled or not. Possible values include: + * 'enabled', 'disabled' + */ + status?: PolicyStatus; +} + +/** + * The policies for a container registry. + */ +export interface Policies { + /** + * The quarantine policy for a container registry. + */ + quarantinePolicy?: QuarantinePolicy; + /** + * The content trust policy for a container registry. + */ + trustPolicy?: TrustPolicy; + /** + * The retention policy for a container registry. + */ + retentionPolicy?: RetentionPolicy; +} + /** * An Azure resource. */ @@ -341,7 +405,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?: Status; + readonly status?: Status1; /** * The value that indicates whether the admin user is enabled. Default value: false. */ @@ -355,6 +419,10 @@ export interface Registry extends Resource { * The network rule set for a container registry. */ networkRuleSet?: NetworkRuleSet; + /** + * The policies for a container registry. + */ + policies?: Policies; } /** @@ -373,16 +441,14 @@ export interface RegistryUpdateParameters { * The value that indicates whether the admin user is enabled. */ adminUserEnabled?: boolean; - /** - * The parameters of a storage account for the container registry. Only applicable to Classic - * SKU. If specified, the storage account must be in the same physical location as the container - * registry. - */ - storageAccount?: StorageAccountProperties; /** * The network rule set for a container registry. */ networkRuleSet?: NetworkRuleSet; + /** + * The policies for a container registry. + */ + policies?: Policies; } /** @@ -456,46 +522,6 @@ export interface RegistryUsageListResult { value?: RegistryUsage[]; } -/** - * An object that represents quarantine policy for a container registry. - */ -export interface QuarantinePolicy { - /** - * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' - */ - status?: PolicyStatus; -} - -/** - * An object that represents content trust policy for a container registry. - */ -export interface TrustPolicy { - /** - * The type of trust policy. Possible values include: 'Notary' - */ - type?: TrustPolicyType; - /** - * The value that indicates whether the policy is enabled or not. Possible values include: - * 'enabled', 'disabled' - */ - status?: PolicyStatus; -} - -/** - * An object that represents policies for a container registry. - */ -export interface RegistryPolicies { - /** - * An object that represents quarantine policy for a container registry. - */ - quarantinePolicy?: QuarantinePolicy; - /** - * An object that represents content trust policy for a container registry. - */ - trustPolicy?: TrustPolicy; -} - /** * An object that represents a replication for a container registry. */ @@ -510,7 +536,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?: Status; + readonly status?: Status1; } /** @@ -965,6 +991,20 @@ export interface AgentProperties { cpu?: number; } +/** + * An interface representing TimerTriggerDescriptor. + */ +export interface TimerTriggerDescriptor { + /** + * The timer trigger name that caused the run. + */ + timerTriggerName?: string; + /** + * The occurrence that triggered the run. + */ + scheduleOccurrence?: string; +} + /** * The resource model definition for a ARM proxy resource. It will have everything other than * required location and tags. @@ -1068,6 +1108,10 @@ export interface Run extends ProxyResource { * The value that indicates whether archiving is enabled or not. Default value: false. */ isArchiveEnabled?: boolean; + /** + * The timer trigger that caused the run. + */ + timerTrigger?: TimerTriggerDescriptor; } /** @@ -2156,6 +2200,196 @@ export interface EncodedTaskStepUpdateParameters { values?: SetValue[]; } +/** + * An object that represents a scope map for a container registry. + */ +export interface ScopeMap extends ProxyResource { + /** + * The user friendly description of the scope map. + */ + description?: string; + /** + * The type of the scope map. E.g. BuildIn scope map. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly scopeMapType?: string; + /** + * The creation date of scope map. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly creationDate?: Date; + /** + * Provisioning state of the resource. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * The list of scoped permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete + */ + actions: string[]; +} + +/** + * The properties for updating the scope map. + */ +export interface ScopeMapUpdateParameters { + /** + * The user friendly description of the scope map. + */ + description?: string; + /** + * The list of scope permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete + */ + actions?: string[]; +} + +/** + * The properties of a certificate used for authenticating a token. + */ +export interface TokenCertificate { + /** + * Possible values include: 'certificate1', 'certificate2' + */ + name?: TokenCertificateName; + /** + * The expiry datetime of the certificate. + */ + expiry?: Date; + /** + * The thumbprint of the certificate. + */ + thumbprint?: string; + /** + * Base 64 encoded string of the public certificate1 in PEM format that will be used for + * authenticating the token. + */ + encodedPemCertificate?: string; +} + +/** + * The password that will be used for authenticating the token of a container registry. + */ +export interface TokenPassword { + /** + * The password created datetime of the password. + */ + creationTime?: Date; + /** + * The expiry datetime of the password. + */ + expiry?: Date; + /** + * The password name "password" or "password2". Possible values include: 'password1', 'password2' + */ + name?: TokenPasswordName; + /** + * The password value. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: string; +} + +/** + * The properties of the credentials that can be used for authenticating the token. + */ +export interface TokenCredentialsProperties { + certificates?: TokenCertificate[]; + passwords?: TokenPassword[]; +} + +/** + * An object that represents a token for a container registry. + */ +export interface Token extends ProxyResource { + /** + * The creation date of scope map. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly creationDate?: Date; + /** + * Provisioning state of the resource. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * The resource ID of the scope map to which the token will be associated with. + */ + scopeMapId?: string; + /** + * The user/group/application object ID for which the token has to be created. + */ + objectId?: string; + /** + * The credentials that can be used for authenticating the token. + */ + credentials?: TokenCredentialsProperties; + /** + * The status of the token example enabled or disabled. Possible values include: 'enabled', + * 'disabled' + */ + status?: Status; +} + +/** + * The parameters for updating a token. + */ +export interface TokenUpdateParameters { + /** + * The resource ID of the scope map to which the token will be associated with. + */ + scopeMapId?: string; + /** + * The status of the token example enabled or disabled. Possible values include: 'enabled', + * 'disabled' + */ + status?: Status; + /** + * The credentials that can be used for authenticating the token. + */ + credentials?: TokenCredentialsProperties; +} + +/** + * The parameters used to generate credentials for a specified token or user of a container + * registry. + */ +export interface GenerateCredentialsParameters { + /** + * The resource ID of the token for which credentials have to be generated. + */ + 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. + * Possible values include: 'password1', 'password2' + */ + name?: TokenPasswordName; +} + +/** + * The response from the GenerateCredentials operation. + */ +export interface GenerateCredentialsResult { + /** + * The username for a container registry. + */ + username?: string; + /** + * The list of passwords for a container registry. + */ + passwords?: TokenPassword[]; +} + /** * Optional Parameters. */ @@ -2262,6 +2496,30 @@ export interface TaskListResult extends Array { nextLink?: string; } +/** + * @interface + * The result of a request to list scope maps for a container registry. + * @extends Array + */ +export interface ScopeMapListResult extends Array { + /** + * The URI that can be used to request the next list of scope maps. + */ + nextLink?: string; +} + +/** + * @interface + * The result of a request to list tokens for a container registry. + * @extends Array + */ +export interface TokenListResult extends Array { + /** + * The URI that can be used to request the next list of tokens. + */ + nextLink?: string; +} + /** * Defines values for ImportMode. * Possible values include: 'NoForce', 'Force' @@ -2311,36 +2569,36 @@ export type DefaultAction = 'Allow' | 'Deny'; export type Action = 'Allow'; /** - * Defines values for PasswordName. - * Possible values include: 'password', 'password2' + * Defines values for PolicyStatus. + * Possible values include: 'enabled', 'disabled' * @readonly * @enum {string} */ -export type PasswordName = 'password' | 'password2'; +export type PolicyStatus = 'enabled' | 'disabled'; /** - * Defines values for RegistryUsageUnit. - * Possible values include: 'Count', 'Bytes' + * Defines values for TrustPolicyType. + * Possible values include: 'Notary' * @readonly * @enum {string} */ -export type RegistryUsageUnit = 'Count' | 'Bytes'; +export type TrustPolicyType = 'Notary'; /** - * Defines values for PolicyStatus. - * Possible values include: 'enabled', 'disabled' + * Defines values for PasswordName. + * Possible values include: 'password', 'password2' * @readonly * @enum {string} */ -export type PolicyStatus = 'enabled' | 'disabled'; +export type PasswordName = 'password' | 'password2'; /** - * Defines values for TrustPolicyType. - * Possible values include: 'Notary' + * Defines values for RegistryUsageUnit. + * Possible values include: 'Count', 'Bytes' * @readonly * @enum {string} */ -export type TrustPolicyType = 'Notary'; +export type RegistryUsageUnit = 'Count' | 'Bytes'; /** * Defines values for WebhookStatus. @@ -2481,7 +2739,31 @@ export type SourceRegistryLoginMode = 'None' | 'Default'; export type SecretObjectType = 'Opaque' | 'Vaultsecret'; /** - * Contains response data for the checkNameAvailability operation. + * Defines values for TokenCertificateName. + * Possible values include: 'certificate1', 'certificate2' + * @readonly + * @enum {string} + */ +export type TokenCertificateName = 'certificate1' | 'certificate2'; + +/** + * Defines values for TokenPasswordName. + * Possible values include: 'password1', 'password2' + * @readonly + * @enum {string} + */ +export type TokenPasswordName = 'password1' | 'password2'; + +/** + * Defines values for Status. + * Possible values include: 'enabled', 'disabled' + * @readonly + * @enum {string} + */ +export type Status = 'enabled' | 'disabled'; + +/** + * Contains response data for the checkNameAvailability operation. */ export type RegistriesCheckNameAvailabilityResponse = RegistryNameStatus & { /** @@ -2661,29 +2943,9 @@ export type RegistriesListUsagesResponse = RegistryUsageListResult & { }; /** - * Contains response data for the listPolicies operation. - */ -export type RegistriesListPoliciesResponse = RegistryPolicies & { - /** - * 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: RegistryPolicies; - }; -}; - -/** - * Contains response data for the updatePolicies operation. + * Contains response data for the scheduleRun operation. */ -export type RegistriesUpdatePoliciesResponse = RegistryPolicies & { +export type RegistriesScheduleRunResponse = Run & { /** * The underlying HTTP response. */ @@ -2696,14 +2958,14 @@ export type RegistriesUpdatePoliciesResponse = RegistryPolicies & { /** * The response body as parsed JSON or XML */ - parsedBody: RegistryPolicies; + parsedBody: Run; }; }; /** - * Contains response data for the scheduleRun operation. + * Contains response data for the getBuildSourceUploadUrl operation. */ -export type RegistriesScheduleRunResponse = Run & { +export type RegistriesGetBuildSourceUploadUrlResponse = SourceUploadDefinition & { /** * The underlying HTTP response. */ @@ -2716,14 +2978,14 @@ export type RegistriesScheduleRunResponse = Run & { /** * The response body as parsed JSON or XML */ - parsedBody: Run; + parsedBody: SourceUploadDefinition; }; }; /** - * Contains response data for the getBuildSourceUploadUrl operation. + * Contains response data for the generateCredentials operation. */ -export type RegistriesGetBuildSourceUploadUrlResponse = SourceUploadDefinition & { +export type RegistriesGenerateCredentialsResponse = GenerateCredentialsResult & { /** * The underlying HTTP response. */ @@ -2736,7 +2998,7 @@ export type RegistriesGetBuildSourceUploadUrlResponse = SourceUploadDefinition & /** * The response body as parsed JSON or XML */ - parsedBody: SourceUploadDefinition; + parsedBody: GenerateCredentialsResult; }; }; @@ -2781,9 +3043,9 @@ export type RegistriesBeginUpdateResponse = Registry & { }; /** - * Contains response data for the beginUpdatePolicies operation. + * Contains response data for the beginScheduleRun operation. */ -export type RegistriesBeginUpdatePoliciesResponse = RegistryPolicies & { +export type RegistriesBeginScheduleRunResponse = Run & { /** * The underlying HTTP response. */ @@ -2796,14 +3058,14 @@ export type RegistriesBeginUpdatePoliciesResponse = RegistryPolicies & { /** * The response body as parsed JSON or XML */ - parsedBody: RegistryPolicies; + parsedBody: Run; }; }; /** - * Contains response data for the beginScheduleRun operation. + * Contains response data for the beginGenerateCredentials operation. */ -export type RegistriesBeginScheduleRunResponse = Run & { +export type RegistriesBeginGenerateCredentialsResponse = GenerateCredentialsResult & { /** * The underlying HTTP response. */ @@ -2816,7 +3078,7 @@ export type RegistriesBeginScheduleRunResponse = Run & { /** * The response body as parsed JSON or XML */ - parsedBody: Run; + parsedBody: GenerateCredentialsResult; }; }; @@ -3539,3 +3801,283 @@ export type TasksListNextResponse = TaskListResult & { parsedBody: TaskListResult; }; }; + +/** + * Contains response data for the get operation. + */ +export type ScopeMapsGetResponse = ScopeMap & { + /** + * 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: ScopeMap; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ScopeMapsCreateResponse = ScopeMap & { + /** + * 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: ScopeMap; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ScopeMapsUpdateResponse = ScopeMap & { + /** + * 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: ScopeMap; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ScopeMapsListResponse = ScopeMapListResult & { + /** + * 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: ScopeMapListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type ScopeMapsBeginCreateResponse = ScopeMap & { + /** + * 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: ScopeMap; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type ScopeMapsBeginUpdateResponse = ScopeMap & { + /** + * 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: ScopeMap; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ScopeMapsListNextResponse = ScopeMapListResult & { + /** + * 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: ScopeMapListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type TokensGetResponse = Token & { + /** + * 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: Token; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type TokensCreateResponse = Token & { + /** + * 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: Token; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type TokensUpdateResponse = Token & { + /** + * 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: Token; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type TokensListResponse = TokenListResult & { + /** + * 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: TokenListResult; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type TokensBeginCreateResponse = Token & { + /** + * 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: Token; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type TokensBeginUpdateResponse = Token & { + /** + * 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: Token; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type TokensListNextResponse = TokenListResult & { + /** + * 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: TokenListResult; + }; +}; diff --git a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts index c6ae62b70209..f06ad8ccc203 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/mappers.ts @@ -339,11 +339,11 @@ export const Sku: msRest.CompositeMapper = { } }; -export const Status: msRest.CompositeMapper = { +export const Status1: msRest.CompositeMapper = { serializedName: "Status", type: { name: "Composite", - className: "Status", + className: "Status1", modelProperties: { displayStatus: { readOnly: true, @@ -477,6 +477,104 @@ export const NetworkRuleSet: msRest.CompositeMapper = { } }; +export const QuarantinePolicy: msRest.CompositeMapper = { + serializedName: "QuarantinePolicy", + type: { + name: "Composite", + className: "QuarantinePolicy", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const TrustPolicy: msRest.CompositeMapper = { + serializedName: "TrustPolicy", + type: { + name: "Composite", + className: "TrustPolicy", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const RetentionPolicy: msRest.CompositeMapper = { + serializedName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy", + modelProperties: { + days: { + serializedName: "days", + type: { + name: "Number" + } + }, + lastUpdatedTime: { + readOnly: true, + serializedName: "lastUpdatedTime", + type: { + name: "DateTime" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const Policies: msRest.CompositeMapper = { + serializedName: "Policies", + type: { + name: "Composite", + className: "Policies", + modelProperties: { + quarantinePolicy: { + serializedName: "quarantinePolicy", + type: { + name: "Composite", + className: "QuarantinePolicy" + } + }, + trustPolicy: { + serializedName: "trustPolicy", + type: { + name: "Composite", + className: "TrustPolicy" + } + }, + retentionPolicy: { + serializedName: "retentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -567,7 +665,7 @@ export const Registry: msRest.CompositeMapper = { serializedName: "properties.status", type: { name: "Composite", - className: "Status" + className: "Status1" } }, adminUserEnabled: { @@ -590,6 +688,13 @@ export const Registry: msRest.CompositeMapper = { name: "Composite", className: "NetworkRuleSet" } + }, + policies: { + serializedName: "properties.policies", + type: { + name: "Composite", + className: "Policies" + } } } } @@ -625,18 +730,18 @@ export const RegistryUpdateParameters: msRest.CompositeMapper = { name: "Boolean" } }, - storageAccount: { - serializedName: "properties.storageAccount", + networkRuleSet: { + serializedName: "properties.networkRuleSet", type: { name: "Composite", - className: "StorageAccountProperties" + className: "NetworkRuleSet" } }, - networkRuleSet: { - serializedName: "properties.networkRuleSet", + policies: { + serializedName: "properties.policies", type: { name: "Composite", - className: "NetworkRuleSet" + className: "Policies" } } } @@ -774,68 +879,6 @@ export const RegistryUsageListResult: msRest.CompositeMapper = { } }; -export const QuarantinePolicy: msRest.CompositeMapper = { - serializedName: "QuarantinePolicy", - type: { - name: "Composite", - className: "QuarantinePolicy", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String" - } - } - } - } -}; - -export const TrustPolicy: msRest.CompositeMapper = { - serializedName: "TrustPolicy", - type: { - name: "Composite", - className: "TrustPolicy", - modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } - }, - status: { - serializedName: "status", - type: { - name: "String" - } - } - } - } -}; - -export const RegistryPolicies: msRest.CompositeMapper = { - serializedName: "RegistryPolicies", - type: { - name: "Composite", - className: "RegistryPolicies", - modelProperties: { - quarantinePolicy: { - serializedName: "quarantinePolicy", - type: { - name: "Composite", - className: "QuarantinePolicy" - } - }, - trustPolicy: { - serializedName: "trustPolicy", - type: { - name: "Composite", - className: "TrustPolicy" - } - } - } - } -}; - export const Replication: msRest.CompositeMapper = { serializedName: "Replication", type: { @@ -855,7 +898,7 @@ export const Replication: msRest.CompositeMapper = { serializedName: "properties.status", type: { name: "Composite", - className: "Status" + className: "Status1" } } } @@ -1608,6 +1651,28 @@ export const AgentProperties: msRest.CompositeMapper = { } }; +export const TimerTriggerDescriptor: msRest.CompositeMapper = { + serializedName: "TimerTriggerDescriptor", + type: { + name: "Composite", + className: "TimerTriggerDescriptor", + modelProperties: { + timerTriggerName: { + serializedName: "timerTriggerName", + type: { + name: "String" + } + }, + scheduleOccurrence: { + serializedName: "scheduleOccurrence", + type: { + name: "String" + } + } + } + } +}; + export const ProxyResource: msRest.CompositeMapper = { serializedName: "ProxyResource", type: { @@ -1770,6 +1835,13 @@ export const Run: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + timerTrigger: { + serializedName: "properties.timerTrigger", + type: { + name: "Composite", + className: "TimerTriggerDescriptor" + } } } } @@ -3429,6 +3501,322 @@ export const EncodedTaskStepUpdateParameters: msRest.CompositeMapper = { } }; +export const ScopeMap: msRest.CompositeMapper = { + serializedName: "ScopeMap", + type: { + name: "Composite", + className: "ScopeMap", + modelProperties: { + ...ProxyResource.type.modelProperties, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + scopeMapType: { + readOnly: true, + serializedName: "properties.type", + type: { + name: "String" + } + }, + creationDate: { + readOnly: true, + serializedName: "properties.creationDate", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + actions: { + required: true, + serializedName: "properties.actions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ScopeMapUpdateParameters: msRest.CompositeMapper = { + serializedName: "ScopeMapUpdateParameters", + type: { + name: "Composite", + className: "ScopeMapUpdateParameters", + modelProperties: { + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + actions: { + serializedName: "properties.actions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const TokenCertificate: msRest.CompositeMapper = { + serializedName: "TokenCertificate", + type: { + name: "Composite", + className: "TokenCertificate", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + expiry: { + serializedName: "expiry", + type: { + name: "DateTime" + } + }, + thumbprint: { + serializedName: "thumbprint", + type: { + name: "String" + } + }, + encodedPemCertificate: { + serializedName: "encodedPemCertificate", + type: { + name: "String" + } + } + } + } +}; + +export const TokenPassword: msRest.CompositeMapper = { + serializedName: "TokenPassword", + type: { + name: "Composite", + className: "TokenPassword", + modelProperties: { + creationTime: { + serializedName: "creationTime", + type: { + name: "DateTime" + } + }, + expiry: { + serializedName: "expiry", + type: { + name: "DateTime" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const TokenCredentialsProperties: msRest.CompositeMapper = { + serializedName: "TokenCredentialsProperties", + type: { + name: "Composite", + className: "TokenCredentialsProperties", + modelProperties: { + certificates: { + serializedName: "certificates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TokenCertificate" + } + } + } + }, + passwords: { + serializedName: "passwords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TokenPassword" + } + } + } + } + } + } +}; + +export const Token: msRest.CompositeMapper = { + serializedName: "Token", + type: { + name: "Composite", + className: "Token", + modelProperties: { + ...ProxyResource.type.modelProperties, + creationDate: { + readOnly: true, + serializedName: "properties.creationDate", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + scopeMapId: { + serializedName: "properties.scopeMapId", + type: { + name: "String" + } + }, + objectId: { + serializedName: "properties.objectId", + type: { + name: "String" + } + }, + credentials: { + serializedName: "properties.credentials", + type: { + name: "Composite", + className: "TokenCredentialsProperties" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + } + } + } +}; + +export const TokenUpdateParameters: msRest.CompositeMapper = { + serializedName: "TokenUpdateParameters", + type: { + name: "Composite", + className: "TokenUpdateParameters", + modelProperties: { + scopeMapId: { + serializedName: "properties.scopeMapId", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + }, + credentials: { + serializedName: "properties.credentials", + type: { + name: "Composite", + className: "TokenCredentialsProperties" + } + } + } + } +}; + +export const GenerateCredentialsParameters: msRest.CompositeMapper = { + serializedName: "GenerateCredentialsParameters", + type: { + name: "Composite", + className: "GenerateCredentialsParameters", + modelProperties: { + tokenId: { + serializedName: "tokenId", + type: { + name: "String" + } + }, + expiry: { + serializedName: "expiry", + defaultValue: new Date('9999-12-31T15:59:59.9999999-08:00'), + type: { + name: "DateTime" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const GenerateCredentialsResult: msRest.CompositeMapper = { + serializedName: "GenerateCredentialsResult", + type: { + name: "Composite", + className: "GenerateCredentialsResult", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + passwords: { + serializedName: "passwords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TokenPassword" + } + } + } + } + } + } +}; + export const RegistryListResult: msRest.CompositeMapper = { serializedName: "RegistryListResult", type: { @@ -3625,6 +4013,62 @@ export const TaskListResult: msRest.CompositeMapper = { } }; +export const ScopeMapListResult: msRest.CompositeMapper = { + serializedName: "ScopeMapListResult", + type: { + name: "Composite", + className: "ScopeMapListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScopeMap" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const TokenListResult: msRest.CompositeMapper = { + serializedName: "TokenListResult", + type: { + name: "Composite", + className: "TokenListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Token" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const discriminators = { 'RunRequest' : RunRequest, 'TaskStepProperties' : TaskStepProperties, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts b/sdk/containerregistry/arm-containerregistry/src/models/parameters.ts index 1774992faa36..a976d66732d5 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: '2017-10-01', + defaultValue: '2019-05-01', type: { name: "String" } @@ -44,6 +44,18 @@ export const apiVersion1: msRest.OperationQueryParameter = { } } }; +export const apiVersion2: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2019-05-01-preview', + type: { + name: "String" + } + } +}; export const filter: msRest.OperationQueryParameter = { parameterPath: [ "options", @@ -120,6 +132,21 @@ export const runId: msRest.OperationURLParameter = { } } }; +export const scopeMapName: msRest.OperationURLParameter = { + parameterPath: "scopeMapName", + mapper: { + required: true, + serializedName: "scopeMapName", + constraints: { + MaxLength: 50, + MinLength: 5, + Pattern: /^[a-zA-Z0-9-]*$/ + }, + type: { + name: "String" + } + } +}; export const subscriptionId: msRest.OperationURLParameter = { parameterPath: "subscriptionId", mapper: { @@ -145,6 +172,21 @@ export const taskName: msRest.OperationURLParameter = { } } }; +export const tokenName: msRest.OperationURLParameter = { + parameterPath: "tokenName", + mapper: { + required: true, + serializedName: "tokenName", + constraints: { + MaxLength: 50, + MinLength: 5, + Pattern: /^[a-zA-Z0-9-]*$/ + }, + type: { + name: "String" + } + } +}; export const top: msRest.OperationQueryParameter = { parameterPath: [ "options", diff --git a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts index f22b1a37f9d1..b35473a97ee1 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/registriesMappers.ts @@ -23,6 +23,8 @@ export { EncodedTaskStep, FileTaskRunRequest, FileTaskStep, + GenerateCredentialsParameters, + GenerateCredentialsResult, IdentityProperties, ImageDescriptor, ImageUpdateTrigger, @@ -32,6 +34,7 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, QuarantinePolicy, RegenerateCredentialParameters, @@ -41,14 +44,15 @@ export { RegistryNameCheckRequest, RegistryNameStatus, RegistryPassword, - RegistryPolicies, RegistryUpdateParameters, RegistryUsage, RegistryUsageListResult, Replication, Resource, + RetentionPolicy, Run, RunRequest, + ScopeMap, SecretObject, SetValue, Sku, @@ -57,12 +61,17 @@ export { SourceTrigger, SourceTriggerDescriptor, SourceUploadDefinition, - Status, + Status1, StorageAccountProperties, Task, TaskRunRequest, TaskStepProperties, TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, TriggerProperties, TrustPolicy, UserIdentityProperties, diff --git a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts index 648f983bfd46..db474e0504a4 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/replicationsMappers.ts @@ -26,13 +26,17 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, ReplicationListResult, ReplicationUpdateParameters, Resource, + RetentionPolicy, Run, + ScopeMap, SecretObject, SetValue, Sku, @@ -40,12 +44,18 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status, + Status1, StorageAccountProperties, Task, TaskStepProperties, TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts index b43e88ad70db..60c968c59c3a 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/runsMappers.ts @@ -26,14 +26,18 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Resource, + RetentionPolicy, Run, RunGetLogResult, RunListResult, RunUpdateParameters, + ScopeMap, SecretObject, SetValue, Sku, @@ -41,12 +45,18 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status, + Status1, StorageAccountProperties, Task, TaskStepProperties, TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts new file mode 100644 index 000000000000..7acf439888cb --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/models/scopeMapsMappers.ts @@ -0,0 +1,62 @@ +/* + * 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, + CloudError, + Credentials, + CustomRegistryCredentials, + DockerBuildStep, + EncodedTaskStep, + FileTaskStep, + IdentityProperties, + ImageDescriptor, + ImageUpdateTrigger, + IPRule, + NetworkRuleSet, + PlatformProperties, + Policies, + ProxyResource, + QuarantinePolicy, + Registry, + Replication, + Resource, + RetentionPolicy, + Run, + ScopeMap, + ScopeMapListResult, + ScopeMapUpdateParameters, + SecretObject, + SetValue, + Sku, + SourceProperties, + SourceRegistryCredentials, + SourceTrigger, + SourceTriggerDescriptor, + Status1, + StorageAccountProperties, + Task, + 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 4706b4b43f44..3cdb2ace5658 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/tasksMappers.ts @@ -32,11 +32,15 @@ export { NetworkRuleSet, PlatformProperties, PlatformUpdateParameters, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Resource, + RetentionPolicy, Run, + ScopeMap, SecretObject, SetValue, Sku, @@ -46,7 +50,7 @@ export { SourceTriggerDescriptor, SourceTriggerUpdateParameters, SourceUpdateParameters, - Status, + Status1, StorageAccountProperties, Task, TaskListResult, @@ -54,9 +58,15 @@ export { TaskStepUpdateParameters, TaskUpdateParameters, TimerTrigger, + TimerTriggerDescriptor, TimerTriggerUpdateParameters, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, TriggerProperties, TriggerUpdateParameters, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook diff --git a/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts new file mode 100644 index 000000000000..72b11906e68f --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/models/tokensMappers.ts @@ -0,0 +1,62 @@ +/* + * 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, + CloudError, + Credentials, + CustomRegistryCredentials, + DockerBuildStep, + EncodedTaskStep, + FileTaskStep, + IdentityProperties, + ImageDescriptor, + ImageUpdateTrigger, + IPRule, + NetworkRuleSet, + PlatformProperties, + Policies, + ProxyResource, + QuarantinePolicy, + Registry, + Replication, + Resource, + RetentionPolicy, + Run, + ScopeMap, + SecretObject, + SetValue, + Sku, + SourceProperties, + SourceRegistryCredentials, + SourceTrigger, + SourceTriggerDescriptor, + Status1, + StorageAccountProperties, + Task, + TaskStepProperties, + TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenListResult, + TokenPassword, + TokenUpdateParameters, + TriggerProperties, + TrustPolicy, + UserIdentityProperties, + VirtualNetworkRule, + Webhook +} from "../models/mappers"; diff --git a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts index 38344b3cd1c0..ba570b7f3e2f 100644 --- a/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts +++ b/sdk/containerregistry/arm-containerregistry/src/models/webhooksMappers.ts @@ -34,12 +34,16 @@ export { IPRule, NetworkRuleSet, PlatformProperties, + Policies, ProxyResource, + QuarantinePolicy, Registry, Replication, Request, Resource, + RetentionPolicy, Run, + ScopeMap, SecretObject, SetValue, Sku, @@ -48,13 +52,19 @@ export { SourceRegistryCredentials, SourceTrigger, SourceTriggerDescriptor, - Status, + Status1, StorageAccountProperties, Target, Task, TaskStepProperties, TimerTrigger, + TimerTriggerDescriptor, + Token, + TokenCertificate, + TokenCredentialsProperties, + TokenPassword, TriggerProperties, + TrustPolicy, UserIdentityProperties, VirtualNetworkRule, Webhook, diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts index 432e208722fb..1e3175a05f2c 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/index.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/index.ts @@ -14,3 +14,5 @@ export * from "./replications"; export * from "./webhooks"; export * from "./runs"; 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 23020287122a..6e7146247bff 100644 --- a/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts +++ b/sdk/containerregistry/arm-containerregistry/src/operations/registries.ts @@ -294,52 +294,6 @@ export class Registries { callback) as Promise; } - /** - * Lists the policies for the 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 - */ - listPolicies(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 - */ - listPolicies(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 - */ - listPolicies(resourceGroupName: string, registryName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listPolicies(resourceGroupName: string, registryName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - registryName, - options - }, - listPoliciesOperationSpec, - callback) as Promise; - } - - /** - * Updates the policies for the 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 registryPoliciesUpdateParameters The parameters for updating policies of a container - * registry. - * @param [options] The optional parameters - * @returns Promise - */ - updatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: Models.RegistryPolicies, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdatePolicies(resourceGroupName,registryName,registryPoliciesUpdateParameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } - /** * Schedules a new run based on the request parameters and add it to the run queue. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -385,6 +339,19 @@ export class Registries { callback) as Promise; } + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @param [options] The optional parameters + * @returns Promise + */ + generateCredentials(resourceGroupName: string, registryName: string, generateCredentialsParameters: Models.GenerateCredentialsParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginGenerateCredentials(resourceGroupName,registryName,generateCredentialsParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Copies an image to this container registry from the specified container registry. * @param resourceGroupName The name of the resource group to which the container registry belongs. @@ -464,43 +431,42 @@ export class Registries { } /** - * Updates the policies for the specified container registry. + * Schedules a new run based on the request parameters and add it to the run queue. * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param registryName The name of the container registry. - * @param registryPoliciesUpdateParameters The parameters for updating policies of a container - * registry. + * @param runRequest The parameters of a run that needs to scheduled. * @param [options] The optional parameters * @returns Promise */ - beginUpdatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: Models.RegistryPolicies, options?: msRest.RequestOptionsBase): Promise { + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: Models.RunRequestUnion, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, registryName, - registryPoliciesUpdateParameters, + runRequest, options }, - beginUpdatePoliciesOperationSpec, + beginScheduleRunOperationSpec, options); } /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Generate keys for a token of 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 runRequest The parameters of a run that needs to scheduled. + * @param generateCredentialsParameters The parameters for generating credentials. * @param [options] The optional parameters * @returns Promise */ - beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: Models.RunRequestUnion, options?: msRest.RequestOptionsBase): Promise { + beginGenerateCredentials(resourceGroupName: string, registryName: string, generateCredentialsParameters: Models.GenerateCredentialsParameters, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, registryName, - runRequest, + generateCredentialsParameters, options }, - beginScheduleRunOperationSpec, + beginGenerateCredentialsOperationSpec, options); } @@ -747,31 +713,6 @@ const listUsagesOperationSpec: msRest.OperationSpec = { serializer }; -const listPoliciesOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.registryName - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.RegistryPolicies - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - const getBuildSourceUploadUrlOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl", @@ -923,30 +864,30 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { serializer }; -const beginUpdatePoliciesOperationSpec: msRest.OperationSpec = { +const beginScheduleRunOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.registryName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion1 ], headerParameters: [ Parameters.acceptLanguage ], requestBody: { - parameterPath: "registryPoliciesUpdateParameters", + parameterPath: "runRequest", mapper: { - ...Mappers.RegistryPolicies, + ...Mappers.RunRequest, required: true } }, responses: { 200: { - bodyMapper: Mappers.RegistryPolicies + bodyMapper: Mappers.Run }, 202: {}, default: { @@ -956,30 +897,30 @@ const beginUpdatePoliciesOperationSpec: msRest.OperationSpec = { serializer }; -const beginScheduleRunOperationSpec: msRest.OperationSpec = { +const beginGenerateCredentialsOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.registryName ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion2 ], headerParameters: [ Parameters.acceptLanguage ], requestBody: { - parameterPath: "runRequest", + parameterPath: "generateCredentialsParameters", mapper: { - ...Mappers.RunRequest, + ...Mappers.GenerateCredentialsParameters, required: true } }, responses: { 200: { - bodyMapper: Mappers.Run + bodyMapper: Mappers.GenerateCredentialsResult }, 202: {}, default: { diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts b/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.ts new file mode 100644 index 000000000000..9c89ef449eeb --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operations/scopeMaps.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/scopeMapsMappers"; +import * as Parameters from "../models/parameters"; +import { ContainerRegistryManagementClientContext } from "../containerRegistryManagementClientContext"; + +/** Class representing a ScopeMaps. */ +export class ScopeMaps { + private readonly client: ContainerRegistryManagementClientContext; + + /** + * Create a ScopeMaps. + * @param {ContainerRegistryManagementClientContext} client Reference to the service client. + */ + constructor(client: ContainerRegistryManagementClientContext) { + this.client = client; + } + + /** + * Gets the properties of the specified scope map. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, registryName: string, scopeMapName: 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 scopeMapName The name of the scope map. + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, scopeMapName: 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 scopeMapName The name of the scope map. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, scopeMapName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, registryName: string, scopeMapName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + registryName, + scopeMapName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, registryName: string, scopeMapName: string, scopeMapCreateParameters: Models.ScopeMap, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,registryName,scopeMapName,scopeMapCreateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, registryName: string, scopeMapName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,registryName,scopeMapName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, registryName: string, scopeMapName: string, scopeMapUpdateParameters: Models.ScopeMapUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,registryName,scopeMapName,scopeMapUpdateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Lists all the scope maps for the 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 scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, registryName: string, scopeMapName: string, scopeMapCreateParameters: Models.ScopeMap, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + scopeMapName, + scopeMapCreateParameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, registryName: string, scopeMapName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + scopeMapName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, registryName: string, scopeMapName: string, scopeMapUpdateParameters: Models.ScopeMapUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + scopeMapName, + scopeMapUpdateParameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Lists all the scope maps for the 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}/scopeMaps/{scopeMapName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.scopeMapName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ScopeMap + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ScopeMapListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.scopeMapName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "scopeMapCreateParameters", + mapper: { + ...Mappers.ScopeMap, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ScopeMap + }, + 201: { + bodyMapper: Mappers.ScopeMap + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.scopeMapName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.scopeMapName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "scopeMapUpdateParameters", + mapper: { + ...Mappers.ScopeMapUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ScopeMap + }, + 201: { + bodyMapper: Mappers.ScopeMap + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ScopeMapListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts b/sdk/containerregistry/arm-containerregistry/src/operations/tokens.ts new file mode 100644 index 000000000000..3a141523baaf --- /dev/null +++ b/sdk/containerregistry/arm-containerregistry/src/operations/tokens.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/tokensMappers"; +import * as Parameters from "../models/parameters"; +import { ContainerRegistryManagementClientContext } from "../containerRegistryManagementClientContext"; + +/** Class representing a Tokens. */ +export class Tokens { + private readonly client: ContainerRegistryManagementClientContext; + + /** + * Create a Tokens. + * @param {ContainerRegistryManagementClientContext} client Reference to the service client. + */ + constructor(client: ContainerRegistryManagementClientContext) { + this.client = client; + } + + /** + * Gets the properties of the specified token. + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, registryName: string, tokenName: 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 tokenName The name of the token. + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, tokenName: 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 tokenName The name of the token. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, registryName: string, tokenName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, registryName: string, tokenName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + registryName, + tokenName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, registryName: string, tokenName: string, tokenCreateParameters: Models.Token, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,registryName,tokenName,tokenCreateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, registryName: string, tokenName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,registryName,tokenName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, registryName: string, tokenName: string, tokenUpdateParameters: Models.TokenUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,registryName,tokenName,tokenUpdateParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Lists all the tokens for the 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 token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, registryName: string, tokenName: string, tokenCreateParameters: Models.Token, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + tokenName, + tokenCreateParameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, registryName: string, tokenName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + tokenName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, registryName: string, tokenName: string, tokenUpdateParameters: Models.TokenUpdateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + registryName, + tokenName, + tokenUpdateParameters, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Lists all the tokens for the 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}/tokens/{tokenName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.tokenName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Token + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TokenListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.tokenName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "tokenCreateParameters", + mapper: { + ...Mappers.Token, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Token + }, + 201: { + bodyMapper: Mappers.Token + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.tokenName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.registryName, + Parameters.tokenName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "tokenUpdateParameters", + mapper: { + ...Mappers.TokenUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Token + }, + 201: { + bodyMapper: Mappers.Token + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.TokenListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +};