appcenter-cli
Version:
Command line tool for Visual Studio App Center
113 lines (112 loc) • 4.32 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.RepositoryConfigurationsImpl = void 0;
const coreClient = require("@azure/core-client");
const Mappers = require("../models/mappers");
const Parameters = require("../models/parameters");
/** Class containing RepositoryConfigurations operations. */
class RepositoryConfigurationsImpl {
/**
* Initialize a new instance of the class RepositoryConfigurations class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Returns the repository build configuration status of the app
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
list(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, listOperationSpec);
}
/**
* Configures the repository for build
* @param ownerName The name of the owner
* @param appName The name of the application
* @param repo The repository information
* @param options The options parameters.
*/
createOrUpdate(ownerName, appName, repo, options) {
return this.client.sendOperationRequest({ ownerName, appName, repo, options }, createOrUpdateOperationSpec);
}
/**
* Removes the configuration for the repository
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
delete(ownerName, appName, options) {
return this.client.sendOperationRequest({ ownerName, appName, options }, deleteOperationSpec);
}
}
exports.RepositoryConfigurationsImpl = RepositoryConfigurationsImpl;
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/repo_config",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "PathsIxrc01V01AppsOwnerNameAppNameRepoConfigGetResponses200ContentApplicationJsonSchemaItems"
}
}
}
}
},
default: {
bodyMapper: Mappers.PathsPitaxjV01AppsOwnerNameAppNameRepoConfigGetResponsesDefaultContentApplicationJsonSchema
}
},
queryParameters: [Parameters.includeInactive],
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/repo_config",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.Paths1I47WvgV01AppsOwnerNameAppNameRepoConfigPostResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.PathsP7E5UzV01AppsOwnerNameAppNameRepoConfigPostResponsesDefaultContentApplicationJsonSchema
}
},
requestBody: Parameters.repo,
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer
};
const deleteOperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/repo_config",
httpMethod: "DELETE",
responses: {
200: {
bodyMapper: Mappers.PathsX38Gw3V01AppsOwnerNameAppNameRepoConfigDeleteResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper: Mappers.Paths1Lqz171V01AppsOwnerNameAppNameRepoConfigDeleteResponsesDefaultContentApplicationJsonSchema
}
},
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};