/**
 * 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 { BlockstorageClient } from "./client" ; import { genericWaiter , genericTerminalConditionWaiter , WaiterConfiguration } from "oci-common" ; import { waitForWorkRequest , WorkRequestClient , responses } from "oci-workrequests" ; export class BlockstorageWaiter { public constructor ( private client , private workRequestClient , private readonly config ? ) { } param request return public async forCopyBootVolumeBackup ( request ) { const copyBootVolumeBackupResponse = await this . client . copyBootVolumeBackup ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , copyBootVolumeBackupResponse . opcWorkRequestId ) ; return { response : copyBootVolumeBackupResponse , workRequestResponse : getWorkRequestResponse } ; } param request return public async forCopyVolumeBackup ( request ) { const copyVolumeBackupResponse = await this . client . copyVolumeBackup ( request ) ; const getWorkRequestResponse = await waitForWorkRequest ( this . config , this . workRequestClient , copyVolumeBackupResponse . opcWorkRequestId ) ; return { response : copyVolumeBackupResponse , workRequestResponse : getWorkRequestResponse } ; } param request param targetStates return public async forBlockVolumeReplica ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getBlockVolumeReplica ( request ) , response => targetStates . includes ( response . blockVolumeReplica . lifecycleState ! ) , targetStates . includes ( models . BlockVolumeReplica . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forBootVolume ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getBootVolume ( request ) , response => targetStates . includes ( response . bootVolume . lifecycleState ! ) , targetStates . includes ( models . BootVolume . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forBootVolumeBackup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getBootVolumeBackup ( request ) , response => targetStates . includes ( response . bootVolumeBackup . lifecycleState ! ) , targetStates . includes ( models . BootVolumeBackup . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forBootVolumeReplica ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getBootVolumeReplica ( request ) , response => targetStates . includes ( response . bootVolumeReplica . lifecycleState ! ) , targetStates . includes ( models . BootVolumeReplica . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVolume ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVolume ( request ) , response => targetStates . includes ( response . volume . lifecycleState ! ) , targetStates . includes ( models . Volume . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVolumeBackup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVolumeBackup ( request ) , response => targetStates . includes ( response . volumeBackup . lifecycleState ! ) , targetStates . includes ( models . VolumeBackup . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVolumeGroup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVolumeGroup ( request ) , response => targetStates . includes ( response . volumeGroup . lifecycleState ! ) , targetStates . includes ( models . VolumeGroup . LifecycleState . Terminated ) ) ; } param request param targetStates return public async forVolumeGroupBackup ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getVolumeGroupBackup ( request ) , response => targetStates . includes ( response . volumeGroupBackup . lifecycleState ! ) , targetStates . includes ( models . VolumeGroupBackup . LifecycleState . Terminated ) ) ; } }