/**
 * Core Services API
 * Use the Core Services API to manage resources such as virtual cloud networks (VCNs),
compute instances, and block storage volumes. For more information, see the console
documentation for the [Networking](/iaas/Content/Network/Concepts/overview.htm),
[Compute](/iaas/Content/Compute/Concepts/computeoverview.htm), and
[Block Volume](/iaas/Content/Block/Concepts/overview.htm) services.

 * 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 { VirtualNetworkClient } from "./client" ; import { genericWaiter , genericTerminalConditionWaiter , WaiterConfiguration } from "oci-common" ; import { waitForWorkRequest , WorkRequestClient , responses } from "oci-workrequests" ; export class VirtualNetworkWaiter { public constructor ( private client , private workRequestClient , private readonly config ? ) { } param request return public async forAddIpv6VcnCidr ( request ) { const addIpv6VcnCidrResponse = await this . client . addIpv6VcnCidr ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , addIpv6VcnCidrResponse . opcWorkRequestId ) ; return { response : addIpv6VcnCidrResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forAddVcnCidr ( request ) { const addVcnCidrResponse = await this . client . addVcnCidr ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , addVcnCidrResponse . opcWorkRequestId ) ; return { response : addVcnCidrResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forChangeDrgCompartment ( request ) { const changeDrgCompartmentResponse = await this . client . changeDrgCompartment ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , changeDrgCompartmentResponse . opcWorkRequestId ) ; return { response : changeDrgCompartmentResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forChangeSubnetCompartment ( request ) { const changeSubnetCompartmentResponse = await this . client . changeSubnetCompartment ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , changeSubnetCompartmentResponse . opcWorkRequestId ) ; return { response : changeSubnetCompartmentResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forChangeVcnCompartment ( request ) { const changeVcnCompartmentResponse = await this . client . changeVcnCompartment ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , changeVcnCompartmentResponse . opcWorkRequestId ) ; return { response : changeVcnCompartmentResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forChangeVlanCompartment ( request ) { const changeVlanCompartmentResponse = await this . client . changeVlanCompartment ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , changeVlanCompartmentResponse . opcWorkRequestId ) ; return { response : changeVlanCompartmentResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forDeleteByoipRange ( request ) { const deleteByoipRangeResponse = await this . client . deleteByoipRange ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , deleteByoipRangeResponse . opcWorkRequestId ) ; return { response : deleteByoipRangeResponse , workRequestResponse : getWorkRequestResponse } ; } param request param targetStates return public async forByoipRange ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getByoipRange ( request ) , response => targetStates . includes ( response . byoipRange . lifecycleState ! ) , targetStates . includes ( models . ByoipRange . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forCrossConnect ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getCrossConnect ( request ) , response => targetStates . includes ( response . crossConnect . lifecycleState ! ) , targetStates . includes ( models . CrossConnect . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forCrossConnectGroup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getCrossConnectGroup ( request ) , response => targetStates . includes ( response . crossConnectGroup . lifecycleState ! ) , targetStates . includes ( models . CrossConnectGroup . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forDhcpOptions ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getDhcpOptions ( request ) , response => targetStates . includes ( response . dhcpOptions . lifecycleState ! ) , targetStates . includes ( models . DhcpOptions . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forDrg ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getDrg ( request ) , response => targetStates . includes ( response . drg . lifecycleState ! ) , targetStates . includes ( models . Drg . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forDrgAttachment ( request , ... targetStates ) { return genericWaiter ( this . config , ( ) => this . client . getDrgAttachment ( request ) , response => targetStates . includes ( response . drgAttachment . lifecycleState ! ) ) ; } param request param targetStates return public async forDrgRouteDistribution ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getDrgRouteDistribution ( request ) , response => targetStates . includes ( response . drgRouteDistribution . lifecycleState ! ) , targetStates . includes ( models . DrgRouteDistribution . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forDrgRouteTable ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getDrgRouteTable ( request ) , response => targetStates . includes ( response . drgRouteTable . lifecycleState ! ) , targetStates . includes ( models . DrgRouteTable . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forIPSecConnection ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getIPSecConnection ( request ) , response => targetStates . includes ( response . iPSecConnection . lifecycleState ! ) , targetStates . includes ( models . IPSecConnection . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forIPSecConnectionTunnel ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getIPSecConnectionTunnel ( request ) , response => targetStates . includes ( response . iPSecConnectionTunnel . lifecycleState ! ) , targetStates . includes ( models . IPSecConnectionTunnel . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forInternetGateway ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getInternetGateway ( request ) , response => targetStates . includes ( response . internetGateway . lifecycleState ! ) , targetStates . includes ( models . InternetGateway . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forIpv6 ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getIpv6 ( request ) , response => targetStates . includes ( response . ipv6 . lifecycleState ! ) , targetStates . includes ( models . Ipv6 . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forLocalPeeringGatewayonPeeringStatus ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getLocalPeeringGateway ( request ) , response => targetStates . includes ( response . localPeeringGateway . peeringStatus ! ) , targetStates . includes ( models . LocalPeeringGateway . PeeringStatus . Revoked ) ) ; } param request param targetStates return public async forLocalPeeringGatewayonLifecycleState ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getLocalPeeringGateway ( request ) , response => targetStates . includes ( response . localPeeringGateway . lifecycleState ! ) , targetStates . includes ( models . LocalPeeringGateway . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forNatGateway ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getNatGateway ( request ) , response => targetStates . includes ( response . natGateway . lifecycleState ! ) , targetStates . includes ( models . NatGateway . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forNetworkSecurityGroup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getNetworkSecurityGroup ( request ) , response => targetStates . includes ( response . networkSecurityGroup . lifecycleState ! ) , targetStates . includes ( models . NetworkSecurityGroup . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forPublicIp ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getPublicIp ( request ) , response => targetStates . includes ( response . publicIp . lifecycleState ! ) , targetStates . includes ( models . PublicIp . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forPublicIpPool ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getPublicIpPool ( request ) , response => targetStates . includes ( response . publicIpPool . lifecycleState ! ) , targetStates . includes ( models . PublicIpPool . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forRemotePeeringConnectiononLifecycleState ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getRemotePeeringConnection ( request ) , response => targetStates . includes ( response . remotePeeringConnection . lifecycleState ! ) , targetStates . includes ( models . RemotePeeringConnection . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forRemotePeeringConnectiononPeeringStatus ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getRemotePeeringConnection ( request ) , response => targetStates . includes ( response . remotePeeringConnection . peeringStatus ! ) , targetStates . includes ( models . RemotePeeringConnection . PeeringStatus . Revoked ) ) ; } param request param targetStates return public async forRouteTable ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getRouteTable ( request ) , response => targetStates . includes ( response . routeTable . lifecycleState ! ) , targetStates . includes ( models . RouteTable . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forSecurityList ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getSecurityList ( request ) , response => targetStates . includes ( response . securityList . lifecycleState ! ) , targetStates . includes ( models . SecurityList . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forServiceGateway ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getServiceGateway ( request ) , response => targetStates . includes ( response . serviceGateway . lifecycleState ! ) , targetStates . includes ( models . ServiceGateway . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forSubnet ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getSubnet ( request ) , response => targetStates . includes ( response . subnet . lifecycleState ! ) , targetStates . includes ( models . Subnet . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVcn ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVcn ( request ) , response => targetStates . includes ( response . vcn . lifecycleState ! ) , targetStates . includes ( models . Vcn . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVcnDnsResolverAssociation ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVcnDnsResolverAssociation ( request ) , response => targetStates . includes ( response . vcnDnsResolverAssociation . lifecycleState ! ) , targetStates . includes ( models . VcnDnsResolverAssociation . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVirtualCircuit ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVirtualCircuit ( request ) , response => targetStates . includes ( response . virtualCircuit . lifecycleState ! ) , targetStates . includes ( models . VirtualCircuit . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVlan ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVlan ( request ) , response => targetStates . includes ( response . vlan . lifecycleState ! ) , targetStates . includes ( models . Vlan . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVnic ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVnic ( request ) , response => targetStates . includes ( response . vnic . lifecycleState ! ) , targetStates . includes ( models . Vnic . LifecycleState . Terminated ) ) ; } param request return public async forModifyVcnCidr ( request ) { const modifyVcnCidrResponse = await this . client . modifyVcnCidr ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , modifyVcnCidrResponse . opcWorkRequestId ) ; return { response : modifyVcnCidrResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forRemoveVcnCidr ( request ) { const removeVcnCidrResponse = await this . client . removeVcnCidr ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , removeVcnCidrResponse . opcWorkRequestId ) ; return { response : removeVcnCidrResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forUpgradeDrg ( request ) { const upgradeDrgResponse = await this . client . upgradeDrg ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , upgradeDrgResponse . opcWorkRequestId ) ; return { response : upgradeDrgResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forValidateByoipRange ( request ) { const validateByoipRangeResponse = await this . client . validateByoipRange ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , validateByoipRangeResponse . opcWorkRequestId ) ; return { response : validateByoipRangeResponse , workRequestResponse : getWorkRequestResponse } ; } }