/**
 * Identity and Access Management Service API
 * APIs for managing users, groups, compartments, and policies.
 * OpenAPI spec version: 20160918
 *
 *
 * NOTE: This class is auto generated by OracleSDKGenerator.
 * Do not edit the class manually.
 *
 * Copyright (c) 2020, 2022, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */ import * as serviceRequests from "./request" ; import * as serviceResponses from "./response" ; import * as models from "./model" ; import { IdentityClient } from "./client" ; import { genericWaiter , genericTerminalConditionWaiter , WaiterConfiguration } from "oci-common" ; export class IdentityWaiter { public constructor ( private client , private readonly config ? ) { } param request param targetStates return public async forCompartment ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getCompartment ( request ) , response => targetStates . includes ( response . compartment . lifecycleState ! ) , targetStates . includes ( models . Compartment . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forDomain ( request , ... targetStates ) { return genericWaiter ( this . config , ( ) => this . client . getDomain ( request ) , response => targetStates . includes ( response . domain . lifecycleState ! ) ) ; } param request param targetStates return public async forDynamicGroup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getDynamicGroup ( request ) , response => targetStates . includes ( response . dynamicGroup . lifecycleState ! ) , targetStates . includes ( models . DynamicGroup . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forGroup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getGroup ( request ) , response => targetStates . includes ( response . group . lifecycleState ! ) , targetStates . includes ( models . Group . LifecycleState . Deleted ) ) ; } param request return public async forIamWorkRequest ( request ) { return genericWaiter ( this . config , ( ) => this . client . getIamWorkRequest ( request ) , response => ( response . iamWorkRequest . timeFinished ? true : false ) ) ; } param request param targetStates return public async forIdentityProvider ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getIdentityProvider ( request ) , response => targetStates . includes ( response . identityProvider . lifecycleState ! ) , targetStates . includes ( models . IdentityProvider . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forIdpGroupMapping ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getIdpGroupMapping ( request ) , response => targetStates . includes ( response . idpGroupMapping . lifecycleState ! ) , targetStates . includes ( models . IdpGroupMapping . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forPolicy ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getPolicy ( request ) , response => targetStates . includes ( response . policy . lifecycleState ! ) , targetStates . includes ( models . Policy . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forTag ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getTag ( request ) , response => targetStates . includes ( response . tag . lifecycleState ! ) , targetStates . includes ( models . Tag . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forTagDefault ( request , ... targetStates ) { return genericWaiter ( this . config , ( ) => this . client . getTagDefault ( request ) , response => targetStates . includes ( response . tagDefault . lifecycleState ! ) ) ; } param request param targetStates return public async forTagNamespace ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getTagNamespace ( request ) , response => targetStates . includes ( response . tagNamespace . lifecycleState ! ) , targetStates . includes ( models . TagNamespace . LifecycleState . Deleted ) ) ; } param request return public async forTaggingWorkRequest ( request ) { return genericWaiter ( this . config , ( ) => this . client . getTaggingWorkRequest ( request ) , response => ( response . taggingWorkRequest . timeFinished ? true : false ) ) ; } param request param targetStates return public async forUser ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getUser ( request ) , response => targetStates . includes ( response . user . lifecycleState ! ) , targetStates . includes ( models . User . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forUserGroupMembership ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getUserGroupMembership ( request ) , response => targetStates . includes ( response . userGroupMembership . lifecycleState ! ) , targetStates . includes ( models . UserGroupMembership . LifecycleState . Deleted ) ) ; } param request return public async forWorkRequest ( request ) { return genericWaiter ( this . config , ( ) => this . client . getWorkRequest ( request ) , response => ( response . workRequest . timeFinished ? true : false ) ) ; } }