Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
discriminators,
AscOperation,
CloudError,
ErrorResponse
} from "../models/mappers";
64 changes: 64 additions & 0 deletions sdk/storagecache/arm-storagecache/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,50 @@ export interface CloudErrorBody {
target?: string;
}

/**
* Describes the format of Error response.
*/
export interface ErrorResponse {
/**
* Error code
*/
code?: string;
/**
* Error message indicating why the operation failed.
*/
message?: string;
}

/**
* The status of operation.
*/
export interface AscOperation {
/**
* The operation Id.
*/
id?: string;
/**
* The operation name.
*/
name?: string;
/**
* The start time of the operation.
*/
startTime?: string;
/**
* The end time of the operation.
*/
endTime?: string;
/**
* The status of the operation.
*/
status?: string;
/**
* The error detail of the operation if any.
*/
error?: ErrorResponse;
}

/**
* Cache identity properties.
*/
Expand Down Expand Up @@ -953,6 +997,26 @@ export type UsageModelsListNextResponse = UsageModelsResult & {
};
};

/**
* Contains response data for the get operation.
*/
export type AscOperationsGetResponse = AscOperation & {
/**
* 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: AscOperation;
};
};

/**
* Contains response data for the list operation.
*/
Expand Down
69 changes: 69 additions & 0 deletions sdk/storagecache/arm-storagecache/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,75 @@ export const CloudErrorBody: msRest.CompositeMapper = {
}
};

export const ErrorResponse: msRest.CompositeMapper = {
serializedName: "ErrorResponse",
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
code: {
serializedName: "code",
type: {
name: "String"
}
},
message: {
serializedName: "message",
type: {
name: "String"
}
}
}
}
};

export const AscOperation: msRest.CompositeMapper = {
serializedName: "AscOperation",
type: {
name: "Composite",
className: "AscOperation",
modelProperties: {
id: {
serializedName: "id",
type: {
name: "String"
}
},
name: {
serializedName: "name",
type: {
name: "String"
}
},
startTime: {
serializedName: "startTime",
type: {
name: "String"
}
},
endTime: {
serializedName: "endTime",
type: {
name: "String"
}
},
status: {
serializedName: "status",
type: {
name: "String"
}
},
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorResponse"
}
}
}
}
};

export const CacheIdentity: msRest.CompositeMapper = {
serializedName: "CacheIdentity",
type: {
Expand Down
20 changes: 20 additions & 0 deletions sdk/storagecache/arm-storagecache/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ export const cacheName: msRest.OperationURLParameter = {
}
}
};
export const location: msRest.OperationURLParameter = {
parameterPath: "location",
mapper: {
required: true,
serializedName: "location",
type: {
name: "String"
}
}
};
export const nextPageLink: msRest.OperationURLParameter = {
parameterPath: "nextPageLink",
mapper: {
Expand All @@ -54,6 +64,16 @@ export const nextPageLink: msRest.OperationURLParameter = {
},
skipEncoding: true
};
export const operationId: msRest.OperationURLParameter = {
parameterPath: "operationId",
mapper: {
required: true,
serializedName: "operationId",
type: {
name: "String"
}
}
};
export const resourceGroupName: msRest.OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
Expand Down
87 changes: 87 additions & 0 deletions sdk/storagecache/arm-storagecache/src/operations/ascOperations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* 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/ascOperationsMappers";
import * as Parameters from "../models/parameters";
import { StorageCacheManagementClientContext } from "../storageCacheManagementClientContext";

/** Class representing a AscOperations. */
export class AscOperations {
private readonly client: StorageCacheManagementClientContext;

/**
* Create a AscOperations.
* @param {StorageCacheManagementClientContext} client Reference to the service client.
*/
constructor(client: StorageCacheManagementClientContext) {
this.client = client;
}

/**
* Gets the status of an asynchronous operation for the Azure HPC cache
* @param location The region name which the operation will lookup into.
* @param operationId The operation id which uniquely identifies the asynchronous operation.
* @param [options] The optional parameters
* @returns Promise<Models.AscOperationsGetResponse>
*/
get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise<Models.AscOperationsGetResponse>;
/**
* @param location The region name which the operation will lookup into.
* @param operationId The operation id which uniquely identifies the asynchronous operation.
* @param callback The callback
*/
get(location: string, operationId: string, callback: msRest.ServiceCallback<Models.AscOperation>): void;
/**
* @param location The region name which the operation will lookup into.
* @param operationId The operation id which uniquely identifies the asynchronous operation.
* @param options The optional parameters
* @param callback The callback
*/
get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AscOperation>): void;
get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AscOperation>, callback?: msRest.ServiceCallback<Models.AscOperation>): Promise<Models.AscOperationsGetResponse> {
return this.client.sendOperationRequest(
{
location,
operationId,
options
},
getOperationSpec,
callback) as Promise<Models.AscOperationsGetResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}",
urlParameters: [
Parameters.subscriptionId,
Parameters.location,
Parameters.operationId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.AscOperation
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};
1 change: 1 addition & 0 deletions sdk/storagecache/arm-storagecache/src/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
export * from "./operations";
export * from "./skus";
export * from "./usageModels";
export * from "./ascOperations";
export * from "./caches";
export * from "./storageTargets";
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext {
operations: operations.Operations;
skus: operations.Skus;
usageModels: operations.UsageModels;
ascOperations: operations.AscOperations;
caches: operations.Caches;
storageTargets: operations.StorageTargets;

Expand All @@ -35,6 +36,7 @@ class StorageCacheManagementClient extends StorageCacheManagementClientContext {
this.operations = new operations.Operations(this);
this.skus = new operations.Skus(this);
this.usageModels = new operations.UsageModels(this);
this.ascOperations = new operations.AscOperations(this);
this.caches = new operations.Caches(this);
this.storageTargets = new operations.StorageTargets(this);
}
Expand Down