From 25bcc0092fc366321447fa55edd2a3f2ad81642a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 30 Jul 2019 16:21:28 +0000 Subject: [PATCH] Generated from 37642561a860df9667384ebce420db00ed8dcb6e chore: jsonfmt storage --- sdk/storage/arm-storage/package.json | 6 +- .../src/models/blobServicesMappers.ts | 1 + sdk/storage/arm-storage/src/models/index.ts | 32 ++++++++- sdk/storage/arm-storage/src/models/mappers.ts | 29 +++++++- .../src/operations/blobServices.ts | 66 +++++++++++++++++++ sdk/storage/arm-storage/tsconfig.json | 2 +- 6 files changed, 128 insertions(+), 8 deletions(-) diff --git a/sdk/storage/arm-storage/package.json b/sdk/storage/arm-storage/package.json index f9e62f584a53..0b7ffe1c91b2 100644 --- a/sdk/storage/arm-storage/package.json +++ b/sdk/storage/arm-storage/package.json @@ -4,9 +4,9 @@ "description": "StorageManagementClient Library with typescript type definitions for node.js and browser.", "version": "9.0.1", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.0", + "@azure/ms-rest-js": "^2.0.3", + "tslib": "^1.10.0" }, "keywords": [ "node", diff --git a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts index acd63448676a..87036c250f91 100644 --- a/sdk/storage/arm-storage/src/models/blobServicesMappers.ts +++ b/sdk/storage/arm-storage/src/models/blobServicesMappers.ts @@ -11,6 +11,7 @@ export { AzureFilesIdentityBasedAuthentication, BaseResource, BlobContainer, + BlobServiceItems, BlobServiceProperties, CloudError, CorsRule, diff --git a/sdk/storage/arm-storage/src/models/index.ts b/sdk/storage/arm-storage/src/models/index.ts index 965040feb82d..35d1fb1c4280 100644 --- a/sdk/storage/arm-storage/src/models/index.ts +++ b/sdk/storage/arm-storage/src/models/index.ts @@ -1007,7 +1007,7 @@ export interface ListServiceSasResponse { */ export interface DateAfterModification { /** - * Integer value indicating the age in days after last modification + * Value indicating the age in days after last modification */ daysAfterModificationGreaterThan: number; } @@ -1035,7 +1035,7 @@ export interface ManagementPolicyBaseBlob { */ export interface DateAfterCreation { /** - * Integer value indicating the age in days after creation + * Value indicating the age in days after creation */ daysAfterCreationGreaterThan: number; } @@ -1749,6 +1749,14 @@ export interface StorageAccountListResult extends Array { export interface UsageListResult extends Array { } +/** + * @interface + * An interface representing the BlobServiceItems. + * @extends Array + */ +export interface BlobServiceItems extends Array { +} + /** * @interface * Response schema. Contains list of blobs returned, and if paging is requested or required, a URL @@ -2328,6 +2336,26 @@ export type ManagementPoliciesCreateOrUpdateResponse = ManagementPolicy & { }; }; +/** + * Contains response data for the list operation. + */ +export type BlobServicesListResponse = BlobServiceItems & { + /** + * 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: BlobServiceItems; + }; +}; + /** * Contains response data for the setServiceProperties operation. */ diff --git a/sdk/storage/arm-storage/src/models/mappers.ts b/sdk/storage/arm-storage/src/models/mappers.ts index ab321c841e84..c3848de72fb1 100644 --- a/sdk/storage/arm-storage/src/models/mappers.ts +++ b/sdk/storage/arm-storage/src/models/mappers.ts @@ -1601,7 +1601,8 @@ export const DateAfterModification: msRest.CompositeMapper = { required: true, serializedName: "daysAfterModificationGreaterThan", constraints: { - InclusiveMinimum: 0 + InclusiveMinimum: 0, + MultipleOf: 1 }, type: { name: "Number" @@ -1652,7 +1653,8 @@ export const DateAfterCreation: msRest.CompositeMapper = { required: true, serializedName: "daysAfterCreationGreaterThan", constraints: { - InclusiveMinimum: 0 + InclusiveMinimum: 0, + MultipleOf: 1 }, type: { name: "Number" @@ -2668,6 +2670,29 @@ export const UsageListResult: msRest.CompositeMapper = { } }; +export const BlobServiceItems: msRest.CompositeMapper = { + serializedName: "BlobServiceItems", + type: { + name: "Composite", + className: "BlobServiceItems", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobServiceProperties" + } + } + } + } + } + } +}; + export const ListContainerItems: msRest.CompositeMapper = { serializedName: "ListContainerItems", type: { diff --git a/sdk/storage/arm-storage/src/operations/blobServices.ts b/sdk/storage/arm-storage/src/operations/blobServices.ts index 2dc8c9a71a14..045c7851de5a 100644 --- a/sdk/storage/arm-storage/src/operations/blobServices.ts +++ b/sdk/storage/arm-storage/src/operations/blobServices.ts @@ -26,6 +26,47 @@ export class BlobServices { this.client = client; } + /** + * List blob services of storage account. It returns a collection of one object named default. + * @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; + } + /** * Sets the properties of a storage account’s Blob service, including properties for Storage * Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -120,6 +161,31 @@ export class BlobServices { // 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", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BlobServiceItems + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + const setServicePropertiesOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}", diff --git a/sdk/storage/arm-storage/tsconfig.json b/sdk/storage/arm-storage/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/storage/arm-storage/tsconfig.json +++ b/sdk/storage/arm-storage/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true