/**
 * Cloud Advisor API
 * Use the Cloud Advisor API to find potential inefficiencies in your tenancy and address them.
Cloud Advisor can help you save money, improve performance, strengthen system resilience, and improve security.
For more information, see [Cloud Advisor](/Content/CloudAdvisor/Concepts/cloudadvisoroverview.htm).

 * OpenAPI spec version: 20200606
 *
 *
 * 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 { OptimizerClient } from "./client" ; import { genericWaiter , genericTerminalConditionWaiter , WaiterConfiguration } from "oci-common" ; export class OptimizerWaiter { public constructor ( private client , private readonly config ? ) { } param request param targetStates return public async forCategory ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getCategory ( request ) , response => targetStates . includes ( response . category . lifecycleState ! ) , targetStates . includes ( models . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forEnrollmentStatus ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getEnrollmentStatus ( request ) , response => targetStates . includes ( response . enrollmentStatus . lifecycleState ! ) , targetStates . includes ( models . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forProfile ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getProfile ( request ) , response => targetStates . includes ( response . profile . lifecycleState ! ) , targetStates . includes ( models . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forRecommendation ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getRecommendation ( request ) , response => targetStates . includes ( response . recommendation . lifecycleState ! ) , targetStates . includes ( models . LifecycleState . Deleted ) ) ; } param request param targetStates return public async forResourceAction ( request , ... targetStates ) { return genericTerminalConditionWaiter ( this . config , ( ) => this . client . getResourceAction ( request ) , response => targetStates . includes ( response . resourceAction . lifecycleState ! ) , targetStates . includes ( models . LifecycleState . Deleted ) ) ; } param request return public async forWorkRequest ( request ) { return genericWaiter ( this . config , ( ) => this . client . getWorkRequest ( request ) , response => ( response . workRequest . timeFinished ? true : false ) ) ; } }