UNPKG

appcenter-cli

Version:

Command line tool for Visual Studio App Center

186 lines (185 loc) 6.31 kB
"use strict"; /* * 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.OrganizationsImpl = void 0; const coreClient = require("@azure/core-client"); const Mappers = require("../models/mappers"); const Parameters = require("../models/parameters"); /** Class containing Organizations operations. */ class OrganizationsImpl { /** * Initialize a new instance of the class Organizations class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** * Returns the details of a single organization * @param orgName The organization's name * @param options The options parameters. */ get(orgName, options) { return this.client.sendOperationRequest({ orgName, options }, getOperationSpec); } /** * Returns a list of organizations the requesting user has access to * @param orgName The organization's name * @param options The options parameters. */ update(orgName, options) { return this.client.sendOperationRequest({ orgName, options }, updateOperationSpec); } /** * Deletes a single organization * @param orgName The organization's name * @param options The options parameters. */ delete(orgName, options) { return this.client.sendOperationRequest({ orgName, options }, deleteOperationSpec); } /** * Creates a new organization and returns it to the caller * @param options The options parameters. */ createOrUpdate(options) { return this.client.sendOperationRequest({ options }, createOrUpdateOperationSpec); } /** * Returns a list of organizations the requesting user has access to * @param options The options parameters. */ list(options) { return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Returns a list organizations in which the requesting user is an admin * @param options The options parameters. */ listAdministered(options) { return this.client.sendOperationRequest({ options }, listAdministeredOperationSpec); } } exports.OrganizationsImpl = OrganizationsImpl; // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec = { path: "/v0.1/orgs/{org_name}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Paths1Sl6Qy7V01OrgsOrgNameGetResponses200ContentApplicationJsonSchema }, default: { bodyMapper: Mappers.Paths16NvgokV01OrgsOrgNameGetResponsesDefaultContentApplicationJsonSchema } }, urlParameters: [Parameters.$host, Parameters.orgName], headerParameters: [Parameters.accept], serializer }; const updateOperationSpec = { path: "/v0.1/orgs/{org_name}", httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.Paths1Vgfr6WV01OrgsOrgNamePatchResponses200ContentApplicationJsonSchema }, default: { bodyMapper: Mappers.Paths11Pjgn9V01OrgsOrgNamePatchResponsesDefaultContentApplicationJsonSchema } }, requestBody: { parameterPath: { displayName: ["options", "displayName"], name: ["options", "name"] }, mapper: Object.assign(Object.assign({}, Mappers.Paths600DxeV01OrgsOrgNamePatchRequestbodyContentApplicationJsonSchema), { required: true }) }, urlParameters: [Parameters.$host, Parameters.orgName], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer }; const deleteOperationSpec = { path: "/v0.1/orgs/{org_name}", httpMethod: "DELETE", responses: { 204: {}, default: { bodyMapper: Mappers.Paths9Ngr72V01OrgsOrgNameDeleteResponsesDefaultContentApplicationJsonSchema } }, urlParameters: [Parameters.$host, Parameters.orgName], headerParameters: [Parameters.accept], serializer }; const createOrUpdateOperationSpec = { path: "/v0.1/orgs", httpMethod: "POST", responses: { 201: { bodyMapper: Mappers.Paths5Gk61LV01OrgsPostResponses201ContentApplicationJsonSchema }, default: { bodyMapper: Mappers.Paths92RvyjV01OrgsPostResponsesDefaultContentApplicationJsonSchema } }, requestBody: { parameterPath: { displayName: ["options", "displayName"], name: ["options", "name"] }, mapper: Object.assign(Object.assign({}, Mappers.Paths184FzfwV01OrgsPostRequestbodyContentApplicationJsonSchema), { required: true }) }, urlParameters: [Parameters.$host], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer }; const listOperationSpec = { path: "/v0.1/orgs", httpMethod: "GET", responses: { 200: { bodyMapper: { type: { name: "Sequence", element: { type: { name: "Composite", className: "Paths1Ft71BmV01OrgsGetResponses200ContentApplicationJsonSchemaItems" } } } } }, default: { bodyMapper: Mappers.PathsZre2DkV01OrgsGetResponsesDefaultContentApplicationJsonSchema } }, urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer }; const listAdministeredOperationSpec = { path: "/v0.1/administeredOrgs", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.PathsSnamasV01AdministeredorgsGetResponses200ContentApplicationJsonSchema }, default: { bodyMapper: Mappers.PathsHjvrvyV01AdministeredorgsGetResponsesDefaultContentApplicationJsonSchema } }, urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer };