diff --git a/sdk/storage/arm-storage/lib/models/blobContainersMappers.ts b/sdk/storage/arm-storage/lib/models/blobContainersMappers.ts new file mode 100644 index 000000000000..72a8be538a41 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/blobContainersMappers.ts @@ -0,0 +1,64 @@ +/* + * 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 { + ListContainerItems, + ListContainerItem, + AzureEntityResource, + Resource, + BaseResource, + ImmutabilityPolicyProperties, + UpdateHistoryProperty, + LegalHoldProperties, + TagProperty, + CloudError, + BlobContainer, + LegalHold, + ImmutabilityPolicy, + BlobContainersCreateOrUpdateImmutabilityPolicyHeaders, + BlobContainersGetImmutabilityPolicyHeaders, + BlobContainersDeleteImmutabilityPolicyHeaders, + BlobContainersLockImmutabilityPolicyHeaders, + BlobContainersExtendImmutabilityPolicyHeaders, + LeaseContainerRequest, + LeaseContainerResponse, + ManagementPolicy, + ManagementPolicySchema, + ManagementPolicyRule, + ManagementPolicyDefinition, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + DateAfterModification, + ManagementPolicySnapShot, + DateAfterCreation, + ManagementPolicyFilter, + ProxyResource, + TrackedResource, + BlobServiceProperties, + CorsRules, + CorsRule, + DeleteRetentionPolicy, + StorageAccount, + Sku, + SKUCapability, + Restriction, + Identity, + Endpoints, + CustomDomain, + Encryption, + EncryptionServices, + EncryptionService, + KeyVaultProperties, + NetworkRuleSet, + VirtualNetworkRule, + IPRule, + GeoReplicationStats +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/blobServicesMappers.ts b/sdk/storage/arm-storage/lib/models/blobServicesMappers.ts new file mode 100644 index 000000000000..d43ae9e6b394 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/blobServicesMappers.ts @@ -0,0 +1,55 @@ +/* + * 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 { + BlobServiceProperties, + Resource, + BaseResource, + CorsRules, + CorsRule, + DeleteRetentionPolicy, + CloudError, + ManagementPolicy, + ManagementPolicySchema, + ManagementPolicyRule, + ManagementPolicyDefinition, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + DateAfterModification, + ManagementPolicySnapShot, + DateAfterCreation, + ManagementPolicyFilter, + ProxyResource, + TrackedResource, + AzureEntityResource, + BlobContainer, + ImmutabilityPolicyProperties, + UpdateHistoryProperty, + LegalHoldProperties, + TagProperty, + ImmutabilityPolicy, + ListContainerItem, + StorageAccount, + Sku, + SKUCapability, + Restriction, + Identity, + Endpoints, + CustomDomain, + Encryption, + EncryptionServices, + EncryptionService, + KeyVaultProperties, + NetworkRuleSet, + VirtualNetworkRule, + IPRule, + GeoReplicationStats +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/index.ts b/sdk/storage/arm-storage/lib/models/index.ts new file mode 100644 index 000000000000..68eb17c66707 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/index.ts @@ -0,0 +1,3099 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing OperationDisplay. + * Display metadata associated with the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft Storage. + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed + * etc. + */ + resource?: string; + /** + * @member {string} [operation] Type of operation: get, read, delete, etc. + */ + operation?: string; + /** + * @member {string} [description] Description of the operation. + */ + description?: string; +} + +/** + * @interface + * An interface representing Dimension. + * Dimension of blobs, possibly be blob type or access tier. + * + */ +export interface Dimension { + /** + * @member {string} [name] Display name of dimension. + */ + name?: string; + /** + * @member {string} [displayName] Display name of dimension. + */ + displayName?: string; +} + +/** + * @interface + * An interface representing MetricSpecification. + * Metric specification of operation. + * + */ +export interface MetricSpecification { + /** + * @member {string} [name] Name of metric specification. + */ + name?: string; + /** + * @member {string} [displayName] Display name of metric specification. + */ + displayName?: string; + /** + * @member {string} [displayDescription] Display description of metric + * specification. + */ + displayDescription?: string; + /** + * @member {string} [unit] Unit could be Bytes or Count. + */ + unit?: string; + /** + * @member {Dimension[]} [dimensions] Dimensions of blobs, including blob + * type and access tier. + */ + dimensions?: Dimension[]; + /** + * @member {string} [aggregationType] Aggregation type could be Average. + */ + aggregationType?: string; + /** + * @member {boolean} [fillGapWithZero] The property to decide fill gap with + * zero or not. + */ + fillGapWithZero?: boolean; + /** + * @member {string} [category] The category this metric specification belong + * to, could be Capacity. + */ + category?: string; + /** + * @member {string} [resourceIdDimensionNameOverride] Account Resource Id. + */ + resourceIdDimensionNameOverride?: string; +} + +/** + * @interface + * An interface representing ServiceSpecification. + * One property of operation, include metric specifications. + * + */ +export interface ServiceSpecification { + /** + * @member {MetricSpecification[]} [metricSpecifications] Metric + * specifications of operation. + */ + metricSpecifications?: MetricSpecification[]; +} + +/** + * @interface + * An interface representing Operation. + * Storage REST API operation definition. + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] Display metadata associated with the + * operation. + */ + display?: OperationDisplay; + /** + * @member {string} [origin] The origin of operations. + */ + origin?: string; + /** + * @member {ServiceSpecification} [serviceSpecification] One property of + * operation, include metric specifications. + */ + serviceSpecification?: ServiceSpecification; +} + +/** + * @interface + * An interface representing StorageAccountCheckNameAvailabilityParameters. + * The parameters used to check the availability of the storage account name. + * + */ +export interface StorageAccountCheckNameAvailabilityParameters { + /** + * @member {string} name The storage account name. + */ + name: string; +} + +/** + * @interface + * An interface representing SKUCapability. + * The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + * + */ +export interface SKUCapability { + /** + * @member {string} [name] The name of capability, The capability information + * in the specified SKU, including file encryption, network ACLs, change + * notification, etc. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [value] A string value to indicate states of given + * capability. Possibly 'true' or 'false'. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly value?: string; +} + +/** + * @interface + * An interface representing Restriction. + * The restriction because of which SKU cannot be used. + * + */ +export interface Restriction { + /** + * @member {string} [type] The type of restrictions. As of now only possible + * value for this is location. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string[]} [values] The value of restrictions. If the restriction + * type is set to location. This would be different locations where the SKU + * is restricted. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly values?: string[]; + /** + * @member {ReasonCode} [reasonCode] The reason for the restriction. As of + * now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is + * set when the SKU has requiredQuotas parameter as the subscription does not + * belong to that quota. The "NotAvailableForSubscription" is related to + * capacity at DC. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription' + */ + reasonCode?: ReasonCode; +} + +/** + * @interface + * An interface representing Sku. + * The SKU of the storage account. + * + */ +export interface Sku { + /** + * @member {SkuName} name Gets or sets the SKU name. Required for account + * creation; optional for update. Note that in older versions, SKU name was + * called accountType. Possible values include: 'Standard_LRS', + * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + * 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + */ + name: SkuName; + /** + * @member {SkuTier} [tier] Gets the SKU tier. This is based on the SKU name. + * Possible values include: 'Standard', 'Premium' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tier?: SkuTier; + /** + * @member {string} [resourceType] The type of the resource, usually it is + * 'storageAccounts'. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resourceType?: string; + /** + * @member {Kind} [kind] Indicates the type of storage account. Possible + * values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly kind?: Kind; + /** + * @member {string[]} [locations] The set of locations that the SKU is + * available. This will be supported and registered Azure Geo Regions (e.g. + * West US, East US, Southeast Asia, etc.). + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly locations?: string[]; + /** + * @member {SKUCapability[]} [capabilities] The capability information in the + * specified SKU, including file encryption, network ACLs, change + * notification, etc. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly capabilities?: SKUCapability[]; + /** + * @member {Restriction[]} [restrictions] The restrictions because of which + * SKU cannot be used. This is empty if there are no restrictions. + */ + restrictions?: Restriction[]; +} + +/** + * @interface + * An interface representing CheckNameAvailabilityResult. + * The CheckNameAvailability operation response. + * + */ +export interface CheckNameAvailabilityResult { + /** + * @member {boolean} [nameAvailable] Gets a boolean value that indicates + * whether the name is available for you to use. If true, the name is + * available. If false, the name has already been taken or is invalid and + * cannot be used. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nameAvailable?: boolean; + /** + * @member {Reason} [reason] Gets the reason that a storage account name + * could not be used. The Reason element is only returned if NameAvailable is + * false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly reason?: Reason; + /** + * @member {string} [message] Gets an error message explaining the Reason + * value in more detail. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing CustomDomain. + * The custom domain assigned to this storage account. This can be set via + * Update. + * + */ +export interface CustomDomain { + /** + * @member {string} name Gets or sets the custom domain name assigned to the + * storage account. Name is the CNAME source. + */ + name: string; + /** + * @member {boolean} [useSubDomainName] Indicates whether indirect CName + * validation is enabled. Default value is false. This should only be set on + * updates. + */ + useSubDomainName?: boolean; +} + +/** + * @interface + * An interface representing EncryptionService. + * A service that allows server-side encryption to be used. + * + */ +export interface EncryptionService { + /** + * @member {boolean} [enabled] A boolean indicating whether or not the + * service encrypts the data as it is stored. + */ + enabled?: boolean; + /** + * @member {Date} [lastEnabledTime] Gets a rough estimate of the date/time + * when the encryption was last enabled by the user. Only returned when + * encryption is enabled. There might be some unencrypted blobs which were + * written after this time, as it is just a rough estimate. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastEnabledTime?: Date; +} + +/** + * @interface + * An interface representing EncryptionServices. + * A list of services that support encryption. + * + */ +export interface EncryptionServices { + /** + * @member {EncryptionService} [blob] The encryption function of the blob + * storage service. + */ + blob?: EncryptionService; + /** + * @member {EncryptionService} [file] The encryption function of the file + * storage service. + */ + file?: EncryptionService; + /** + * @member {EncryptionService} [table] The encryption function of the table + * storage service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly table?: EncryptionService; + /** + * @member {EncryptionService} [queue] The encryption function of the queue + * storage service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly queue?: EncryptionService; +} + +/** + * @interface + * An interface representing KeyVaultProperties. + * Properties of key vault. + * + */ +export interface KeyVaultProperties { + /** + * @member {string} [keyName] The name of KeyVault key. + */ + keyName?: string; + /** + * @member {string} [keyVersion] The version of KeyVault key. + */ + keyVersion?: string; + /** + * @member {string} [keyVaultUri] The Uri of KeyVault. + */ + keyVaultUri?: string; +} + +/** + * @interface + * An interface representing Encryption. + * The encryption settings on the storage account. + * + */ +export interface Encryption { + /** + * @member {EncryptionServices} [services] List of services which support + * encryption. + */ + services?: EncryptionServices; + /** + * @member {KeySource} keySource The encryption keySource (provider). + * Possible values (case-insensitive): Microsoft.Storage, + * Microsoft.Keyvault. Possible values include: 'Microsoft.Storage', + * 'Microsoft.Keyvault'. Default value: 'Microsoft.Storage' . + */ + keySource: KeySource; + /** + * @member {KeyVaultProperties} [keyVaultProperties] Properties provided by + * key vault. + */ + keyVaultProperties?: KeyVaultProperties; +} + +/** + * @interface + * An interface representing VirtualNetworkRule. + * Virtual Network rule. + * + */ +export interface VirtualNetworkRule { + /** + * @member {string} virtualNetworkResourceId Resource ID of a subnet, for + * example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + virtualNetworkResourceId: string; + /** + * @member {Action} [action] The action of virtual network rule. Possible + * values include: 'Allow'. Default value: 'Allow' . + */ + action?: Action; + /** + * @member {State} [state] Gets the state of virtual network rule. Possible + * values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted' + */ + state?: State; +} + +/** + * @interface + * An interface representing IPRule. + * IP rule with specific IP or IP range in CIDR format. + * + */ +export interface IPRule { + /** + * @member {string} iPAddressOrRange Specifies the IP or IP range in CIDR + * format. Only IPV4 address is allowed. + */ + iPAddressOrRange: string; + /** + * @member {Action} [action] The action of IP ACL rule. Possible values + * include: 'Allow'. Default value: 'Allow' . + */ + action?: Action; +} + +/** + * @interface + * An interface representing NetworkRuleSet. + * Network rule set + * + */ +export interface NetworkRuleSet { + /** + * @member {Bypass} [bypass] Specifies whether traffic is bypassed for + * Logging/Metrics/AzureServices. Possible values are any combination of + * Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + * to bypass none of those traffics. Possible values include: 'None', + * 'Logging', 'Metrics', 'AzureServices'. Default value: 'AzureServices' . + */ + bypass?: Bypass; + /** + * @member {VirtualNetworkRule[]} [virtualNetworkRules] Sets the virtual + * network rules + */ + virtualNetworkRules?: VirtualNetworkRule[]; + /** + * @member {IPRule[]} [ipRules] Sets the IP ACL rules + */ + ipRules?: IPRule[]; + /** + * @member {DefaultAction} defaultAction Specifies the default action of + * allow or deny when no other rules match. Possible values include: 'Allow', + * 'Deny'. Default value: 'Allow' . + */ + defaultAction: DefaultAction; +} + +/** + * @interface + * An interface representing Identity. + * Identity for the resource. + * + */ +export interface Identity { + /** + * @member {string} [principalId] The principal ID of resource identity. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly principalId?: string; + /** + * @member {string} [tenantId] The tenant ID of resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; +} + +/** + * @interface + * An interface representing StorageAccountCreateParameters. + * The parameters used when creating a storage account. + * + */ +export interface StorageAccountCreateParameters { + /** + * @member {Sku} sku Required. Gets or sets the SKU name. + */ + sku: Sku; + /** + * @member {Kind} kind Required. Indicates the type of storage account. + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + * 'FileStorage', 'BlockBlobStorage' + */ + kind: Kind; + /** + * @member {string} location Required. Gets or sets the location of the + * resource. This will be one of the supported and registered Azure Geo + * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo + * region is specified on update, the request will succeed. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Gets or sets a list of + * key value pairs that describe the resource. These tags can be used for + * viewing and grouping this resource (across resource groups). A maximum of + * 15 tags can be provided for a resource. Each tag must have a key with a + * length no greater than 128 characters and a value with a length no greater + * than 256 characters. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {Identity} [identity] The identity of the resource. + */ + identity?: Identity; + /** + * @member {CustomDomain} [customDomain] User domain assigned to the storage + * account. Name is the CNAME source. Only one custom domain is supported per + * storage account at this time. To clear the existing custom domain, use an + * empty string for the custom domain name property. + */ + customDomain?: CustomDomain; + /** + * @member {Encryption} [encryption] Provides the encryption settings on the + * account. If left unspecified the account encryption settings will remain + * the same. The default setting is unencrypted. + */ + encryption?: Encryption; + /** + * @member {NetworkRuleSet} [networkRuleSet] Network rule set + */ + networkRuleSet?: NetworkRuleSet; + /** + * @member {AccessTier} [accessTier] Required for storage accounts where kind + * = BlobStorage. The access tier used for billing. Possible values include: + * 'Hot', 'Cool' + */ + accessTier?: AccessTier; + /** + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. + */ + enableAzureFilesAadIntegration?: boolean; + /** + * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to + * storage service if sets to true. + */ + enableHttpsTrafficOnly?: boolean; + /** + * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if + * sets to true. + */ + isHnsEnabled?: boolean; +} + +/** + * @interface + * An interface representing Endpoints. + * The URIs that are used to perform a retrieval of a public blob, queue, + * table, web or dfs object. + * + */ +export interface Endpoints { + /** + * @member {string} [blob] Gets the blob endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly blob?: string; + /** + * @member {string} [queue] Gets the queue endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly queue?: string; + /** + * @member {string} [table] Gets the table endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly table?: string; + /** + * @member {string} [file] Gets the file endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly file?: string; + /** + * @member {string} [web] Gets the web endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly web?: string; + /** + * @member {string} [dfs] Gets the dfs endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dfs?: string; +} + +/** + * @interface + * An interface representing GeoReplicationStats. + * Statistics related to replication for storage account's Blob, Table, Queue + * and File services. It is only available when geo-redundant replication is + * enabled for the storage account. + * + */ +export interface GeoReplicationStats { + /** + * @member {GeoReplicationStatus} [status] The status of the secondary + * location. Possible values are: - Live: Indicates that the secondary + * location is active and operational. - Bootstrap: Indicates initial + * synchronization from the primary location to the secondary location is in + * progress.This typically occurs when replication is first enabled. - + * Unavailable: Indicates that the secondary location is temporarily + * unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly status?: GeoReplicationStatus; + /** + * @member {Date} [lastSyncTime] All primary writes preceding this UTC + * date/time value are guaranteed to be available for read operations. + * Primary writes following this point in time may or may not be available + * for reads. Element may be default value if value of LastSyncTime is not + * available, this can happen if secondary is offline or we are in bootstrap. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastSyncTime?: Date; + /** + * @member {boolean} [canFailover] A boolean flag which indicates whether or + * not account failover is supported for the account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly canFailover?: boolean; +} + +/** + * @interface + * An interface representing Resource. + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource. Ex- + * Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing TrackedResource. + * The resource model definition for a ARM tracked top level resource + * + * @extends Resource + */ +export interface TrackedResource extends Resource { + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {string} location The geo-location where the resource lives + */ + location: string; +} + +/** + * @interface + * An interface representing StorageAccount. + * The storage account. + * + * @extends TrackedResource + */ +export interface StorageAccount extends TrackedResource { + /** + * @member {Sku} [sku] Gets the SKU. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly sku?: Sku; + /** + * @member {Kind} [kind] Gets the Kind. Possible values include: 'Storage', + * 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly kind?: Kind; + /** + * @member {Identity} [identity] The identity of the resource. + */ + identity?: Identity; + /** + * @member {ProvisioningState} [provisioningState] Gets the status of the + * storage account at the time the operation was called. Possible values + * include: 'Creating', 'ResolvingDNS', 'Succeeded' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {Endpoints} [primaryEndpoints] Gets the URLs that are used to + * perform a retrieval of a public blob, queue, or table object. Note that + * Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly primaryEndpoints?: Endpoints; + /** + * @member {string} [primaryLocation] Gets the location of the primary data + * center for the storage account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly primaryLocation?: string; + /** + * @member {AccountStatus} [statusOfPrimary] Gets the status indicating + * whether the primary location of the storage account is available or + * unavailable. Possible values include: 'available', 'unavailable' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly statusOfPrimary?: AccountStatus; + /** + * @member {Date} [lastGeoFailoverTime] Gets the timestamp of the most recent + * instance of a failover to the secondary location. Only the most recent + * timestamp is retained. This element is not returned if there has never + * been a failover instance. Only available if the accountType is + * Standard_GRS or Standard_RAGRS. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastGeoFailoverTime?: Date; + /** + * @member {string} [secondaryLocation] Gets the location of the + * geo-replicated secondary for the storage account. Only available if the + * accountType is Standard_GRS or Standard_RAGRS. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly secondaryLocation?: string; + /** + * @member {AccountStatus} [statusOfSecondary] Gets the status indicating + * whether the secondary location of the storage account is available or + * unavailable. Only available if the SKU name is Standard_GRS or + * Standard_RAGRS. Possible values include: 'available', 'unavailable' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly statusOfSecondary?: AccountStatus; + /** + * @member {Date} [creationTime] Gets the creation date and time of the + * storage account in UTC. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly creationTime?: Date; + /** + * @member {CustomDomain} [customDomain] Gets the custom domain the user + * assigned to this storage account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly customDomain?: CustomDomain; + /** + * @member {Endpoints} [secondaryEndpoints] Gets the URLs that are used to + * perform a retrieval of a public blob, queue, or table object from the + * secondary location of the storage account. Only available if the SKU name + * is Standard_RAGRS. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly secondaryEndpoints?: Endpoints; + /** + * @member {Encryption} [encryption] Gets the encryption settings on the + * account. If unspecified, the account is unencrypted. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly encryption?: Encryption; + /** + * @member {AccessTier} [accessTier] Required for storage accounts where kind + * = BlobStorage. The access tier used for billing. Possible values include: + * 'Hot', 'Cool' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accessTier?: AccessTier; + /** + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. + */ + enableAzureFilesAadIntegration?: boolean; + /** + * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to + * storage service if sets to true. + */ + enableHttpsTrafficOnly?: boolean; + /** + * @member {NetworkRuleSet} [networkRuleSet] Network rule set + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly networkRuleSet?: NetworkRuleSet; + /** + * @member {boolean} [isHnsEnabled] Account HierarchicalNamespace enabled if + * sets to true. + */ + isHnsEnabled?: boolean; + /** + * @member {GeoReplicationStats} [geoReplicationStats] Geo Replication Stats + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly geoReplicationStats?: GeoReplicationStats; + /** + * @member {boolean} [failoverInProgress] If the failover is in progress, the + * value will be true, otherwise, it will be null. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly failoverInProgress?: boolean; +} + +/** + * @interface + * An interface representing StorageAccountKey. + * An access key for the storage account. + * + */ +export interface StorageAccountKey { + /** + * @member {string} [keyName] Name of the key. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly keyName?: string; + /** + * @member {string} [value] Base 64-encoded value of the key. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly value?: string; + /** + * @member {KeyPermission} [permissions] Permissions for the key -- read-only + * or full permissions. Possible values include: 'Read', 'Full' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly permissions?: KeyPermission; +} + +/** + * @interface + * An interface representing StorageAccountListKeysResult. + * The response from the ListKeys operation. + * + */ +export interface StorageAccountListKeysResult { + /** + * @member {StorageAccountKey[]} [keys] Gets the list of storage account keys + * and their properties for the specified storage account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly keys?: StorageAccountKey[]; +} + +/** + * @interface + * An interface representing StorageAccountRegenerateKeyParameters. + * The parameters used to regenerate the storage account key. + * + */ +export interface StorageAccountRegenerateKeyParameters { + /** + * @member {string} keyName The name of storage keys that want to be + * regenerated, possible values are key1, key2. + */ + keyName: string; +} + +/** + * @interface + * An interface representing StorageAccountUpdateParameters. + * The parameters that can be provided when updating the storage account + * properties. + * + */ +export interface StorageAccountUpdateParameters { + /** + * @member {Sku} [sku] Gets or sets the SKU name. Note that the SKU name + * cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can + * accounts of those SKU names be updated to any other value. + */ + sku?: Sku; + /** + * @member {{ [propertyName: string]: string }} [tags] Gets or sets a list of + * key value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of + * 15 tags can be provided for a resource. Each tag must have a key no + * greater in length than 128 characters and a value no greater in length + * than 256 characters. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {Identity} [identity] The identity of the resource. + */ + identity?: Identity; + /** + * @member {CustomDomain} [customDomain] Custom domain assigned to the + * storage account by the user. Name is the CNAME source. Only one custom + * domain is supported per storage account at this time. To clear the + * existing custom domain, use an empty string for the custom domain name + * property. + */ + customDomain?: CustomDomain; + /** + * @member {Encryption} [encryption] Provides the encryption settings on the + * account. The default setting is unencrypted. + */ + encryption?: Encryption; + /** + * @member {AccessTier} [accessTier] Required for storage accounts where kind + * = BlobStorage. The access tier used for billing. Possible values include: + * 'Hot', 'Cool' + */ + accessTier?: AccessTier; + /** + * @member {boolean} [enableAzureFilesAadIntegration] Enables Azure Files AAD + * Integration for SMB if sets to true. + */ + enableAzureFilesAadIntegration?: boolean; + /** + * @member {boolean} [enableHttpsTrafficOnly] Allows https traffic only to + * storage service if sets to true. + */ + enableHttpsTrafficOnly?: boolean; + /** + * @member {NetworkRuleSet} [networkRuleSet] Network rule set + */ + networkRuleSet?: NetworkRuleSet; + /** + * @member {Kind} [kind] Optional. Indicates the type of storage account. + * Currently only StorageV2 value supported by server. Possible values + * include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' + */ + kind?: Kind; +} + +/** + * @interface + * An interface representing UsageName. + * The usage names that can be used; currently limited to StorageAccount. + * + */ +export interface UsageName { + /** + * @member {string} [value] Gets a string describing the resource name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly value?: string; + /** + * @member {string} [localizedValue] Gets a localized string describing the + * resource name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly localizedValue?: string; +} + +/** + * @interface + * An interface representing Usage. + * Describes Storage Resource Usage. + * + */ +export interface Usage { + /** + * @member {UsageUnit} [unit] Gets the unit of measurement. Possible values + * include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + * 'BytesPerSecond' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly unit?: UsageUnit; + /** + * @member {number} [currentValue] Gets the current count of the allocated + * resources in the subscription. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly currentValue?: number; + /** + * @member {number} [limit] Gets the maximum count of the resources that can + * be allocated in the subscription. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly limit?: number; + /** + * @member {UsageName} [name] Gets the name of the type of usage. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: UsageName; +} + +/** + * @interface + * An interface representing AccountSasParameters. + * The parameters to list SAS credentials of a storage account. + * + */ +export interface AccountSasParameters { + /** + * @member {Services} services The signed services accessible with the + * account SAS. Possible values include: Blob (b), Queue (q), Table (t), File + * (f). Possible values include: 'b', 'q', 't', 'f' + */ + services: Services; + /** + * @member {SignedResourceTypes} resourceTypes The signed resource types that + * are accessible with the account SAS. Service (s): Access to service-level + * APIs; Container (c): Access to container-level APIs; Object (o): Access to + * object-level APIs for blobs, queue messages, table entities, and files. + * Possible values include: 's', 'c', 'o' + */ + resourceTypes: SignedResourceTypes; + /** + * @member {Permissions} permissions The signed permissions for the account + * SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), + * Add (a), Create (c), Update (u) and Process (p). Possible values include: + * 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p' + */ + permissions: Permissions; + /** + * @member {string} [iPAddressOrRange] An IP address or a range of IP + * addresses from which to accept requests. + */ + iPAddressOrRange?: string; + /** + * @member {HttpProtocol} [protocols] The protocol permitted for a request + * made with the account SAS. Possible values include: 'https,http', 'https' + */ + protocols?: HttpProtocol; + /** + * @member {Date} [sharedAccessStartTime] The time at which the SAS becomes + * valid. + */ + sharedAccessStartTime?: Date; + /** + * @member {Date} sharedAccessExpiryTime The time at which the shared access + * signature becomes invalid. + */ + sharedAccessExpiryTime: Date; + /** + * @member {string} [keyToSign] The key to sign the account SAS token with. + */ + keyToSign?: string; +} + +/** + * @interface + * An interface representing ListAccountSasResponse. + * The List SAS credentials operation response. + * + */ +export interface ListAccountSasResponse { + /** + * @member {string} [accountSasToken] List SAS credentials of storage + * account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accountSasToken?: string; +} + +/** + * @interface + * An interface representing ServiceSasParameters. + * The parameters to list service SAS credentials of a specific resource. + * + */ +export interface ServiceSasParameters { + /** + * @member {string} canonicalizedResource The canonical path to the signed + * resource. + */ + canonicalizedResource: string; + /** + * @member {SignedResource} [resource] The signed services accessible with + * the service SAS. Possible values include: Blob (b), Container (c), File + * (f), Share (s). Possible values include: 'b', 'c', 'f', 's' + */ + resource?: SignedResource; + /** + * @member {Permissions} [permissions] The signed permissions for the service + * SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), + * Add (a), Create (c), Update (u) and Process (p). Possible values include: + * 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p' + */ + permissions?: Permissions; + /** + * @member {string} [iPAddressOrRange] An IP address or a range of IP + * addresses from which to accept requests. + */ + iPAddressOrRange?: string; + /** + * @member {HttpProtocol} [protocols] The protocol permitted for a request + * made with the account SAS. Possible values include: 'https,http', 'https' + */ + protocols?: HttpProtocol; + /** + * @member {Date} [sharedAccessStartTime] The time at which the SAS becomes + * valid. + */ + sharedAccessStartTime?: Date; + /** + * @member {Date} [sharedAccessExpiryTime] The time at which the shared + * access signature becomes invalid. + */ + sharedAccessExpiryTime?: Date; + /** + * @member {string} [identifier] A unique value up to 64 characters in length + * that correlates to an access policy specified for the container, queue, or + * table. + */ + identifier?: string; + /** + * @member {string} [partitionKeyStart] The start of partition key. + */ + partitionKeyStart?: string; + /** + * @member {string} [partitionKeyEnd] The end of partition key. + */ + partitionKeyEnd?: string; + /** + * @member {string} [rowKeyStart] The start of row key. + */ + rowKeyStart?: string; + /** + * @member {string} [rowKeyEnd] The end of row key. + */ + rowKeyEnd?: string; + /** + * @member {string} [keyToSign] The key to sign the account SAS token with. + */ + keyToSign?: string; + /** + * @member {string} [cacheControl] The response header override for cache + * control. + */ + cacheControl?: string; + /** + * @member {string} [contentDisposition] The response header override for + * content disposition. + */ + contentDisposition?: string; + /** + * @member {string} [contentEncoding] The response header override for + * content encoding. + */ + contentEncoding?: string; + /** + * @member {string} [contentLanguage] The response header override for + * content language. + */ + contentLanguage?: string; + /** + * @member {string} [contentType] The response header override for content + * type. + */ + contentType?: string; +} + +/** + * @interface + * An interface representing ListServiceSasResponse. + * The List service SAS credentials operation response. + * + */ +export interface ListServiceSasResponse { + /** + * @member {string} [serviceSasToken] List service SAS credentials of + * specific resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly serviceSasToken?: string; +} + +/** + * @interface + * An interface representing DateAfterModification. + * Object to define the number of days after last modification. + * + */ +export interface DateAfterModification { + /** + * @member {number} daysAfterModificationGreaterThan Integer value indicating + * the age in days after last modification + */ + daysAfterModificationGreaterThan: number; +} + +/** + * @interface + * An interface representing ManagementPolicyBaseBlob. + * Management policy action for base blob. + * + */ +export interface ManagementPolicyBaseBlob { + /** + * @member {DateAfterModification} [tierToCool] The function to tier blobs to + * cool storage. Support blobs currently at Hot tier + */ + tierToCool?: DateAfterModification; + /** + * @member {DateAfterModification} [tierToArchive] The function to tier blobs + * to archive storage. Support blobs currently at Hot or Cool tier + */ + tierToArchive?: DateAfterModification; + /** + * @member {DateAfterModification} [deleteProperty] The function to delete + * the blob + */ + deleteProperty?: DateAfterModification; +} + +/** + * @interface + * An interface representing DateAfterCreation. + * Object to define the number of days after creation. + * + */ +export interface DateAfterCreation { + /** + * @member {number} daysAfterCreationGreaterThan Integer value indicating the + * age in days after creation + */ + daysAfterCreationGreaterThan: number; +} + +/** + * @interface + * An interface representing ManagementPolicySnapShot. + * Management policy action for snapshot. + * + */ +export interface ManagementPolicySnapShot { + /** + * @member {DateAfterCreation} [deleteProperty] The function to delete the + * blob snapshot + */ + deleteProperty?: DateAfterCreation; +} + +/** + * @interface + * An interface representing ManagementPolicyAction. + * Actions are applied to the filtered blobs when the execution condition is + * met. + * + */ +export interface ManagementPolicyAction { + /** + * @member {ManagementPolicyBaseBlob} [baseBlob] The management policy action + * for base blob + */ + baseBlob?: ManagementPolicyBaseBlob; + /** + * @member {ManagementPolicySnapShot} [snapshot] The management policy action + * for snapshot + */ + snapshot?: ManagementPolicySnapShot; +} + +/** + * @interface + * An interface representing ManagementPolicyFilter. + * Filters limit rule actions to a subset of blobs within the storage account. + * If multiple filters are defined, a logical AND is performed on all filters. + * + */ +export interface ManagementPolicyFilter { + /** + * @member {string[]} [prefixMatch] An array of strings for prefixes to be + * match. + */ + prefixMatch?: string[]; + /** + * @member {string[]} blobTypes An array of predefined enum values. Only + * blockBlob is supported. + */ + blobTypes: string[]; +} + +/** + * @interface + * An interface representing ManagementPolicyDefinition. + * An object that defines the Lifecycle rule. Each definition is made up with a + * filters set and an actions set. + * + */ +export interface ManagementPolicyDefinition { + /** + * @member {ManagementPolicyAction} actions An object that defines the action + * set. + */ + actions: ManagementPolicyAction; + /** + * @member {ManagementPolicyFilter} [filters] An object that defines the + * filter set. + */ + filters?: ManagementPolicyFilter; +} + +/** + * @interface + * An interface representing ManagementPolicyRule. + * An object that wraps the Lifecycle rule. Each rule is uniquely defined by + * name. + * + */ +export interface ManagementPolicyRule { + /** + * @member {boolean} [enabled] Rule is enabled if set to true. + */ + enabled?: boolean; + /** + * @member {string} name A rule name can contain any combination of alpha + * numeric characters. Rule name is case-sensitive. It must be unique within + * a policy. + */ + name: string; + /** + * @member {ManagementPolicyDefinition} definition An object that defines the + * Lifecycle rule. + */ + definition: ManagementPolicyDefinition; +} + +/** + * @interface + * An interface representing ManagementPolicySchema. + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + */ +export interface ManagementPolicySchema { + /** + * @member {ManagementPolicyRule[]} rules The Storage Account + * ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + rules: ManagementPolicyRule[]; +} + +/** + * @interface + * An interface representing ManagementPolicy. + * The Get Storage Account ManagementPolicies operation response. + * + * @extends Resource + */ +export interface ManagementPolicy extends Resource { + /** + * @member {Date} [lastModifiedTime] Returns the date and time the + * ManagementPolicies was last modified. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModifiedTime?: Date; + /** + * @member {ManagementPolicySchema} policy The Storage Account + * ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + policy: ManagementPolicySchema; +} + +/** + * @interface + * An interface representing ProxyResource. + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags + * + * @extends Resource + */ +export interface ProxyResource extends Resource { +} + +/** + * @interface + * An interface representing AzureEntityResource. + * The resource model definition for a Azure Resource Manager resource with an + * etag. + * + * @extends Resource + */ +export interface AzureEntityResource extends Resource { + /** + * @member {string} [etag] Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly etag?: string; +} + +/** + * @interface + * An interface representing UpdateHistoryProperty. + * An update history of the ImmutabilityPolicy of a blob container. + * + */ +export interface UpdateHistoryProperty { + /** + * @member {ImmutabilityPolicyUpdateType} [update] The ImmutabilityPolicy + * update type of a blob container, possible values include: put, lock and + * extend. Possible values include: 'put', 'lock', 'extend' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly update?: ImmutabilityPolicyUpdateType; + /** + * @member {number} [immutabilityPeriodSinceCreationInDays] The immutability + * period for the blobs in the container since the policy creation, in days. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly immutabilityPeriodSinceCreationInDays?: number; + /** + * @member {Date} [timestamp] Returns the date and time the + * ImmutabilityPolicy was updated. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly timestamp?: Date; + /** + * @member {string} [objectIdentifier] Returns the Object ID of the user who + * updated the ImmutabilityPolicy. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly objectIdentifier?: string; + /** + * @member {string} [tenantId] Returns the Tenant ID that issued the token + * for the user who updated the ImmutabilityPolicy. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; + /** + * @member {string} [upn] Returns the User Principal Name of the user who + * updated the ImmutabilityPolicy. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly upn?: string; +} + +/** + * @interface + * An interface representing ImmutabilityPolicyProperties. + * The properties of an ImmutabilityPolicy of a blob container. + * + */ +export interface ImmutabilityPolicyProperties { + /** + * @member {number} immutabilityPeriodSinceCreationInDays The immutability + * period for the blobs in the container since the policy creation, in days. + */ + immutabilityPeriodSinceCreationInDays: number; + /** + * @member {ImmutabilityPolicyState} [state] The ImmutabilityPolicy state of + * a blob container, possible values include: Locked and Unlocked. Possible + * values include: 'Locked', 'Unlocked' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly state?: ImmutabilityPolicyState; + /** + * @member {string} [etag] ImmutabilityPolicy Etag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly etag?: string; + /** + * @member {UpdateHistoryProperty[]} [updateHistory] The ImmutabilityPolicy + * update history of the blob container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly updateHistory?: UpdateHistoryProperty[]; +} + +/** + * @interface + * An interface representing TagProperty. + * A tag of the LegalHold of a blob container. + * + */ +export interface TagProperty { + /** + * @member {string} [tag] The tag value. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tag?: string; + /** + * @member {Date} [timestamp] Returns the date and time the tag was added. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly timestamp?: Date; + /** + * @member {string} [objectIdentifier] Returns the Object ID of the user who + * added the tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly objectIdentifier?: string; + /** + * @member {string} [tenantId] Returns the Tenant ID that issued the token + * for the user who added the tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tenantId?: string; + /** + * @member {string} [upn] Returns the User Principal Name of the user who + * added the tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly upn?: string; +} + +/** + * @interface + * An interface representing LegalHoldProperties. + * The LegalHold property of a blob container. + * + */ +export interface LegalHoldProperties { + /** + * @member {boolean} [hasLegalHold] The hasLegalHold public property is set + * to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are + * cleared out. There can be a maximum of 1000 blob containers with + * hasLegalHold=true for a given account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasLegalHold?: boolean; + /** + * @member {TagProperty[]} [tags] The list of LegalHold tags of a blob + * container. + */ + tags?: TagProperty[]; +} + +/** + * @interface + * An interface representing BlobContainer. + * Properties of the blob container, including Id, resource name, resource + * type, Etag. + * + * @extends AzureEntityResource + */ +export interface BlobContainer extends AzureEntityResource { + /** + * @member {PublicAccess} [publicAccess] Specifies whether data in the + * container may be accessed publicly and the level of access. Possible + * values include: 'Container', 'Blob', 'None' + */ + publicAccess?: PublicAccess; + /** + * @member {Date} [lastModifiedTime] Returns the date and time the container + * was last modified. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModifiedTime?: Date; + /** + * @member {LeaseStatus} [leaseStatus] The lease status of the container. + * Possible values include: 'Locked', 'Unlocked' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseStatus?: LeaseStatus; + /** + * @member {LeaseState} [leaseState] Lease state of the container. Possible + * values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseState?: LeaseState; + /** + * @member {LeaseDuration} [leaseDuration] Specifies whether the lease on a + * container is of infinite or fixed duration, only when the container is + * leased. Possible values include: 'Infinite', 'Fixed' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseDuration?: LeaseDuration; + /** + * @member {{ [propertyName: string]: string }} [metadata] A name-value pair + * to associate with the container as metadata. + */ + metadata?: { [propertyName: string]: string }; + /** + * @member {ImmutabilityPolicyProperties} [immutabilityPolicy] The + * ImmutabilityPolicy property of the container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly immutabilityPolicy?: ImmutabilityPolicyProperties; + /** + * @member {LegalHoldProperties} [legalHold] The LegalHold property of the + * container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly legalHold?: LegalHoldProperties; + /** + * @member {boolean} [hasLegalHold] The hasLegalHold public property is set + * to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are + * cleared out. There can be a maximum of 1000 blob containers with + * hasLegalHold=true for a given account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasLegalHold?: boolean; + /** + * @member {boolean} [hasImmutabilityPolicy] The hasImmutabilityPolicy public + * property is set to true by SRP if ImmutabilityPolicy has been created for + * this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasImmutabilityPolicy?: boolean; +} + +/** + * @interface + * An interface representing ImmutabilityPolicy. + * The ImmutabilityPolicy property of a blob container, including Id, resource + * name, resource type, Etag. + * + * @extends AzureEntityResource + */ +export interface ImmutabilityPolicy extends AzureEntityResource { + /** + * @member {number} immutabilityPeriodSinceCreationInDays The immutability + * period for the blobs in the container since the policy creation, in days. + */ + immutabilityPeriodSinceCreationInDays: number; + /** + * @member {ImmutabilityPolicyState} [state] The ImmutabilityPolicy state of + * a blob container, possible values include: Locked and Unlocked. Possible + * values include: 'Locked', 'Unlocked' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly state?: ImmutabilityPolicyState; +} + +/** + * @interface + * An interface representing LegalHold. + * The LegalHold property of a blob container. + * + */ +export interface LegalHold { + /** + * @member {boolean} [hasLegalHold] The hasLegalHold public property is set + * to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are + * cleared out. There can be a maximum of 1000 blob containers with + * hasLegalHold=true for a given account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasLegalHold?: boolean; + /** + * @member {string[]} tags Each tag should be 3 to 23 alphanumeric characters + * and is normalized to lower case at SRP. + */ + tags: string[]; +} + +/** + * @interface + * An interface representing ListContainerItem. + * The blob container properties be listed out. + * + * @extends AzureEntityResource + */ +export interface ListContainerItem extends AzureEntityResource { + /** + * @member {PublicAccess} [publicAccess] Specifies whether data in the + * container may be accessed publicly and the level of access. Possible + * values include: 'Container', 'Blob', 'None' + */ + publicAccess?: PublicAccess; + /** + * @member {Date} [lastModifiedTime] Returns the date and time the container + * was last modified. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModifiedTime?: Date; + /** + * @member {LeaseStatus} [leaseStatus] The lease status of the container. + * Possible values include: 'Locked', 'Unlocked' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseStatus?: LeaseStatus; + /** + * @member {LeaseState} [leaseState] Lease state of the container. Possible + * values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseState?: LeaseState; + /** + * @member {LeaseDuration} [leaseDuration] Specifies whether the lease on a + * container is of infinite or fixed duration, only when the container is + * leased. Possible values include: 'Infinite', 'Fixed' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly leaseDuration?: LeaseDuration; + /** + * @member {{ [propertyName: string]: string }} [metadata] A name-value pair + * to associate with the container as metadata. + */ + metadata?: { [propertyName: string]: string }; + /** + * @member {ImmutabilityPolicyProperties} [immutabilityPolicy] The + * ImmutabilityPolicy property of the container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly immutabilityPolicy?: ImmutabilityPolicyProperties; + /** + * @member {LegalHoldProperties} [legalHold] The LegalHold property of the + * container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly legalHold?: LegalHoldProperties; + /** + * @member {boolean} [hasLegalHold] The hasLegalHold public property is set + * to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are + * cleared out. There can be a maximum of 1000 blob containers with + * hasLegalHold=true for a given account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasLegalHold?: boolean; + /** + * @member {boolean} [hasImmutabilityPolicy] The hasImmutabilityPolicy public + * property is set to true by SRP if ImmutabilityPolicy has been created for + * this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hasImmutabilityPolicy?: boolean; +} + +/** + * @interface + * An interface representing ListContainerItems. + * The list of blob containers. + * + */ +export interface ListContainerItems { + /** + * @member {ListContainerItem[]} [value] The list of blob containers. + */ + value?: ListContainerItem[]; +} + +/** + * @interface + * An interface representing CorsRule. + * Specifies a CORS rule for the Blob service. + * + */ +export interface CorsRule { + /** + * @member {string[]} allowedOrigins Required if CorsRule element is present. + * A list of origin domains that will be allowed via CORS, or "*" to allow + * all domains + */ + allowedOrigins: string[]; + /** + * @member {string[]} allowedMethods Required if CorsRule element is present. + * A list of HTTP methods that are allowed to be executed by the origin. + */ + allowedMethods: string[]; + /** + * @member {number} maxAgeInSeconds Required if CorsRule element is present. + * The number of seconds that the client/browser should cache a preflight + * response. + */ + maxAgeInSeconds: number; + /** + * @member {string[]} exposedHeaders Required if CorsRule element is present. + * A list of response headers to expose to CORS clients. + */ + exposedHeaders: string[]; + /** + * @member {string[]} allowedHeaders Required if CorsRule element is present. + * A list of headers allowed to be part of the cross-origin request. + */ + allowedHeaders: string[]; +} + +/** + * @interface + * An interface representing CorsRules. + * Sets the CORS rules. You can include up to five CorsRule elements in the + * request. + * + */ +export interface CorsRules { + /** + * @member {CorsRule[]} [corsRules] The List of CORS rules. You can include + * up to five CorsRule elements in the request. + */ + corsRules?: CorsRule[]; +} + +/** + * @interface + * An interface representing DeleteRetentionPolicy. + * The blob service properties for soft delete. + * + */ +export interface DeleteRetentionPolicy { + /** + * @member {boolean} [enabled] Indicates whether DeleteRetentionPolicy is + * enabled for the Blob service. + */ + enabled?: boolean; + /** + * @member {number} [days] Indicates the number of days that the deleted blob + * should be retained. The minimum specified value can be 1 and the maximum + * value can be 365. + */ + days?: number; +} + +/** + * @interface + * An interface representing BlobServiceProperties. + * The properties of a storage account’s Blob service. + * + * @extends Resource + */ +export interface BlobServiceProperties extends Resource { + /** + * @member {CorsRules} [cors] Specifies CORS rules for the Blob service. You + * can include up to five CorsRule elements in the request. If no CorsRule + * elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Blob service. + */ + cors?: CorsRules; + /** + * @member {string} [defaultServiceVersion] DefaultServiceVersion indicates + * the default version to use for requests to the Blob service if an incoming + * request’s version is not specified. Possible values include version + * 2008-10-27 and all more recent versions. + */ + defaultServiceVersion?: string; + /** + * @member {DeleteRetentionPolicy} [deleteRetentionPolicy] The blob service + * properties for soft delete. + */ + deleteRetentionPolicy?: DeleteRetentionPolicy; + /** + * @member {boolean} [automaticSnapshotPolicyEnabled] Automatic Snapshot is + * enabled if set to true. + */ + automaticSnapshotPolicyEnabled?: boolean; +} + +/** + * @interface + * An interface representing LeaseContainerRequest. + * Lease Container request schema. + * + */ +export interface LeaseContainerRequest { + /** + * @member {Action1} action Specifies the lease action. Can be one of the + * available actions. Possible values include: 'Acquire', 'Renew', 'Change', + * 'Release', 'Break' + */ + action: Action1; + /** + * @member {string} [leaseId] Identifies the lease. Can be specified in any + * valid GUID string format. + */ + leaseId?: string; + /** + * @member {number} [breakPeriod] Optional. For a break action, proposed + * duration the lease should continue before it is broken, in seconds, + * between 0 and 60. + */ + breakPeriod?: number; + /** + * @member {number} [leaseDuration] Required for acquire. Specifies the + * duration of the lease, in seconds, or negative one (-1) for a lease that + * never expires. + */ + leaseDuration?: number; + /** + * @member {string} [proposedLeaseId] Optional for acquire, required for + * change. Proposed lease ID, in a GUID string format. + */ + proposedLeaseId?: string; +} + +/** + * @interface + * An interface representing LeaseContainerResponse. + * Lease Container response schema. + * + */ +export interface LeaseContainerResponse { + /** + * @member {string} [leaseId] Returned unique lease ID that must be included + * with any request to delete the container, or to renew, change, or release + * the lease. + */ + leaseId?: string; + /** + * @member {string} [leaseTimeSeconds] Approximate time remaining in the + * lease period, in seconds. + */ + leaseTimeSeconds?: string; +} + +/** + * @interface + * An interface representing StorageAccountsGetPropertiesOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface StorageAccountsGetPropertiesOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {StorageAccountExpand} [expand] May be used to expand the + * properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats. + * Possible values include: 'geoReplicationStats' + */ + expand?: StorageAccountExpand; +} + +/** + * @interface + * An interface representing BlobContainersCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface BlobContainersCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {PublicAccess} [publicAccess] Specifies whether data in the + * container may be accessed publicly and the level of access. Possible + * values include: 'Container', 'Blob', 'None' + */ + publicAccess?: PublicAccess; + /** + * @member {{ [propertyName: string]: string }} [metadata] A name-value pair + * to associate with the container as metadata. + */ + metadata?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing BlobContainersUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface BlobContainersUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {PublicAccess} [publicAccess] Specifies whether data in the + * container may be accessed publicly and the level of access. Possible + * values include: 'Container', 'Blob', 'None' + */ + publicAccess?: PublicAccess; + /** + * @member {{ [propertyName: string]: string }} [metadata] A name-value pair + * to associate with the container as metadata. + */ + metadata?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the + * immutability policy to update. A value of "*" can be used to apply the + * operation only if the immutability policy already exists. If omitted, this + * operation will always be applied. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing BlobContainersGetImmutabilityPolicyOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface BlobContainersGetImmutabilityPolicyOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the + * immutability policy to update. A value of "*" can be used to apply the + * operation only if the immutability policy already exists. If omitted, this + * operation will always be applied. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing BlobContainersLeaseOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface BlobContainersLeaseOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {LeaseContainerRequest} [parameters] Lease Container request body. + */ + parameters?: LeaseContainerRequest; +} + +/** + * @interface + * An interface representing StorageManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface StorageManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + +/** + * @interface + * An interface representing BlobContainersCreateOrUpdateImmutabilityPolicyHeaders. + * Defines headers for CreateOrUpdateImmutabilityPolicy operation. + * + */ +export interface BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing BlobContainersGetImmutabilityPolicyHeaders. + * Defines headers for GetImmutabilityPolicy operation. + * + */ +export interface BlobContainersGetImmutabilityPolicyHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing BlobContainersDeleteImmutabilityPolicyHeaders. + * Defines headers for DeleteImmutabilityPolicy operation. + * + */ +export interface BlobContainersDeleteImmutabilityPolicyHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing BlobContainersLockImmutabilityPolicyHeaders. + * Defines headers for LockImmutabilityPolicy operation. + * + */ +export interface BlobContainersLockImmutabilityPolicyHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing BlobContainersExtendImmutabilityPolicyHeaders. + * Defines headers for ExtendImmutabilityPolicy operation. + * + */ +export interface BlobContainersExtendImmutabilityPolicyHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list Storage operations. It contains a list of + * operations and a URL link to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { +} + +/** + * @interface + * An interface representing the StorageSkuListResult. + * The response from the List Storage SKUs operation. + * + * @extends Array + */ +export interface StorageSkuListResult extends Array { +} + +/** + * @interface + * An interface representing the StorageAccountListResult. + * The response from the List Storage Accounts operation. + * + * @extends Array + */ +export interface StorageAccountListResult extends Array { +} + +/** + * @interface + * An interface representing the UsageListResult. + * The response from the List Usages operation. + * + * @extends Array + */ +export interface UsageListResult extends Array { +} + +/** + * Defines values for ReasonCode. + * Possible values include: 'QuotaId', 'NotAvailableForSubscription' + * @readonly + * @enum {string} + */ +export type ReasonCode = 'QuotaId' | 'NotAvailableForSubscription'; + +/** + * Defines values for SkuName. + * Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', + * 'Premium_LRS', 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + * @readonly + * @enum {string} + */ +export type SkuName = 'Standard_LRS' | 'Standard_GRS' | 'Standard_RAGRS' | 'Standard_ZRS' | 'Premium_LRS' | 'Premium_ZRS' | 'Standard_GZRS' | 'Standard_RAGZRS'; + +/** + * Defines values for SkuTier. + * Possible values include: 'Standard', 'Premium' + * @readonly + * @enum {string} + */ +export type SkuTier = 'Standard' | 'Premium'; + +/** + * Defines values for Kind. + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' + * @readonly + * @enum {string} + */ +export type Kind = 'Storage' | 'StorageV2' | 'BlobStorage' | 'FileStorage' | 'BlockBlobStorage'; + +/** + * Defines values for Reason. + * Possible values include: 'AccountNameInvalid', 'AlreadyExists' + * @readonly + * @enum {string} + */ +export type Reason = 'AccountNameInvalid' | 'AlreadyExists'; + +/** + * Defines values for KeySource. + * Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault' + * @readonly + * @enum {string} + */ +export type KeySource = 'Microsoft.Storage' | 'Microsoft.Keyvault'; + +/** + * Defines values for Action. + * Possible values include: 'Allow' + * @readonly + * @enum {string} + */ +export type Action = 'Allow'; + +/** + * Defines values for State. + * Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted' + * @readonly + * @enum {string} + */ +export type State = 'provisioning' | 'deprovisioning' | 'succeeded' | 'failed' | 'networkSourceDeleted'; + +/** + * Defines values for Bypass. + * Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' + * @readonly + * @enum {string} + */ +export type Bypass = 'None' | 'Logging' | 'Metrics' | 'AzureServices'; + +/** + * Defines values for DefaultAction. + * Possible values include: 'Allow', 'Deny' + * @readonly + * @enum {string} + */ +export type DefaultAction = 'Allow' | 'Deny'; + +/** + * Defines values for AccessTier. + * Possible values include: 'Hot', 'Cool' + * @readonly + * @enum {string} + */ +export type AccessTier = 'Hot' | 'Cool'; + +/** + * Defines values for GeoReplicationStatus. + * Possible values include: 'Live', 'Bootstrap', 'Unavailable' + * @readonly + * @enum {string} + */ +export type GeoReplicationStatus = 'Live' | 'Bootstrap' | 'Unavailable'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Creating' | 'ResolvingDNS' | 'Succeeded'; + +/** + * Defines values for AccountStatus. + * Possible values include: 'available', 'unavailable' + * @readonly + * @enum {string} + */ +export type AccountStatus = 'available' | 'unavailable'; + +/** + * Defines values for KeyPermission. + * Possible values include: 'Read', 'Full' + * @readonly + * @enum {string} + */ +export type KeyPermission = 'Read' | 'Full'; + +/** + * Defines values for UsageUnit. + * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + * 'BytesPerSecond' + * @readonly + * @enum {string} + */ +export type UsageUnit = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountsPerSecond' | 'BytesPerSecond'; + +/** + * Defines values for Services. + * Possible values include: 'b', 'q', 't', 'f' + * @readonly + * @enum {string} + */ +export type Services = 'b' | 'q' | 't' | 'f'; + +/** + * Defines values for SignedResourceTypes. + * Possible values include: 's', 'c', 'o' + * @readonly + * @enum {string} + */ +export type SignedResourceTypes = 's' | 'c' | 'o'; + +/** + * Defines values for Permissions. + * Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p' + * @readonly + * @enum {string} + */ +export type Permissions = 'r' | 'd' | 'w' | 'l' | 'a' | 'c' | 'u' | 'p'; + +/** + * Defines values for HttpProtocol. + * Possible values include: 'https,http', 'https' + * @readonly + * @enum {string} + */ +export type HttpProtocol = 'https,http' | 'https'; + +/** + * Defines values for SignedResource. + * Possible values include: 'b', 'c', 'f', 's' + * @readonly + * @enum {string} + */ +export type SignedResource = 'b' | 'c' | 'f' | 's'; + +/** + * Defines values for PublicAccess. + * Possible values include: 'Container', 'Blob', 'None' + * @readonly + * @enum {string} + */ +export type PublicAccess = 'Container' | 'Blob' | 'None'; + +/** + * Defines values for LeaseStatus. + * Possible values include: 'Locked', 'Unlocked' + * @readonly + * @enum {string} + */ +export type LeaseStatus = 'Locked' | 'Unlocked'; + +/** + * Defines values for LeaseState. + * Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + * @readonly + * @enum {string} + */ +export type LeaseState = 'Available' | 'Leased' | 'Expired' | 'Breaking' | 'Broken'; + +/** + * Defines values for LeaseDuration. + * Possible values include: 'Infinite', 'Fixed' + * @readonly + * @enum {string} + */ +export type LeaseDuration = 'Infinite' | 'Fixed'; + +/** + * Defines values for ImmutabilityPolicyState. + * Possible values include: 'Locked', 'Unlocked' + * @readonly + * @enum {string} + */ +export type ImmutabilityPolicyState = 'Locked' | 'Unlocked'; + +/** + * Defines values for ImmutabilityPolicyUpdateType. + * Possible values include: 'put', 'lock', 'extend' + * @readonly + * @enum {string} + */ +export type ImmutabilityPolicyUpdateType = 'put' | 'lock' | 'extend'; + +/** + * Defines values for StorageAccountExpand. + * Possible values include: 'geoReplicationStats' + * @readonly + * @enum {string} + */ +export type StorageAccountExpand = 'geoReplicationStats'; + +/** + * Defines values for Action1. + * Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break' + * @readonly + * @enum {string} + */ +export type Action1 = 'Acquire' | 'Renew' | 'Change' | 'Release' | 'Break'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type SkusListResponse = StorageSkuListResult & { + /** + * 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: StorageSkuListResult; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type StorageAccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult & { + /** + * 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: CheckNameAvailabilityResult; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type StorageAccountsCreateResponse = StorageAccount & { + /** + * 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: StorageAccount; + }; +}; + +/** + * Contains response data for the getProperties operation. + */ +export type StorageAccountsGetPropertiesResponse = StorageAccount & { + /** + * 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: StorageAccount; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type StorageAccountsUpdateResponse = StorageAccount & { + /** + * 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: StorageAccount; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type StorageAccountsListResponse = StorageAccountListResult & { + /** + * 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: StorageAccountListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type StorageAccountsListByResourceGroupResponse = StorageAccountListResult & { + /** + * 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: StorageAccountListResult; + }; +}; + +/** + * Contains response data for the listKeys operation. + */ +export type StorageAccountsListKeysResponse = StorageAccountListKeysResult & { + /** + * 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: StorageAccountListKeysResult; + }; +}; + +/** + * Contains response data for the regenerateKey operation. + */ +export type StorageAccountsRegenerateKeyResponse = StorageAccountListKeysResult & { + /** + * 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: StorageAccountListKeysResult; + }; +}; + +/** + * Contains response data for the listAccountSAS operation. + */ +export type StorageAccountsListAccountSASResponse = ListAccountSasResponse & { + /** + * 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: ListAccountSasResponse; + }; +}; + +/** + * Contains response data for the listServiceSAS operation. + */ +export type StorageAccountsListServiceSASResponse = ListServiceSasResponse & { + /** + * 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: ListServiceSasResponse; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type StorageAccountsBeginCreateResponse = StorageAccount & { + /** + * 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: StorageAccount; + }; +}; + +/** + * Contains response data for the listByLocation operation. + */ +export type UsagesListByLocationResponse = UsageListResult & { + /** + * 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: UsageListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ManagementPoliciesGetResponse = ManagementPolicy & { + /** + * 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: ManagementPolicy; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type ManagementPoliciesCreateOrUpdateResponse = ManagementPolicy & { + /** + * 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: ManagementPolicy; + }; +}; + +/** + * Contains response data for the setServiceProperties operation. + */ +export type BlobServicesSetServicePropertiesResponse = BlobServiceProperties & { + /** + * 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: BlobServiceProperties; + }; +}; + +/** + * Contains response data for the getServiceProperties operation. + */ +export type BlobServicesGetServicePropertiesResponse = BlobServiceProperties & { + /** + * 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: BlobServiceProperties; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type BlobContainersListResponse = ListContainerItems & { + /** + * 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: ListContainerItems; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type BlobContainersCreateResponse = BlobContainer & { + /** + * 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: BlobContainer; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type BlobContainersUpdateResponse = BlobContainer & { + /** + * 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: BlobContainer; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type BlobContainersGetResponse = BlobContainer & { + /** + * 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: BlobContainer; + }; +}; + +/** + * Contains response data for the setLegalHold operation. + */ +export type BlobContainersSetLegalHoldResponse = LegalHold & { + /** + * 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: LegalHold; + }; +}; + +/** + * Contains response data for the clearLegalHold operation. + */ +export type BlobContainersClearLegalHoldResponse = LegalHold & { + /** + * 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: LegalHold; + }; +}; + +/** + * Contains response data for the createOrUpdateImmutabilityPolicy operation. + */ +export type BlobContainersCreateOrUpdateImmutabilityPolicyResponse = ImmutabilityPolicy & BlobContainersCreateOrUpdateImmutabilityPolicyHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BlobContainersCreateOrUpdateImmutabilityPolicyHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImmutabilityPolicy; + }; +}; + +/** + * Contains response data for the getImmutabilityPolicy operation. + */ +export type BlobContainersGetImmutabilityPolicyResponse = ImmutabilityPolicy & BlobContainersGetImmutabilityPolicyHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BlobContainersGetImmutabilityPolicyHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImmutabilityPolicy; + }; +}; + +/** + * Contains response data for the deleteImmutabilityPolicy operation. + */ +export type BlobContainersDeleteImmutabilityPolicyResponse = ImmutabilityPolicy & BlobContainersDeleteImmutabilityPolicyHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BlobContainersDeleteImmutabilityPolicyHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImmutabilityPolicy; + }; +}; + +/** + * Contains response data for the lockImmutabilityPolicy operation. + */ +export type BlobContainersLockImmutabilityPolicyResponse = ImmutabilityPolicy & BlobContainersLockImmutabilityPolicyHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BlobContainersLockImmutabilityPolicyHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImmutabilityPolicy; + }; +}; + +/** + * Contains response data for the extendImmutabilityPolicy operation. + */ +export type BlobContainersExtendImmutabilityPolicyResponse = ImmutabilityPolicy & BlobContainersExtendImmutabilityPolicyHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BlobContainersExtendImmutabilityPolicyHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImmutabilityPolicy; + }; +}; + +/** + * Contains response data for the lease operation. + */ +export type BlobContainersLeaseResponse = LeaseContainerResponse & { + /** + * 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: LeaseContainerResponse; + }; +}; diff --git a/sdk/storage/arm-storage/lib/models/managementPoliciesMappers.ts b/sdk/storage/arm-storage/lib/models/managementPoliciesMappers.ts new file mode 100644 index 000000000000..6aaffedca690 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/managementPoliciesMappers.ts @@ -0,0 +1,55 @@ +/* + * 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 { + ManagementPolicy, + Resource, + BaseResource, + ManagementPolicySchema, + ManagementPolicyRule, + ManagementPolicyDefinition, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + DateAfterModification, + ManagementPolicySnapShot, + DateAfterCreation, + ManagementPolicyFilter, + CloudError, + ProxyResource, + TrackedResource, + AzureEntityResource, + BlobContainer, + ImmutabilityPolicyProperties, + UpdateHistoryProperty, + LegalHoldProperties, + TagProperty, + ImmutabilityPolicy, + ListContainerItem, + BlobServiceProperties, + CorsRules, + CorsRule, + DeleteRetentionPolicy, + StorageAccount, + Sku, + SKUCapability, + Restriction, + Identity, + Endpoints, + CustomDomain, + Encryption, + EncryptionServices, + EncryptionService, + KeyVaultProperties, + NetworkRuleSet, + VirtualNetworkRule, + IPRule, + GeoReplicationStats +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/mappers.ts b/sdk/storage/arm-storage/lib/models/mappers.ts new file mode 100644 index 000000000000..8a8951600de4 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/mappers.ts @@ -0,0 +1,2673 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Dimension: msRest.CompositeMapper = { + serializedName: "Dimension", + type: { + name: "Composite", + className: "Dimension", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + } + } + } +}; + +export const MetricSpecification: msRest.CompositeMapper = { + serializedName: "MetricSpecification", + type: { + name: "Composite", + className: "MetricSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + displayDescription: { + serializedName: "displayDescription", + type: { + name: "String" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Dimension" + } + } + } + }, + aggregationType: { + serializedName: "aggregationType", + type: { + name: "String" + } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, + resourceIdDimensionNameOverride: { + serializedName: "resourceIdDimensionNameOverride", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceSpecification: msRest.CompositeMapper = { + serializedName: "ServiceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification", + modelProperties: { + metricSpecifications: { + serializedName: "metricSpecifications", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetricSpecification" + } + } + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + serviceSpecification: { + serializedName: "properties.serviceSpecification", + type: { + name: "Composite", + className: "ServiceSpecification" + } + } + } + } +}; + +export const StorageAccountCheckNameAvailabilityParameters: msRest.CompositeMapper = { + serializedName: "StorageAccountCheckNameAvailabilityParameters", + type: { + name: "Composite", + className: "StorageAccountCheckNameAvailabilityParameters", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'Microsoft.Storage/storageAccounts', + type: { + name: "String" + } + } + } + } +}; + +export const SKUCapability: msRest.CompositeMapper = { + serializedName: "SKUCapability", + type: { + name: "Composite", + className: "SKUCapability", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const Restriction: msRest.CompositeMapper = { + serializedName: "Restriction", + type: { + name: "Composite", + className: "Restriction", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + values: { + readOnly: true, + serializedName: "values", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + reasonCode: { + serializedName: "reasonCode", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + tier: { + readOnly: true, + serializedName: "tier", + type: { + name: "Enum", + allowedValues: [ + "Standard", + "Premium" + ] + } + }, + resourceType: { + readOnly: true, + serializedName: "resourceType", + type: { + name: "String" + } + }, + kind: { + readOnly: true, + serializedName: "kind", + type: { + name: "String" + } + }, + locations: { + readOnly: true, + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + capabilities: { + readOnly: true, + serializedName: "capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SKUCapability" + } + } + } + }, + restrictions: { + serializedName: "restrictions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Restriction" + } + } + } + } + } + } +}; + +export const CheckNameAvailabilityResult: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityResult", + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + readOnly: true, + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + readOnly: true, + serializedName: "reason", + type: { + name: "Enum", + allowedValues: [ + "AccountNameInvalid", + "AlreadyExists" + ] + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const CustomDomain: msRest.CompositeMapper = { + serializedName: "CustomDomain", + type: { + name: "Composite", + className: "CustomDomain", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + useSubDomainName: { + serializedName: "useSubDomainName", + type: { + name: "Boolean" + } + } + } + } +}; + +export const EncryptionService: msRest.CompositeMapper = { + serializedName: "EncryptionService", + type: { + name: "Composite", + className: "EncryptionService", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + lastEnabledTime: { + readOnly: true, + serializedName: "lastEnabledTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const EncryptionServices: msRest.CompositeMapper = { + serializedName: "EncryptionServices", + type: { + name: "Composite", + className: "EncryptionServices", + modelProperties: { + blob: { + serializedName: "blob", + type: { + name: "Composite", + className: "EncryptionService" + } + }, + file: { + serializedName: "file", + type: { + name: "Composite", + className: "EncryptionService" + } + }, + table: { + readOnly: true, + serializedName: "table", + type: { + name: "Composite", + className: "EncryptionService" + } + }, + queue: { + readOnly: true, + serializedName: "queue", + type: { + name: "Composite", + className: "EncryptionService" + } + } + } + } +}; + +export const KeyVaultProperties: msRest.CompositeMapper = { + serializedName: "KeyVaultProperties", + type: { + name: "Composite", + className: "KeyVaultProperties", + modelProperties: { + keyName: { + serializedName: "keyname", + type: { + name: "String" + } + }, + keyVersion: { + serializedName: "keyversion", + type: { + name: "String" + } + }, + keyVaultUri: { + serializedName: "keyvaulturi", + type: { + name: "String" + } + } + } + } +}; + +export const Encryption: msRest.CompositeMapper = { + serializedName: "Encryption", + type: { + name: "Composite", + className: "Encryption", + modelProperties: { + services: { + serializedName: "services", + type: { + name: "Composite", + className: "EncryptionServices" + } + }, + keySource: { + required: true, + serializedName: "keySource", + defaultValue: 'Microsoft.Storage', + type: { + name: "String" + } + }, + keyVaultProperties: { + serializedName: "keyvaultproperties", + type: { + name: "Composite", + className: "KeyVaultProperties" + } + } + } + } +}; + +export const VirtualNetworkRule: msRest.CompositeMapper = { + serializedName: "VirtualNetworkRule", + type: { + name: "Composite", + className: "VirtualNetworkRule", + modelProperties: { + virtualNetworkResourceId: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + defaultValue: 'Allow', + type: { + name: "Enum", + allowedValues: [ + "Allow" + ] + } + }, + state: { + serializedName: "state", + type: { + name: "Enum", + allowedValues: [ + "provisioning", + "deprovisioning", + "succeeded", + "failed", + "networkSourceDeleted" + ] + } + } + } + } +}; + +export const IPRule: msRest.CompositeMapper = { + serializedName: "IPRule", + type: { + name: "Composite", + className: "IPRule", + modelProperties: { + iPAddressOrRange: { + required: true, + serializedName: "value", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + defaultValue: 'Allow', + type: { + name: "Enum", + allowedValues: [ + "Allow" + ] + } + } + } + } +}; + +export const NetworkRuleSet: msRest.CompositeMapper = { + serializedName: "NetworkRuleSet", + type: { + name: "Composite", + className: "NetworkRuleSet", + modelProperties: { + bypass: { + serializedName: "bypass", + defaultValue: 'AzureServices', + type: { + name: "String" + } + }, + virtualNetworkRules: { + serializedName: "virtualNetworkRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkRule" + } + } + } + }, + ipRules: { + serializedName: "ipRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IPRule" + } + } + } + }, + defaultAction: { + required: true, + serializedName: "defaultAction", + defaultValue: 'Allow', + type: { + name: "Enum", + allowedValues: [ + "Allow", + "Deny" + ] + } + } + } + } +}; + +export const Identity: msRest.CompositeMapper = { + serializedName: "Identity", + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'SystemAssigned', + type: { + name: "String" + } + } + } + } +}; + +export const StorageAccountCreateParameters: msRest.CompositeMapper = { + serializedName: "StorageAccountCreateParameters", + type: { + name: "Composite", + className: "StorageAccountCreateParameters", + modelProperties: { + sku: { + required: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + customDomain: { + serializedName: "properties.customDomain", + type: { + name: "Composite", + className: "CustomDomain" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption" + } + }, + networkRuleSet: { + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet" + } + }, + accessTier: { + serializedName: "properties.accessTier", + type: { + name: "Enum", + allowedValues: [ + "Hot", + "Cool" + ] + } + }, + enableAzureFilesAadIntegration: { + serializedName: "properties.azureFilesAadIntegration", + type: { + name: "Boolean" + } + }, + enableHttpsTrafficOnly: { + serializedName: "properties.supportsHttpsTrafficOnly", + type: { + name: "Boolean" + } + }, + isHnsEnabled: { + serializedName: "properties.isHnsEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Endpoints: msRest.CompositeMapper = { + serializedName: "Endpoints", + type: { + name: "Composite", + className: "Endpoints", + modelProperties: { + blob: { + readOnly: true, + serializedName: "blob", + type: { + name: "String" + } + }, + queue: { + readOnly: true, + serializedName: "queue", + type: { + name: "String" + } + }, + table: { + readOnly: true, + serializedName: "table", + type: { + name: "String" + } + }, + file: { + readOnly: true, + serializedName: "file", + type: { + name: "String" + } + }, + web: { + readOnly: true, + serializedName: "web", + type: { + name: "String" + } + }, + dfs: { + readOnly: true, + serializedName: "dfs", + type: { + name: "String" + } + } + } + } +}; + +export const GeoReplicationStats: msRest.CompositeMapper = { + serializedName: "GeoReplicationStats", + type: { + name: "Composite", + className: "GeoReplicationStats", + modelProperties: { + status: { + readOnly: true, + serializedName: "status", + type: { + name: "String" + } + }, + lastSyncTime: { + readOnly: true, + serializedName: "lastSyncTime", + type: { + name: "DateTime" + } + }, + canFailover: { + readOnly: true, + serializedName: "canFailover", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAccount: msRest.CompositeMapper = { + serializedName: "StorageAccount", + type: { + name: "Composite", + className: "StorageAccount", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + readOnly: true, + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + kind: { + readOnly: true, + serializedName: "kind", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Creating", + "ResolvingDNS", + "Succeeded" + ] + } + }, + primaryEndpoints: { + readOnly: true, + serializedName: "properties.primaryEndpoints", + type: { + name: "Composite", + className: "Endpoints" + } + }, + primaryLocation: { + readOnly: true, + serializedName: "properties.primaryLocation", + type: { + name: "String" + } + }, + statusOfPrimary: { + readOnly: true, + serializedName: "properties.statusOfPrimary", + type: { + name: "Enum", + allowedValues: [ + "available", + "unavailable" + ] + } + }, + lastGeoFailoverTime: { + readOnly: true, + serializedName: "properties.lastGeoFailoverTime", + type: { + name: "DateTime" + } + }, + secondaryLocation: { + readOnly: true, + serializedName: "properties.secondaryLocation", + type: { + name: "String" + } + }, + statusOfSecondary: { + readOnly: true, + serializedName: "properties.statusOfSecondary", + type: { + name: "Enum", + allowedValues: [ + "available", + "unavailable" + ] + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + customDomain: { + readOnly: true, + serializedName: "properties.customDomain", + type: { + name: "Composite", + className: "CustomDomain" + } + }, + secondaryEndpoints: { + readOnly: true, + serializedName: "properties.secondaryEndpoints", + type: { + name: "Composite", + className: "Endpoints" + } + }, + encryption: { + readOnly: true, + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption" + } + }, + accessTier: { + readOnly: true, + serializedName: "properties.accessTier", + type: { + name: "Enum", + allowedValues: [ + "Hot", + "Cool" + ] + } + }, + enableAzureFilesAadIntegration: { + serializedName: "properties.azureFilesAadIntegration", + type: { + name: "Boolean" + } + }, + enableHttpsTrafficOnly: { + serializedName: "properties.supportsHttpsTrafficOnly", + type: { + name: "Boolean" + } + }, + networkRuleSet: { + readOnly: true, + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet" + } + }, + isHnsEnabled: { + serializedName: "properties.isHnsEnabled", + type: { + name: "Boolean" + } + }, + geoReplicationStats: { + readOnly: true, + serializedName: "properties.geoReplicationStats", + type: { + name: "Composite", + className: "GeoReplicationStats" + } + }, + failoverInProgress: { + readOnly: true, + serializedName: "properties.failoverInProgress", + type: { + name: "Boolean" + } + } + } + } +}; + +export const StorageAccountKey: msRest.CompositeMapper = { + serializedName: "StorageAccountKey", + type: { + name: "Composite", + className: "StorageAccountKey", + modelProperties: { + keyName: { + readOnly: true, + serializedName: "keyName", + type: { + name: "String" + } + }, + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + }, + permissions: { + readOnly: true, + serializedName: "permissions", + type: { + name: "Enum", + allowedValues: [ + "Read", + "Full" + ] + } + } + } + } +}; + +export const StorageAccountListKeysResult: msRest.CompositeMapper = { + serializedName: "StorageAccountListKeysResult", + type: { + name: "Composite", + className: "StorageAccountListKeysResult", + modelProperties: { + keys: { + readOnly: true, + serializedName: "keys", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageAccountKey" + } + } + } + } + } + } +}; + +export const StorageAccountRegenerateKeyParameters: msRest.CompositeMapper = { + serializedName: "StorageAccountRegenerateKeyParameters", + type: { + name: "Composite", + className: "StorageAccountRegenerateKeyParameters", + modelProperties: { + keyName: { + required: true, + serializedName: "keyName", + type: { + name: "String" + } + } + } + } +}; + +export const StorageAccountUpdateParameters: msRest.CompositeMapper = { + serializedName: "StorageAccountUpdateParameters", + type: { + name: "Composite", + className: "StorageAccountUpdateParameters", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" + } + }, + customDomain: { + serializedName: "properties.customDomain", + type: { + name: "Composite", + className: "CustomDomain" + } + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption" + } + }, + accessTier: { + serializedName: "properties.accessTier", + type: { + name: "Enum", + allowedValues: [ + "Hot", + "Cool" + ] + } + }, + enableAzureFilesAadIntegration: { + serializedName: "properties.azureFilesAadIntegration", + type: { + name: "Boolean" + } + }, + enableHttpsTrafficOnly: { + serializedName: "properties.supportsHttpsTrafficOnly", + type: { + name: "Boolean" + } + }, + networkRuleSet: { + serializedName: "properties.networkAcls", + type: { + name: "Composite", + className: "NetworkRuleSet" + } + }, + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const UsageName: msRest.CompositeMapper = { + serializedName: "UsageName", + type: { + name: "Composite", + className: "UsageName", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + readOnly: true, + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const Usage: msRest.CompositeMapper = { + serializedName: "Usage", + type: { + name: "Composite", + className: "Usage", + modelProperties: { + unit: { + readOnly: true, + serializedName: "unit", + type: { + name: "Enum", + allowedValues: [ + "Count", + "Bytes", + "Seconds", + "Percent", + "CountsPerSecond", + "BytesPerSecond" + ] + } + }, + currentValue: { + readOnly: true, + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + readOnly: true, + serializedName: "limit", + type: { + name: "Number" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "Composite", + className: "UsageName" + } + } + } + } +}; + +export const AccountSasParameters: msRest.CompositeMapper = { + serializedName: "AccountSasParameters", + type: { + name: "Composite", + className: "AccountSasParameters", + modelProperties: { + services: { + required: true, + serializedName: "signedServices", + type: { + name: "String" + } + }, + resourceTypes: { + required: true, + serializedName: "signedResourceTypes", + type: { + name: "String" + } + }, + permissions: { + required: true, + serializedName: "signedPermission", + type: { + name: "String" + } + }, + iPAddressOrRange: { + serializedName: "signedIp", + type: { + name: "String" + } + }, + protocols: { + serializedName: "signedProtocol", + type: { + name: "Enum", + allowedValues: [ + "https,http", + "https" + ] + } + }, + sharedAccessStartTime: { + serializedName: "signedStart", + type: { + name: "DateTime" + } + }, + sharedAccessExpiryTime: { + required: true, + serializedName: "signedExpiry", + type: { + name: "DateTime" + } + }, + keyToSign: { + serializedName: "keyToSign", + type: { + name: "String" + } + } + } + } +}; + +export const ListAccountSasResponse: msRest.CompositeMapper = { + serializedName: "ListAccountSasResponse", + type: { + name: "Composite", + className: "ListAccountSasResponse", + modelProperties: { + accountSasToken: { + readOnly: true, + serializedName: "accountSasToken", + type: { + name: "String" + } + } + } + } +}; + +export const ServiceSasParameters: msRest.CompositeMapper = { + serializedName: "ServiceSasParameters", + type: { + name: "Composite", + className: "ServiceSasParameters", + modelProperties: { + canonicalizedResource: { + required: true, + serializedName: "canonicalizedResource", + type: { + name: "String" + } + }, + resource: { + serializedName: "signedResource", + type: { + name: "String" + } + }, + permissions: { + serializedName: "signedPermission", + type: { + name: "String" + } + }, + iPAddressOrRange: { + serializedName: "signedIp", + type: { + name: "String" + } + }, + protocols: { + serializedName: "signedProtocol", + type: { + name: "Enum", + allowedValues: [ + "https,http", + "https" + ] + } + }, + sharedAccessStartTime: { + serializedName: "signedStart", + type: { + name: "DateTime" + } + }, + sharedAccessExpiryTime: { + serializedName: "signedExpiry", + type: { + name: "DateTime" + } + }, + identifier: { + serializedName: "signedIdentifier", + constraints: { + MaxLength: 64 + }, + type: { + name: "String" + } + }, + partitionKeyStart: { + serializedName: "startPk", + type: { + name: "String" + } + }, + partitionKeyEnd: { + serializedName: "endPk", + type: { + name: "String" + } + }, + rowKeyStart: { + serializedName: "startRk", + type: { + name: "String" + } + }, + rowKeyEnd: { + serializedName: "endRk", + type: { + name: "String" + } + }, + keyToSign: { + serializedName: "keyToSign", + type: { + name: "String" + } + }, + cacheControl: { + serializedName: "rscc", + type: { + name: "String" + } + }, + contentDisposition: { + serializedName: "rscd", + type: { + name: "String" + } + }, + contentEncoding: { + serializedName: "rsce", + type: { + name: "String" + } + }, + contentLanguage: { + serializedName: "rscl", + type: { + name: "String" + } + }, + contentType: { + serializedName: "rsct", + type: { + name: "String" + } + } + } + } +}; + +export const ListServiceSasResponse: msRest.CompositeMapper = { + serializedName: "ListServiceSasResponse", + type: { + name: "Composite", + className: "ListServiceSasResponse", + modelProperties: { + serviceSasToken: { + readOnly: true, + serializedName: "serviceSasToken", + type: { + name: "String" + } + } + } + } +}; + +export const DateAfterModification: msRest.CompositeMapper = { + serializedName: "DateAfterModification", + type: { + name: "Composite", + className: "DateAfterModification", + modelProperties: { + daysAfterModificationGreaterThan: { + required: true, + serializedName: "daysAfterModificationGreaterThan", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const ManagementPolicyBaseBlob: msRest.CompositeMapper = { + serializedName: "ManagementPolicyBaseBlob", + type: { + name: "Composite", + className: "ManagementPolicyBaseBlob", + modelProperties: { + tierToCool: { + serializedName: "tierToCool", + type: { + name: "Composite", + className: "DateAfterModification" + } + }, + tierToArchive: { + serializedName: "tierToArchive", + type: { + name: "Composite", + className: "DateAfterModification" + } + }, + deleteProperty: { + serializedName: "delete", + type: { + name: "Composite", + className: "DateAfterModification" + } + } + } + } +}; + +export const DateAfterCreation: msRest.CompositeMapper = { + serializedName: "DateAfterCreation", + type: { + name: "Composite", + className: "DateAfterCreation", + modelProperties: { + daysAfterCreationGreaterThan: { + required: true, + serializedName: "daysAfterCreationGreaterThan", + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const ManagementPolicySnapShot: msRest.CompositeMapper = { + serializedName: "ManagementPolicySnapShot", + type: { + name: "Composite", + className: "ManagementPolicySnapShot", + modelProperties: { + deleteProperty: { + serializedName: "delete", + type: { + name: "Composite", + className: "DateAfterCreation" + } + } + } + } +}; + +export const ManagementPolicyAction: msRest.CompositeMapper = { + serializedName: "ManagementPolicyAction", + type: { + name: "Composite", + className: "ManagementPolicyAction", + modelProperties: { + baseBlob: { + serializedName: "baseBlob", + type: { + name: "Composite", + className: "ManagementPolicyBaseBlob" + } + }, + snapshot: { + serializedName: "snapshot", + type: { + name: "Composite", + className: "ManagementPolicySnapShot" + } + } + } + } +}; + +export const ManagementPolicyFilter: msRest.CompositeMapper = { + serializedName: "ManagementPolicyFilter", + type: { + name: "Composite", + className: "ManagementPolicyFilter", + modelProperties: { + prefixMatch: { + serializedName: "prefixMatch", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + blobTypes: { + required: true, + serializedName: "blobTypes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ManagementPolicyDefinition: msRest.CompositeMapper = { + serializedName: "ManagementPolicyDefinition", + type: { + name: "Composite", + className: "ManagementPolicyDefinition", + modelProperties: { + actions: { + required: true, + serializedName: "actions", + type: { + name: "Composite", + className: "ManagementPolicyAction" + } + }, + filters: { + serializedName: "filters", + type: { + name: "Composite", + className: "ManagementPolicyFilter" + } + } + } + } +}; + +export const ManagementPolicyRule: msRest.CompositeMapper = { + serializedName: "ManagementPolicyRule", + type: { + name: "Composite", + className: "ManagementPolicyRule", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'Lifecycle', + type: { + name: "String" + } + }, + definition: { + required: true, + serializedName: "definition", + type: { + name: "Composite", + className: "ManagementPolicyDefinition" + } + } + } + } +}; + +export const ManagementPolicySchema: msRest.CompositeMapper = { + serializedName: "ManagementPolicySchema", + type: { + name: "Composite", + className: "ManagementPolicySchema", + modelProperties: { + rules: { + required: true, + serializedName: "rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementPolicyRule" + } + } + } + } + } + } +}; + +export const ManagementPolicy: msRest.CompositeMapper = { + serializedName: "ManagementPolicy", + type: { + name: "Composite", + className: "ManagementPolicy", + modelProperties: { + ...Resource.type.modelProperties, + lastModifiedTime: { + readOnly: true, + serializedName: "properties.lastModifiedTime", + type: { + name: "DateTime" + } + }, + policy: { + required: true, + serializedName: "properties.policy", + type: { + name: "Composite", + className: "ManagementPolicySchema" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const UpdateHistoryProperty: msRest.CompositeMapper = { + serializedName: "UpdateHistoryProperty", + type: { + name: "Composite", + className: "UpdateHistoryProperty", + modelProperties: { + update: { + readOnly: true, + serializedName: "update", + type: { + name: "String" + } + }, + immutabilityPeriodSinceCreationInDays: { + readOnly: true, + serializedName: "immutabilityPeriodSinceCreationInDays", + type: { + name: "Number" + } + }, + timestamp: { + readOnly: true, + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + objectIdentifier: { + readOnly: true, + serializedName: "objectIdentifier", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + upn: { + readOnly: true, + serializedName: "upn", + type: { + name: "String" + } + } + } + } +}; + +export const ImmutabilityPolicyProperties: msRest.CompositeMapper = { + serializedName: "ImmutabilityPolicyProperties", + type: { + name: "Composite", + className: "ImmutabilityPolicyProperties", + modelProperties: { + immutabilityPeriodSinceCreationInDays: { + required: true, + serializedName: "properties.immutabilityPeriodSinceCreationInDays", + type: { + name: "Number" + } + }, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "String" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + }, + updateHistory: { + readOnly: true, + serializedName: "updateHistory", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UpdateHistoryProperty" + } + } + } + } + } + } +}; + +export const TagProperty: msRest.CompositeMapper = { + serializedName: "TagProperty", + type: { + name: "Composite", + className: "TagProperty", + modelProperties: { + tag: { + readOnly: true, + serializedName: "tag", + type: { + name: "String" + } + }, + timestamp: { + readOnly: true, + serializedName: "timestamp", + type: { + name: "DateTime" + } + }, + objectIdentifier: { + readOnly: true, + serializedName: "objectIdentifier", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + upn: { + readOnly: true, + serializedName: "upn", + type: { + name: "String" + } + } + } + } +}; + +export const LegalHoldProperties: msRest.CompositeMapper = { + serializedName: "LegalHoldProperties", + type: { + name: "Composite", + className: "LegalHoldProperties", + modelProperties: { + hasLegalHold: { + readOnly: true, + serializedName: "hasLegalHold", + type: { + name: "Boolean" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TagProperty" + } + } + } + } + } + } +}; + +export const BlobContainer: msRest.CompositeMapper = { + serializedName: "BlobContainer", + type: { + name: "Composite", + className: "BlobContainer", + modelProperties: { + ...AzureEntityResource.type.modelProperties, + publicAccess: { + serializedName: "properties.publicAccess", + type: { + name: "Enum", + allowedValues: [ + "Container", + "Blob", + "None" + ] + } + }, + lastModifiedTime: { + readOnly: true, + serializedName: "properties.lastModifiedTime", + type: { + name: "DateTime" + } + }, + leaseStatus: { + readOnly: true, + serializedName: "properties.leaseStatus", + type: { + name: "String" + } + }, + leaseState: { + readOnly: true, + serializedName: "properties.leaseState", + type: { + name: "String" + } + }, + leaseDuration: { + readOnly: true, + serializedName: "properties.leaseDuration", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + immutabilityPolicy: { + readOnly: true, + serializedName: "properties.immutabilityPolicy", + type: { + name: "Composite", + className: "ImmutabilityPolicyProperties" + } + }, + legalHold: { + readOnly: true, + serializedName: "properties.legalHold", + type: { + name: "Composite", + className: "LegalHoldProperties" + } + }, + hasLegalHold: { + readOnly: true, + serializedName: "properties.hasLegalHold", + type: { + name: "Boolean" + } + }, + hasImmutabilityPolicy: { + readOnly: true, + serializedName: "properties.hasImmutabilityPolicy", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ImmutabilityPolicy: msRest.CompositeMapper = { + serializedName: "ImmutabilityPolicy", + type: { + name: "Composite", + className: "ImmutabilityPolicy", + modelProperties: { + ...AzureEntityResource.type.modelProperties, + immutabilityPeriodSinceCreationInDays: { + required: true, + serializedName: "properties.immutabilityPeriodSinceCreationInDays", + type: { + name: "Number" + } + }, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "String" + } + } + } + } +}; + +export const LegalHold: msRest.CompositeMapper = { + serializedName: "LegalHold", + type: { + name: "Composite", + className: "LegalHold", + modelProperties: { + hasLegalHold: { + readOnly: true, + serializedName: "hasLegalHold", + type: { + name: "Boolean" + } + }, + tags: { + required: true, + serializedName: "tags", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ListContainerItem: msRest.CompositeMapper = { + serializedName: "ListContainerItem", + type: { + name: "Composite", + className: "ListContainerItem", + modelProperties: { + ...AzureEntityResource.type.modelProperties, + publicAccess: { + serializedName: "properties.publicAccess", + type: { + name: "Enum", + allowedValues: [ + "Container", + "Blob", + "None" + ] + } + }, + lastModifiedTime: { + readOnly: true, + serializedName: "properties.lastModifiedTime", + type: { + name: "DateTime" + } + }, + leaseStatus: { + readOnly: true, + serializedName: "properties.leaseStatus", + type: { + name: "String" + } + }, + leaseState: { + readOnly: true, + serializedName: "properties.leaseState", + type: { + name: "String" + } + }, + leaseDuration: { + readOnly: true, + serializedName: "properties.leaseDuration", + type: { + name: "String" + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + immutabilityPolicy: { + readOnly: true, + serializedName: "properties.immutabilityPolicy", + type: { + name: "Composite", + className: "ImmutabilityPolicyProperties" + } + }, + legalHold: { + readOnly: true, + serializedName: "properties.legalHold", + type: { + name: "Composite", + className: "LegalHoldProperties" + } + }, + hasLegalHold: { + readOnly: true, + serializedName: "properties.hasLegalHold", + type: { + name: "Boolean" + } + }, + hasImmutabilityPolicy: { + readOnly: true, + serializedName: "properties.hasImmutabilityPolicy", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ListContainerItems: msRest.CompositeMapper = { + serializedName: "ListContainerItems", + type: { + name: "Composite", + className: "ListContainerItems", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ListContainerItem" + } + } + } + } + } + } +}; + +export const CorsRule: msRest.CompositeMapper = { + serializedName: "CorsRule", + type: { + name: "Composite", + className: "CorsRule", + modelProperties: { + allowedOrigins: { + required: true, + serializedName: "allowedOrigins", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + allowedMethods: { + required: true, + serializedName: "allowedMethods", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxAgeInSeconds: { + required: true, + serializedName: "maxAgeInSeconds", + type: { + name: "Number" + } + }, + exposedHeaders: { + required: true, + serializedName: "exposedHeaders", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + allowedHeaders: { + required: true, + serializedName: "allowedHeaders", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CorsRules: msRest.CompositeMapper = { + serializedName: "CorsRules", + type: { + name: "Composite", + className: "CorsRules", + modelProperties: { + corsRules: { + serializedName: "corsRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + } + } + } +}; + +export const DeleteRetentionPolicy: msRest.CompositeMapper = { + serializedName: "DeleteRetentionPolicy", + type: { + name: "Composite", + className: "DeleteRetentionPolicy", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + days: { + serializedName: "days", + constraints: { + InclusiveMaximum: 365, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const BlobServiceProperties: msRest.CompositeMapper = { + serializedName: "BlobServiceProperties", + type: { + name: "Composite", + className: "BlobServiceProperties", + modelProperties: { + ...Resource.type.modelProperties, + cors: { + serializedName: "properties.cors", + type: { + name: "Composite", + className: "CorsRules" + } + }, + defaultServiceVersion: { + serializedName: "properties.defaultServiceVersion", + type: { + name: "String" + } + }, + deleteRetentionPolicy: { + serializedName: "properties.deleteRetentionPolicy", + type: { + name: "Composite", + className: "DeleteRetentionPolicy" + } + }, + automaticSnapshotPolicyEnabled: { + serializedName: "properties.automaticSnapshotPolicyEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const LeaseContainerRequest: msRest.CompositeMapper = { + serializedName: "LeaseContainerRequest", + type: { + name: "Composite", + className: "LeaseContainerRequest", + modelProperties: { + action: { + required: true, + serializedName: "action", + type: { + name: "String" + } + }, + leaseId: { + serializedName: "leaseId", + type: { + name: "String" + } + }, + breakPeriod: { + serializedName: "breakPeriod", + type: { + name: "Number" + } + }, + leaseDuration: { + serializedName: "leaseDuration", + type: { + name: "Number" + } + }, + proposedLeaseId: { + serializedName: "proposedLeaseId", + type: { + name: "String" + } + } + } + } +}; + +export const LeaseContainerResponse: msRest.CompositeMapper = { + serializedName: "LeaseContainerResponse", + type: { + name: "Composite", + className: "LeaseContainerResponse", + modelProperties: { + leaseId: { + serializedName: "leaseId", + type: { + name: "String" + } + }, + leaseTimeSeconds: { + serializedName: "leaseTimeSeconds", + type: { + name: "String" + } + } + } + } +}; + +export const BlobContainersCreateOrUpdateImmutabilityPolicyHeaders: msRest.CompositeMapper = { + serializedName: "blobcontainers-createorupdateimmutabilitypolicy-headers", + type: { + name: "Composite", + className: "BlobContainersCreateOrUpdateImmutabilityPolicyHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const BlobContainersGetImmutabilityPolicyHeaders: msRest.CompositeMapper = { + serializedName: "blobcontainers-getimmutabilitypolicy-headers", + type: { + name: "Composite", + className: "BlobContainersGetImmutabilityPolicyHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const BlobContainersDeleteImmutabilityPolicyHeaders: msRest.CompositeMapper = { + serializedName: "blobcontainers-deleteimmutabilitypolicy-headers", + type: { + name: "Composite", + className: "BlobContainersDeleteImmutabilityPolicyHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const BlobContainersLockImmutabilityPolicyHeaders: msRest.CompositeMapper = { + serializedName: "blobcontainers-lockimmutabilitypolicy-headers", + type: { + name: "Composite", + className: "BlobContainersLockImmutabilityPolicyHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const BlobContainersExtendImmutabilityPolicyHeaders: msRest.CompositeMapper = { + serializedName: "blobcontainers-extendimmutabilitypolicy-headers", + type: { + name: "Composite", + className: "BlobContainersExtendImmutabilityPolicyHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const StorageSkuListResult: msRest.CompositeMapper = { + serializedName: "StorageSkuListResult", + type: { + name: "Composite", + className: "StorageSkuListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Sku" + } + } + } + } + } + } +}; + +export const StorageAccountListResult: msRest.CompositeMapper = { + serializedName: "StorageAccountListResult", + type: { + name: "Composite", + className: "StorageAccountListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageAccount" + } + } + } + } + } + } +}; + +export const UsageListResult: msRest.CompositeMapper = { + serializedName: "UsageListResult", + type: { + name: "Composite", + className: "UsageListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Usage" + } + } + } + } + } + } +}; diff --git a/sdk/storage/arm-storage/lib/models/operationsMappers.ts b/sdk/storage/arm-storage/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..b0305ab29a80 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/operationsMappers.ts @@ -0,0 +1,20 @@ +/* + * 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 { + OperationListResult, + Operation, + OperationDisplay, + ServiceSpecification, + MetricSpecification, + Dimension, + CloudError +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/parameters.ts b/sdk/storage/arm-storage/lib/models/parameters.ts new file mode 100644 index 000000000000..cd6e0b657091 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/parameters.ts @@ -0,0 +1,174 @@ +/* + * 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"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const accountName: msRest.OperationURLParameter = { + parameterPath: "accountName", + mapper: { + required: true, + serializedName: "accountName", + constraints: { + MaxLength: 24, + MinLength: 3 + }, + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const blobServicesName: msRest.OperationURLParameter = { + parameterPath: "blobServicesName", + mapper: { + required: true, + isConstant: true, + serializedName: "BlobServicesName", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const containerName: msRest.OperationURLParameter = { + parameterPath: "containerName", + mapper: { + required: true, + serializedName: "containerName", + constraints: { + MaxLength: 63, + MinLength: 3 + }, + type: { + name: "String" + } + } +}; +export const expand: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "expand" + ], + mapper: { + serializedName: "$expand", + type: { + name: "Enum", + allowedValues: [ + "geoReplicationStats" + ] + } + } +}; +export const ifMatch0: msRest.OperationParameter = { + parameterPath: [ + "options", + "ifMatch" + ], + mapper: { + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const ifMatch1: msRest.OperationParameter = { + parameterPath: "ifMatch", + mapper: { + required: true, + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const immutabilityPolicyName: msRest.OperationURLParameter = { + parameterPath: "immutabilityPolicyName", + mapper: { + required: true, + isConstant: true, + serializedName: "immutabilityPolicyName", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const managementPolicyName: msRest.OperationURLParameter = { + parameterPath: "managementPolicyName", + mapper: { + required: true, + isConstant: true, + serializedName: "managementPolicyName", + defaultValue: 'default', + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/storage/arm-storage/lib/models/skusMappers.ts b/sdk/storage/arm-storage/lib/models/skusMappers.ts new file mode 100644 index 000000000000..a640f51f2e99 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/skusMappers.ts @@ -0,0 +1,18 @@ +/* + * 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 { + StorageSkuListResult, + Sku, + SKUCapability, + Restriction, + CloudError +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/storageAccountsMappers.ts b/sdk/storage/arm-storage/lib/models/storageAccountsMappers.ts new file mode 100644 index 000000000000..e38f54b96c86 --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/storageAccountsMappers.ts @@ -0,0 +1,67 @@ +/* + * 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 { + StorageAccountCheckNameAvailabilityParameters, + CheckNameAvailabilityResult, + CloudError, + StorageAccountCreateParameters, + Sku, + SKUCapability, + Restriction, + Identity, + CustomDomain, + Encryption, + EncryptionServices, + EncryptionService, + KeyVaultProperties, + NetworkRuleSet, + VirtualNetworkRule, + IPRule, + StorageAccount, + TrackedResource, + Resource, + BaseResource, + Endpoints, + GeoReplicationStats, + StorageAccountUpdateParameters, + StorageAccountListResult, + StorageAccountListKeysResult, + StorageAccountKey, + StorageAccountRegenerateKeyParameters, + AccountSasParameters, + ListAccountSasResponse, + ServiceSasParameters, + ListServiceSasResponse, + ManagementPolicy, + ManagementPolicySchema, + ManagementPolicyRule, + ManagementPolicyDefinition, + ManagementPolicyAction, + ManagementPolicyBaseBlob, + DateAfterModification, + ManagementPolicySnapShot, + DateAfterCreation, + ManagementPolicyFilter, + ProxyResource, + AzureEntityResource, + BlobContainer, + ImmutabilityPolicyProperties, + UpdateHistoryProperty, + LegalHoldProperties, + TagProperty, + ImmutabilityPolicy, + ListContainerItem, + BlobServiceProperties, + CorsRules, + CorsRule, + DeleteRetentionPolicy +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/models/usagesMappers.ts b/sdk/storage/arm-storage/lib/models/usagesMappers.ts new file mode 100644 index 000000000000..a107336dd42c --- /dev/null +++ b/sdk/storage/arm-storage/lib/models/usagesMappers.ts @@ -0,0 +1,17 @@ +/* + * 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 { + UsageListResult, + Usage, + UsageName, + CloudError +} from "../models/mappers"; + diff --git a/sdk/storage/arm-storage/lib/operations/blobContainers.ts b/sdk/storage/arm-storage/lib/operations/blobContainers.ts new file mode 100644 index 000000000000..ff206f3d474a --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/blobContainers.ts @@ -0,0 +1,1214 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/blobContainersMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a BlobContainers. */ +export class BlobContainers { + private readonly client: StorageManagementClientContext; + + /** + * Create a BlobContainers. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not + * return continuation token. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Creates a new container under the specified account as described by request body. The container + * resource includes metadata and properties for that container. It does not include a list of the + * blobs contained by the container. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the + * request will be unchanged. Update fails if the specified container doesn't already exist. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Gets properties of a specified container. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes specified container under its account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold + * follows an append pattern and does not clear out the existing tags that are not specified in the + * request. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param [options] The optional parameters + * @returns Promise + */ + setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param callback The callback + */ + setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param options The optional parameters + * @param callback The callback + */ + setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + tags, + options + }, + setLegalHoldOperationSpec, + callback) as Promise; + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent + * operation. ClearLegalHold clears out only the specified tags in the request. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param [options] The optional parameters + * @returns Promise + */ + clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param callback The callback + */ + clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case + * at SRP. + * @param options The optional parameters + * @param callback The callback + */ + clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + tags, + options + }, + clearLegalHoldOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not + * required for this operation. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param callback The callback + */ + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + immutabilityPeriodSinceCreationInDays, + options + }, + createOrUpdateImmutabilityPolicyOperationSpec, + callback) as Promise; + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and + * body. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersGetImmutabilityPolicyOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersGetImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; + getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersGetImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + getImmutabilityPolicyOperationSpec, + callback) as Promise; + } + + /** + * Aborts an unlocked immutability policy. The response of delete has + * immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. + * Deleting a locked immutability policy is not allowed, only way is to delete the container after + * deleting all blobs inside the container. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param [options] The optional parameters + * @returns Promise + */ + deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param callback The callback + */ + deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param options The optional parameters + * @param callback The callback + */ + deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + ifMatch, + options + }, + deleteImmutabilityPolicyOperationSpec, + callback) as Promise; + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param [options] The optional parameters + * @returns Promise + */ + lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param callback The callback + */ + lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param options The optional parameters + * @param callback The callback + */ + lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + ifMatch, + options + }, + lockImmutabilityPolicyOperationSpec, + callback) as Promise; + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only + * action allowed on a Locked policy will be this action. ETag in If-Match is required for this + * operation. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param [options] The optional parameters + * @returns Promise + */ + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param callback The callback + */ + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of + * "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied. + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the + * container since the policy creation, in days. + * @param options The optional parameters + * @param callback The callback + */ + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + ifMatch, + immutabilityPeriodSinceCreationInDays, + options + }, + extendImmutabilityPolicyOperationSpec, + callback) as Promise; + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete + * operations. The lock duration can be 15 to 60 seconds, or can be infinite. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param [options] The optional parameters + * @returns Promise + */ + lease(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersLeaseOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param callback The callback + */ + lease(resourceGroupName: string, accountName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param containerName The name of the blob container within the specified storage account. Blob + * container names must be between 3 and 63 characters in length and use numbers, lower-case + * letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by + * a letter or number. + * @param options The optional parameters + * @param callback The callback + */ + lease(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersLeaseOptionalParams, callback: msRest.ServiceCallback): void; + lease(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersLeaseOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + containerName, + options + }, + leaseOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListContainerItems + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + publicAccess: [ + "options", + "publicAccess" + ], + metadata: [ + "options", + "metadata" + ] + }, + mapper: { + ...Mappers.BlobContainer, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BlobContainer + }, + 201: { + bodyMapper: Mappers.BlobContainer + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + publicAccess: [ + "options", + "publicAccess" + ], + metadata: [ + "options", + "metadata" + ] + }, + mapper: { + ...Mappers.BlobContainer, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BlobContainer + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BlobContainer + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const setLegalHoldOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: "tags" + }, + mapper: { + ...Mappers.LegalHold, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.LegalHold + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const clearLegalHoldOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: "tags" + }, + mapper: { + ...Mappers.LegalHold, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.LegalHold + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateImmutabilityPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.immutabilityPolicyName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch0, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + immutabilityPeriodSinceCreationInDays: "immutabilityPeriodSinceCreationInDays" + }, + mapper: Mappers.ImmutabilityPolicy + }, + responses: { + 200: { + bodyMapper: Mappers.ImmutabilityPolicy, + headersMapper: Mappers.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getImmutabilityPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.immutabilityPolicyName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch0, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ImmutabilityPolicy, + headersMapper: Mappers.BlobContainersGetImmutabilityPolicyHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteImmutabilityPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.immutabilityPolicyName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ImmutabilityPolicy, + headersMapper: Mappers.BlobContainersDeleteImmutabilityPolicyHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const lockImmutabilityPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ImmutabilityPolicy, + headersMapper: Mappers.BlobContainersLockImmutabilityPolicyHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const extendImmutabilityPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch1, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + immutabilityPeriodSinceCreationInDays: "immutabilityPeriodSinceCreationInDays" + }, + mapper: Mappers.ImmutabilityPolicy + }, + responses: { + 200: { + bodyMapper: Mappers.ImmutabilityPolicy, + headersMapper: Mappers.BlobContainersExtendImmutabilityPolicyHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const leaseOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.containerName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.LeaseContainerRequest + }, + responses: { + 200: { + bodyMapper: Mappers.LeaseContainerResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/blobServices.ts b/sdk/storage/arm-storage/lib/operations/blobServices.ts new file mode 100644 index 000000000000..2dc8c9a71a14 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/blobServices.ts @@ -0,0 +1,180 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/blobServicesMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a BlobServices. */ +export class BlobServices { + private readonly client: StorageManagementClientContext; + + /** + * Create a BlobServices. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage + * Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for + * Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param [options] The optional parameters + * @returns Promise + */ + setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for + * Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param callback The callback + */ + setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for + * Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param options The optional parameters + * @param callback The callback + */ + setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + setServicePropertiesOperationSpec, + callback) as Promise; + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage + * Analytics and CORS (Cross-Origin Resource Sharing) rules. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + getServiceProperties(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + getServiceProperties(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + getServicePropertiesOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const setServicePropertiesOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.blobServicesName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.BlobServiceProperties, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BlobServiceProperties + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getServicePropertiesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.blobServicesName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BlobServiceProperties + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/index.ts b/sdk/storage/arm-storage/lib/operations/index.ts new file mode 100644 index 000000000000..58eac77cd453 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/index.ts @@ -0,0 +1,17 @@ +/* + * 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 * from "./operations"; +export * from "./skus"; +export * from "./storageAccounts"; +export * from "./usages"; +export * from "./managementPolicies"; +export * from "./blobServices"; +export * from "./blobContainers"; diff --git a/sdk/storage/arm-storage/lib/operations/managementPolicies.ts b/sdk/storage/arm-storage/lib/operations/managementPolicies.ts new file mode 100644 index 000000000000..a763547f92c9 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/managementPolicies.ts @@ -0,0 +1,246 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/managementPoliciesMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a ManagementPolicies. */ +export class ManagementPolicies { + private readonly client: StorageManagementClientContext; + + /** + * Create a ManagementPolicies. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Sets the managementpolicy to the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, accountName: string, policy: Models.ManagementPolicySchema, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, policy: Models.ManagementPolicySchema, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, policy: Models.ManagementPolicySchema, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, policy: Models.ManagementPolicySchema, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + policy, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.managementPolicyName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ManagementPolicy + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.managementPolicyName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + policy: "policy" + }, + mapper: { + ...Mappers.ManagementPolicy, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ManagementPolicy + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.managementPolicyName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/operations.ts b/sdk/storage/arm-storage/lib/operations/operations.ts new file mode 100644 index 000000000000..8ee6b722c5b2 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/operations.ts @@ -0,0 +1,74 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: StorageManagementClientContext; + + /** + * Create a Operations. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available Storage Rest API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Storage/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/skus.ts b/sdk/storage/arm-storage/lib/operations/skus.ts new file mode 100644 index 000000000000..4027b2210c50 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/skus.ts @@ -0,0 +1,77 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/skusMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a Skus. */ +export class Skus { + private readonly client: StorageManagementClientContext; + + /** + * Create a Skus. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StorageSkuListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/storageAccounts.ts b/sdk/storage/arm-storage/lib/operations/storageAccounts.ts new file mode 100644 index 000000000000..23f30a744e05 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/storageAccounts.ts @@ -0,0 +1,921 @@ +/* + * 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/storageAccountsMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a StorageAccounts. */ +export class StorageAccounts { + private readonly client: StorageManagementClientContext; + + /** + * Create a StorageAccounts. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Checks that the storage account name is valid and is not already in use. + * @param name The storage account name. + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param name The storage account name. + * @param callback The callback + */ + checkNameAvailability(name: string, callback: msRest.ServiceCallback): void; + /** + * @param name The storage account name. + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailability(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + name, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is + * already created and a subsequent create request is issued with different properties, the account + * properties will be updated. If an account is already created and a subsequent create or update + * request is issued with the exact same set of properties, the request will succeed. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide for the created account. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountCreateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,accountName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a storage account in Microsoft Azure. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU + * name, location, and account status. The ListKeys operation should be used to retrieve storage + * keys. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + getProperties(resourceGroupName: string, accountName: string, options?: Models.StorageAccountsGetPropertiesOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + getProperties(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + getProperties(resourceGroupName: string, accountName: string, options: Models.StorageAccountsGetPropertiesOptionalParams, callback: msRest.ServiceCallback): void; + getProperties(resourceGroupName: string, accountName: string, options?: Models.StorageAccountsGetPropertiesOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + getPropertiesOperationSpec, + callback) as Promise; + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a + * storage account. It can also be used to map the account to a custom domain. Only one custom + * domain is supported per storage account; the replacement/change of custom domain is not + * supported. In order to replace an old custom domain, the old value must be cleared/unregistered + * before a new value can be set. The update of multiple properties is supported. This call does + * not change the storage keys for the account. If you want to change the storage account keys, use + * the regenerate keys operation. The location and name of the storage account cannot be changed + * after creation. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide for the updated account. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide for the updated account. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide for the updated account. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not + * returned; use the ListKeys operation for this. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys + * are not returned; use the ListKeys operation for this. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists the access keys for the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + listKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + listKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listKeysOperationSpec, + callback) as Promise; + } + + /** + * Regenerates one of the access keys for the specified storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, + * key2. + * @param [options] The optional parameters + * @returns Promise + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, + * key2. + * @param callback The callback + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, + * key2. + * @param options The optional parameters + * @param callback The callback + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + keyName, + options + }, + regenerateKeyOperationSpec, + callback) as Promise; + } + + /** + * List SAS credentials of a storage account. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param [options] The optional parameters + * @returns Promise + */ + listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param callback The callback + */ + listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param options The optional parameters + * @param callback The callback + */ + listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + listAccountSASOperationSpec, + callback) as Promise; + } + + /** + * List service SAS credentials of a specific resource. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param [options] The optional parameters + * @returns Promise + */ + listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param callback The callback + */ + listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @param options The optional parameters + * @param callback The callback + */ + listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + listServiceSASOperationSpec, + callback) as Promise; + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The + * failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + failover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginFailover(resourceGroupName,accountName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Revoke user delegation keys. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + revokeUserDelegationKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param callback The callback + */ + revokeUserDelegationKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param options The optional parameters + * @param callback The callback + */ + revokeUserDelegationKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + revokeUserDelegationKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + revokeUserDelegationKeysOperationSpec, + callback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is + * already created and a subsequent create request is issued with different properties, the account + * properties will be updated. If an account is already created and a subsequent create or update + * request is issued with the exact same set of properties, the request will succeed. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to provide for the created account. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountCreateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The + * failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage + * account names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param [options] The optional parameters + * @returns Promise + */ + beginFailover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + options + }, + beginFailoverOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: "name" + }, + mapper: { + ...Mappers.StorageAccountCheckNameAvailabilityParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getPropertiesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.expand + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StorageAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.StorageAccountUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StorageAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StorageAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StorageAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.StorageAccountListKeysResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const regenerateKeyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + keyName: "keyName" + }, + mapper: { + ...Mappers.StorageAccountRegenerateKeyParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StorageAccountListKeysResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listAccountSASOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.AccountSasParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ListAccountSasResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listServiceSASOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.ServiceSasParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ListServiceSasResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const revokeUserDelegationKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.StorageAccountCreateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.StorageAccount + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginFailoverOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/operations/usages.ts b/sdk/storage/arm-storage/lib/operations/usages.ts new file mode 100644 index 000000000000..91323ebdc449 --- /dev/null +++ b/sdk/storage/arm-storage/lib/operations/usages.ts @@ -0,0 +1,83 @@ +/* + * 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 Models from "../models"; +import * as Mappers from "../models/usagesMappers"; +import * as Parameters from "../models/parameters"; +import { StorageManagementClientContext } from "../storageManagementClientContext"; + +/** Class representing a Usages. */ +export class Usages { + private readonly client: StorageManagementClientContext; + + /** + * Create a Usages. + * @param {StorageManagementClientContext} client Reference to the service client. + */ + constructor(client: StorageManagementClientContext) { + this.client = client; + } + + /** + * Gets the current usage count and the limit for the resources of the location under the + * subscription. + * @param location The location of the Azure Storage resource. + * @param [options] The optional parameters + * @returns Promise + */ + listByLocation(location: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param location The location of the Azure Storage resource. + * @param callback The callback + */ + listByLocation(location: string, callback: msRest.ServiceCallback): void; + /** + * @param location The location of the Azure Storage resource. + * @param options The optional parameters + * @param callback The callback + */ + listByLocation(location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByLocation(location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + location, + options + }, + listByLocationOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByLocationOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages", + urlParameters: [ + Parameters.subscriptionId, + Parameters.location + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.UsageListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/storage/arm-storage/lib/storageManagementClient.ts b/sdk/storage/arm-storage/lib/storageManagementClient.ts new file mode 100644 index 000000000000..8e7dac35f1b3 --- /dev/null +++ b/sdk/storage/arm-storage/lib/storageManagementClient.ts @@ -0,0 +1,54 @@ +/* + * 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 Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { StorageManagementClientContext } from "./storageManagementClientContext"; + + +class StorageManagementClient extends StorageManagementClientContext { + // Operation groups + operations: operations.Operations; + skus: operations.Skus; + storageAccounts: operations.StorageAccounts; + usages: operations.Usages; + managementPolicies: operations.ManagementPolicies; + blobServices: operations.BlobServices; + blobContainers: operations.BlobContainers; + + /** + * Initializes a new instance of the StorageManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorageManagementClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.skus = new operations.Skus(this); + this.storageAccounts = new operations.StorageAccounts(this); + this.usages = new operations.Usages(this); + this.managementPolicies = new operations.ManagementPolicies(this); + this.blobServices = new operations.BlobServices(this); + this.blobContainers = new operations.BlobContainers(this); + } +} + +// Operation Specifications + +export { + StorageManagementClient, + StorageManagementClientContext, + Models as StorageManagementModels, + Mappers as StorageManagementMappers +}; +export * from "./operations"; diff --git a/sdk/storage/arm-storage/lib/storageManagementClientContext.ts b/sdk/storage/arm-storage/lib/storageManagementClientContext.ts new file mode 100644 index 000000000000..37be2a0f37f2 --- /dev/null +++ b/sdk/storage/arm-storage/lib/storageManagementClientContext.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. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-storage"; +const packageVersion = "8.0.0"; + +export class StorageManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the StorageManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The ID of the target subscription. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorageManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-04-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/storage/arm-storage/package.json b/sdk/storage/arm-storage/package.json index fa13e923f0f2..28b35746ca02 100644 --- a/sdk/storage/arm-storage/package.json +++ b/sdk/storage/arm-storage/package.json @@ -4,8 +4,8 @@ "description": "StorageManagementClient Library with typescript type definitions for node.js and browser.", "version": "8.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.6.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -26,7 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/storage/arm-storage", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -43,8 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -53,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-storage.js.map'\" -o ./dist/arm-storage.min.js ./dist/arm-storage.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false } diff --git a/sdk/storage/arm-storage/tsconfig.json b/sdk/storage/arm-storage/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/storage/arm-storage/tsconfig.json +++ b/sdk/storage/arm-storage/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }