/* * 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/signedInUserMappers"; import * as Parameters from "../models/parameters"; import { GraphRbacManagementClientContext } from "../graphRbacManagementClientContext"; /** Class representing a SignedInUser. */ export class SignedInUser { private readonly client: GraphRbacManagementClientContext; /** * Create a SignedInUser. * @param {GraphRbacManagementClientContext} client Reference to the service client. */ constructor(client: GraphRbacManagementClientContext) { this.client = client; } /** * Gets the details for the currently logged-in user. * @param [options] The optional parameters * @returns Promise */ get(options?: msRest.RequestOptionsBase): Promise; /** * @param callback The callback */ get(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback */ get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, getOperationSpec, callback) as Promise; } /** * Get the list of directory objects that are owned by the user. * @param [options] The optional parameters * @returns Promise */ listOwnedObjects(options?: msRest.RequestOptionsBase): Promise; /** * @param callback The callback */ listOwnedObjects(callback: msRest.ServiceCallback): void; /** * @param options The optional parameters * @param callback The callback */ listOwnedObjects(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listOwnedObjects(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOwnedObjectsOperationSpec, callback) as Promise; } /** * Get the list of directory objects that are owned by the user. * @param nextLink Next link for the list operation. * @param [options] The optional parameters * @returns Promise */ listOwnedObjectsNext(nextLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextLink Next link for the list operation. * @param callback The callback */ listOwnedObjectsNext(nextLink: string, callback: msRest.ServiceCallback): void; /** * @param nextLink Next link for the list operation. * @param options The optional parameters * @param callback The callback */ listOwnedObjectsNext(nextLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; listOwnedObjectsNext(nextLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextLink, options }, listOwnedObjectsNextOperationSpec, callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{tenantID}/me", urlParameters: [ Parameters.tenantID ], queryParameters: [ Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.User }, default: { bodyMapper: Mappers.GraphError } }, serializer }; const listOwnedObjectsOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{tenantID}/me/ownedObjects", urlParameters: [ Parameters.tenantID ], queryParameters: [ Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.DirectoryObjectListResult }, default: { bodyMapper: Mappers.GraphError } }, serializer }; const listOwnedObjectsNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "{tenantID}/{nextLink}", urlParameters: [ Parameters.nextLink, Parameters.tenantID ], queryParameters: [ Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { bodyMapper: Mappers.DirectoryObjectListResult }, default: { bodyMapper: Mappers.GraphError } }, serializer };