import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { DeletedApplications } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { GraphRbacManagementClient } from "../graphRbacManagementClient" ; import { Application , DeletedApplicationsListNextOptionalParams , DeletedApplicationsListOptionalParams , DeletedApplicationsRestoreOptionalParams , DeletedApplicationsRestoreResponse , DeletedApplicationsListResponse , DeletedApplicationsHardDeleteOptionalParams , DeletedApplicationsListNextResponse } from "../models" ; /** Class containing DeletedApplications operations. */ export class DeletedApplicationsImpl implements DeletedApplications { private readonly client : GraphRbacManagementClient ; param client constructor ( client ) { this . client = client ; } param options public list ( options ? ) { const iter = this . listPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( options ) ; } } ; } private async * listPagingPage ( options ? ) { let result = await this . _list ( options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _listNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( options ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param nextLink param options public listNext ( nextLink , options ? ) { const iter = this . listNextPagingAll ( nextLink , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listNextPagingPage ( nextLink , options ) ; } } ; } private async * listNextPagingPage ( nextLink , options ? ) { let result = await this . _listNext ( nextLink , options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _listNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * listNextPagingAll ( nextLink , options ? ) { for await ( const page of this . listNextPagingPage ( nextLink , options ) ) { yield * page ; } } param objectId param options restore ( objectId , options ? ) { return this . client . sendOperationRequest ( { objectId , options } , restoreOperationSpec ) ; } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param applicationObjectId param options hardDelete ( applicationObjectId , options ? ) { return this . client . sendOperationRequest ( { applicationObjectId , options } , hardDeleteOperationSpec ) ; } param nextLink param options private _listNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const restoreOperationSpec = { path : "/{tenantID}/deletedApplications/{objectId}/restore" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . Application } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . objectId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationSpec = { path : "/{tenantID}/deletedApplications" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationListResult } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . tenantID ] , headerParameters : [ Parameters . accept ] , serializer } ; const hardDeleteOperationSpec = { path : "/{tenantID}/deletedApplications/{applicationObjectId}" , httpMethod : "DELETE" , responses : { 204 : { } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . applicationObjectId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "/{tenantID}/{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationListResult } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;