/**
 * Events API
 * API for the Events Service. Use this API to manage rules and actions that create automation
in your tenancy. For more information, see [Overview of Events](/iaas/Content/Events/Concepts/eventsoverview.htm).

 * OpenAPI spec version: 20181201
 *
 *
 * 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 model from "../model" ; import common = require ( "oci-common" ) ; /**
 * An object that represents an action to trigger for events that match a rule.
 *
 */ export interface Action { /**
     * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the action.
     *
     */ "id" : string ; /**
     * A message generated by the Events service about the current state of this action.
     *
     */ "lifecycleMessage" : string ; /**
     * The current state of the rule.
     *
     */ "lifecycleState" : Action . LifecycleState ; /**
      * Whether or not this action is currently enabled.
  * <p>
  Example: `true`
  *
      */ "isEnabled" ? : boolean ; /**
     * A string that describes the details of the action. It does not have to be unique, and you can change it. Avoid entering
     * confidential information.
     *
     */ "description" ? : string ; "actionType" : string ; } export namespace Action { export enum LifecycleState { Creating = "CREATING" , Active = "ACTIVE" , Inactive = "INACTIVE" , Updating = "UPDATING" , Deleting = "DELETING" , Deleted = "DELETED" , Failed = "FAILED" , /**
         * This value is used if a service returns a value for this enum that is not recognized by this
         * version of the SDK.
         */ UnknownValue = "UNKNOWN_VALUE" } export function getJsonObj ( obj ) { const jsonObj = { ... obj , ... { } } ; if ( "actionType" in obj && obj . actionType ) { switch ( obj . actionType ) { case "OSS" : return model . StreamingServiceAction . getJsonObj ( < model . StreamingServiceAction > ( < object > jsonObj ) , true ) ; case "ONS" : return model . NotificationServiceAction . getJsonObj ( < model . NotificationServiceAction > ( < object > jsonObj ) , true ) ; case "FAAS" : return model . FaaSAction . getJsonObj ( < model . FaaSAction > ( < object > jsonObj ) , true ) ; default : throw Error ( "Unknown value for: " + obj . actionType ) ; } } return jsonObj ; } export function getDeserializedJsonObj ( obj ) { const jsonObj = { ... obj , ... { } } ; if ( "actionType" in obj && obj . actionType ) { switch ( obj . actionType ) { case "OSS" : return model . StreamingServiceAction . getDeserializedJsonObj ( < model . StreamingServiceAction > ( < object > jsonObj ) , true ) ; case "ONS" : return model . NotificationServiceAction . getDeserializedJsonObj ( < model . NotificationServiceAction > ( < object > jsonObj ) , true ) ; case "FAAS" : return model . FaaSAction . getDeserializedJsonObj ( < model . FaaSAction > ( < object > jsonObj ) , true ) ; default : throw Error ( "Unknown value for: " + obj . actionType ) ; } } return jsonObj ; } }