appcenter-cli
Version:
Command line tool for Visual Studio App Center
76 lines (70 loc) • 2.42 kB
text/typescript
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { CodePushDeploymentUpload } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { AppCenterClient } from "../appCenterClient";
import {
CodePushDeploymentUploadCreateOptionalParams,
CodePushDeploymentUploadCreateResponse
} from "../models";
/** Class containing CodePushDeploymentUpload operations. */
export class CodePushDeploymentUploadImpl implements CodePushDeploymentUpload {
private readonly client: AppCenterClient;
/**
* Initialize a new instance of the class CodePushDeploymentUpload class.
* @param client Reference to the service client
*/
constructor(client: AppCenterClient) {
this.client = client;
}
/**
* Create a new CodePush release upload for the specified deployment
* @param deploymentName deployment name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
create(
deploymentName: string,
ownerName: string,
appName: string,
options?: CodePushDeploymentUploadCreateOptionalParams
): Promise<CodePushDeploymentUploadCreateResponse> {
return this.client.sendOperationRequest(
{ deploymentName, ownerName, appName, options },
createOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOperationSpec: coreClient.OperationSpec = {
path:
"/v0.1/apps/{owner_name}/{app_name}/deployments/{deployment_name}/uploads",
httpMethod: "POST",
responses: {
200: {
bodyMapper:
Mappers.Paths1Kb13FjV01AppsOwnerNameAppNameDeploymentsDeploymentNameUploadsPostResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper:
Mappers.PathsO9B77WV01AppsOwnerNameAppNameDeploymentsDeploymentNameUploadsPostResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.deploymentName
],
headerParameters: [Parameters.accept],
serializer
};