appcenter-cli
Version:
Command line tool for Visual Studio App Center
146 lines (145 loc) • 5.14 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.BranchConfigurationsImpl = void 0;
const coreClient = require("@azure/core-client");
const Mappers = require("../models/mappers");
const Parameters = require("../models/parameters");
/** Class containing BranchConfigurations operations. */
class BranchConfigurationsImpl {
/**
* Initialize a new instance of the class BranchConfigurations class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Gets the branch configuration
* @param branch The branch name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
get(branch, ownerName, appName, options) {
return this.client.sendOperationRequest({ branch, ownerName, appName, options }, getOperationSpec);
}
/**
* Configures the branch for build
* @param branch The branch name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param params Parameters of the configuration
* @param options The options parameters.
*/
create(branch, ownerName, appName, params, options) {
return this.client.sendOperationRequest({ branch, ownerName, appName, params, options }, createOperationSpec);
}
/**
* Reconfigures the branch for build
* @param branch The branch name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param params Parameters of the configuration
* @param options The options parameters.
*/
update(branch, ownerName, appName, params, options) {
return this.client.sendOperationRequest({ branch, ownerName, appName, params, options }, updateOperationSpec);
}
/**
* Deletes the branch build configuration
* @param branch The branch name
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
delete(branch, ownerName, appName, options) {
return this.client.sendOperationRequest({ branch, ownerName, appName, options }, deleteOperationSpec);
}
}
exports.BranchConfigurationsImpl = BranchConfigurationsImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/branches/{branch}/config",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PathsRuhky8V01AppsOwnerNameAppNameBranchesBranchConfigGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.Paths1Pv0ByrV01AppsOwnerNameAppNameBranchesBranchConfigGetResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.branch
],
headerParameters: [Parameters.accept],
serializer
};
const createOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/branches/{branch}/config",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.PathsYdemoiV01AppsOwnerNameAppNameBranchesBranchConfigPostResponses200ContentApplicationJsonSchema
}
},
requestBody: Parameters.params1,
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.branch
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const updateOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/branches/{branch}/config",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.PathsRa6DxlV01AppsOwnerNameAppNameBranchesBranchConfigPutResponses200ContentApplicationJsonSchema
}
},
requestBody: Parameters.params2,
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.branch
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const deleteOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/branches/{branch}/config",
httpMethod: "DELETE",
responses: {
200: {
bodyMapper: Mappers.PathsQs07S5V01AppsOwnerNameAppNameBranchesBranchConfigDeleteResponses200ContentApplicationJsonSchema
}
},
requestBody: Parameters.payload,
urlParameters: [
Parameters.$host,
Parameters.ownerName,
Parameters.appName,
Parameters.branch
],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};