UNPKG

appcenter-cli

Version:

Command line tool for Visual Studio App Center

122 lines (121 loc) 4.11 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.UserApiTokensImpl = void 0; const coreClient = require("@azure/core-client"); const Mappers = require("../models/mappers"); const Parameters = require("../models/parameters"); /** Class containing UserApiTokens operations. */ class UserApiTokensImpl { /** * Initialize a new instance of the class UserApiTokens class. * @param client Reference to the service client */ constructor(client) { this.client = client; } /** * Delete the user api_token object with the specific id * @param apiTokenId The unique ID (UUID) of the api token * @param options The options parameters. */ delete(apiTokenId, options) { return this.client.sendOperationRequest({ apiTokenId, options }, deleteOperationSpec); } /** * Returns api tokens for the authenticated user * @param options The options parameters. */ list(options) { return this.client.sendOperationRequest({ options }, listOperationSpec); } /** * Creates a new User API token * @param options The options parameters. */ create(options) { return this.client.sendOperationRequest({ options }, createOperationSpec); } } exports.UserApiTokensImpl = UserApiTokensImpl; // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const deleteOperationSpec = { path: "/v0.1/api_tokens/{api_token_id}", httpMethod: "DELETE", responses: { 204: {}, 400: { bodyMapper: Mappers.Paths1X61Db6V01ApiTokensApiTokenIdDeleteResponses400ContentApplicationJsonSchema }, 401: { bodyMapper: Mappers.Paths1140VhkV01ApiTokensApiTokenIdDeleteResponses401ContentApplicationJsonSchema }, 404: { bodyMapper: Mappers.PathsD8RxloV01ApiTokensApiTokenIdDeleteResponses404ContentApplicationJsonSchema } }, urlParameters: [Parameters.$host, Parameters.apiTokenId], headerParameters: [Parameters.accept], serializer }; const listOperationSpec = { path: "/v0.1/api_tokens", httpMethod: "GET", responses: { 200: { bodyMapper: { type: { name: "Sequence", element: { type: { name: "Composite", className: "Paths18ZssypV01ApiTokensGetResponses200ContentApplicationJsonSchemaItems" } } } } }, 400: { bodyMapper: Mappers.Paths1Eu1Qp7V01ApiTokensGetResponses400ContentApplicationJsonSchema }, 401: { bodyMapper: Mappers.Paths1Jnqp8FV01ApiTokensGetResponses401ContentApplicationJsonSchema } }, urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer }; const createOperationSpec = { path: "/v0.1/api_tokens", httpMethod: "POST", responses: { 201: { bodyMapper: Mappers.PathsC2U0SxV01ApiTokensPostResponses201ContentApplicationJsonSchema }, 400: { bodyMapper: Mappers.Paths1VzgmvnV01ApiTokensPostResponses400ContentApplicationJsonSchema }, 401: { bodyMapper: Mappers.Paths1Uv4MczV01ApiTokensPostResponses401ContentApplicationJsonSchema } }, requestBody: { parameterPath: { description: ["options", "description"], scope: ["options", "scope"] }, mapper: Mappers.Paths163K2XcV01ApiTokensPostRequestbodyContentApplicationJsonSchema }, urlParameters: [Parameters.$host], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer };