appcenter-cli
Version:
Command line tool for Visual Studio App Center
73 lines (67 loc) • 2.27 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 { Identity } 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 {
IdentityGetUsersOptionalParams,
IdentityGetUsersResponse
} from "../models";
/** Class containing Identity operations. */
export class IdentityImpl implements Identity {
private readonly client: AppCenterClient;
/**
* Initialize a new instance of the class Identity class.
* @param client Reference to the service client
*/
constructor(client: AppCenterClient) {
this.client = client;
}
/**
* Returns users of a tenant.
* Returns all users if no searchTerm param is specified.
* @param ownerName The name of the owner
* @param appName The name of the application
* @param options The options parameters.
*/
getUsers(
ownerName: string,
appName: string,
options?: IdentityGetUsersOptionalParams
): Promise<IdentityGetUsersResponse> {
return this.client.sendOperationRequest(
{ ownerName, appName, options },
getUsersOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getUsersOperationSpec: coreClient.OperationSpec = {
path: "/v0.1/apps/{owner_name}/{app_name}/auth/users",
httpMethod: "GET",
responses: {
200: {
bodyMapper: { type: { name: "Stream" }, serializedName: "parsedResponse" }
},
401: {
bodyMapper:
Mappers.Paths1458PiV01AppsOwnerNameAppNameAuthUsersGetResponses401ContentApplicationJsonSchema
},
500: {
bodyMapper:
Mappers.Paths1Bjskc1V01AppsOwnerNameAppNameAuthUsersGetResponses500ContentApplicationJsonSchema
}
},
queryParameters: [Parameters.searchTerm],
urlParameters: [Parameters.$host, Parameters.ownerName, Parameters.appName],
headerParameters: [Parameters.accept, Parameters.aCAuthorizationAADGraph],
serializer
};