appcenter-cli
Version:
Command line tool for Visual Studio App Center
62 lines (61 loc) • 2.47 kB
JavaScript
;
/*
* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodePushDeploymentReleaseImpl = void 0;
const coreClient = require("@azure/core-client");
const Mappers = require("../models/mappers");
const Parameters = require("../models/parameters");
/** Class containing CodePushDeploymentRelease operations. */
class CodePushDeploymentReleaseImpl {
/**
* Initialize a new instance of the class CodePushDeploymentRelease class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Rollback the latest or a specific release for an app deployment
* @param deploymentName deployment name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
rollback(deploymentName, ownerName, appName, options) {
return this.client.sendOperationRequest({ deploymentName, ownerName, appName, options }, rollbackOperationSpec);
}
}
exports.CodePushDeploymentReleaseImpl = CodePushDeploymentReleaseImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const rollbackOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/deployments/{deployment_name}/rollback_release",
httpMethod: "POST",
responses: {
201: {
bodyMapper: Mappers.PathsCv4Vu0V01AppsOwnerNameAppNameDeploymentsDeploymentNameRollbackReleasePostResponses201ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.PathsC97F7PV01AppsOwnerNameAppNameDeploymentsDeploymentNameRollbackReleasePostResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: {
parameterPath: { label: ["options", "label"] },
mapper: Mappers.Paths1G1PzhgV01AppsOwnerNameAppNameDeploymentsDeploymentNameRollbackReleasePostRequestbodyContentApplicationJsonSchema
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.deploymentName
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};