appcenter-cli
Version:
Command line tool for Visual Studio App Center
148 lines (140 loc) • 4.7 kB
text/typescript
/*
* 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.
*/
import { BillingAggregatedInformation } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { AppCenterClient } from "../appCenterClient";
import {
BillingAggregatedInformationGetForOrgOptionalParams,
BillingAggregatedInformationGetForOrgResponse,
BillingAggregatedInformationGetAllOptionalParams,
BillingAggregatedInformationGetAllResponse,
BillingAggregatedInformationGetByAppOptionalParams,
BillingAggregatedInformationGetByAppResponse
} from "../models";
/** Class containing BillingAggregatedInformation operations. */
export class BillingAggregatedInformationImpl
implements BillingAggregatedInformation {
private readonly client: AppCenterClient;
/**
* Initialize a new instance of the class BillingAggregatedInformation class.
* @param client Reference to the service client
*/
constructor(client: AppCenterClient) {
this.client = client;
}
/**
* Aggregated Billing Information for a given Organization.
* @param orgName The name of the Organization
* @param options The options parameters.
*/
getForOrg(
orgName: string,
options?: BillingAggregatedInformationGetForOrgOptionalParams
): Promise<BillingAggregatedInformationGetForOrgResponse> {
return this.client.sendOperationRequest(
{ orgName, options },
getForOrgOperationSpec
);
}
/**
* Aggregated Billing Information for the requesting user and the organizations in which the user is an
* admin.
* @param options The options parameters.
*/
getAll(
options?: BillingAggregatedInformationGetAllOptionalParams
): Promise<BillingAggregatedInformationGetAllResponse> {
return this.client.sendOperationRequest({ options }, getAllOperationSpec);
}
/**
* Aggregated Billing Information for owner of a given app.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
getByApp(
ownerName: string,
appName: string,
options?: BillingAggregatedInformationGetByAppOptionalParams
): Promise<BillingAggregatedInformationGetByAppResponse> {
return this.client.sendOperationRequest(
{ ownerName, appName, options },
getByAppOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getForOrgOperationSpec: coreClient.OperationSpec = {
path: "/v0.1/orgs/{orgName}/billing/aggregated",
httpMethod: "GET",
responses: {
200: {
bodyMapper:
Mappers.PathsI4V0ItV01OrgsOrgnameBillingAggregatedGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper:
Mappers.Paths17En3P7V01OrgsOrgnameBillingAggregatedGetResponsesDefaultContentApplicationJsonSchema
}
},
queryParameters: [
Parameters.service,
Parameters.period,
Parameters.showOriginalPlans
],
urlParameters: [Parameters.$host, Parameters.orgName1],
headerParameters: [Parameters.accept],
serializer
};
const getAllOperationSpec: coreClient.OperationSpec = {
path: "/v0.1/billing/allAccountsAggregated",
httpMethod: "GET",
responses: {
200: {
bodyMapper:
Mappers.Paths19Yz4JgV01BillingAllaccountsaggregatedGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper:
Mappers.Paths1Pm9ZzuV01BillingAllaccountsaggregatedGetResponsesDefaultContentApplicationJsonSchema
}
},
queryParameters: [
Parameters.showOriginalPlans,
Parameters.service1,
Parameters.period1
],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getByAppOperationSpec: coreClient.OperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/billing/aggregated",
httpMethod: "GET",
responses: {
200: {
bodyMapper:
Mappers.Paths5MjbktV01AppsOwnerNameAppNameBillingAggregatedGetResponses200ContentApplicationJsonSchema
},
default: {
bodyMapper:
Mappers.PathsN4OwfxV01AppsOwnerNameAppNameBillingAggregatedGetResponsesDefaultContentApplicationJsonSchema
}
},
queryParameters: [
Parameters.showOriginalPlans,
Parameters.service2,
Parameters.period2
],
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept],
serializer
};