/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/domainsMappers"; import * as Parameters from "../models/parameters"; import { GraphRbacManagementClientContext } from "../graphRbacManagementClientContext"; /** Class representing a Domains. */ export class Domains { private readonly client: GraphRbacManagementClientContext; /** * Create a Domains. * @param {GraphRbacManagementClientContext} client Reference to the service client. */ constructor(client: GraphRbacManagementClientContext) { this.client = client; } /** * Gets a list of domains for the current tenant. * @param [options] The optional parameters * @returns Promise */ list(options?: Models.DomainsListOptionalParams): Promise; /** * @param callback The callback */ list(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback */ list(options: Models.DomainsListOptionalParams, callback: msRest.ServiceCallback): void; list(options?: Models.DomainsListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, callback) as Promise; } /** * Gets a specific domain in the current tenant. * @param domainName name of the domain. * @param [options] The optional parameters * @returns Promise */ get(domainName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param domainName name of the domain. * @param callback The callback */ get(domainName: string, callback: msRest.ServiceCallback): void; /** * @param domainName name of the domain. * @param options The optional parameters * @param callback The callback */ get(domainName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; get(domainName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { domainName, options }, getOperationSpec, callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{tenantID}/domains", urlParameters: [ Parameters.tenantID ], queryParameters: [ Parameters.filter, Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.DomainListResult }, default: { bodyMapper: Mappers.CloudError } }, serializer }; const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{tenantID}/domains/{domainName}", urlParameters: [ Parameters.domainName, Parameters.tenantID ], queryParameters: [ Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.Domain }, default: { bodyMapper: Mappers.CloudError } }, serializer };