/**
 * 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 { ComputeManagementClient } from "./client" ; import { genericWaiter , genericTerminalConditionWaiter , WaiterConfiguration } from "oci-common" ; import { waitForWorkRequest , WorkRequestClient , responses } from "oci-workrequests" ; export class ComputeManagementWaiter { public constructor ( private client , private workRequestClient , private readonly config ? ) { } param request return public async forAttachInstancePoolInstance ( request ) { const attachInstancePoolInstanceResponse = await this . client . attachInstancePoolInstance ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , attachInstancePoolInstanceResponse . opcWorkRequestId ) ; return { response : attachInstancePoolInstanceResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forCreateClusterNetwork ( request ) { const createClusterNetworkResponse = await this . client . createClusterNetwork ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , createClusterNetworkResponse . opcWorkRequestId ) ; return { response : createClusterNetworkResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forDetachInstancePoolInstance ( request ) { const detachInstancePoolInstanceResponse = await this . client . detachInstancePoolInstance ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , detachInstancePoolInstanceResponse . opcWorkRequestId ) ; return { response : detachInstancePoolInstanceResponse , workRequestResponse : getWorkRequestResponse } ; } param request param targetStates return public async forClusterNetwork ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getClusterNetwork ( request ) , response => targetStates . includes ( response . clusterNetwork . lifecycleState ! ) , targetStates . includes ( models . ClusterNetwork . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forInstancePool ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getInstancePool ( request ) , response => targetStates . includes ( response . instancePool . lifecycleState ! ) , targetStates . includes ( models . InstancePool . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forInstancePoolInstance ( request , ... targetStates ) { return genericWaiter ( this . config , ( ) => this . client . getInstancePoolInstance ( request ) , response => targetStates . includes ( response . instancePoolInstance . lifecycleState ! ) ) ; } param request param targetStates return public async forInstancePoolLoadBalancerAttachment ( request , ... targetStates ) { return genericWaiter ( this . config , ( ) => this . client . getInstancePoolLoadBalancerAttachment ( request ) , response => targetStates . includes ( response . instancePoolLoadBalancerAttachment . lifecycleState ! ) ) ; } param request return public async forLaunchInstanceConfiguration ( request ) { const launchInstanceConfigurationResponse = await this . client . launchInstanceConfiguration ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , launchInstanceConfigurationResponse . opcWorkRequestId ) ; return { response : launchInstanceConfigurationResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forTerminateClusterNetwork ( request ) { const terminateClusterNetworkResponse = await this . client . terminateClusterNetwork ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , terminateClusterNetworkResponse . opcWorkRequestId ) ; return { response : terminateClusterNetworkResponse , workRequestResponse : getWorkRequestResponse } ; } }