/**
 * Certificates Service Management API
 * API for managing certificates.
 * OpenAPI spec version: 20210224
 *
 *
 * 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" ) ; /**
 * The configuration details for updating a certificate authority (CA).
 */ export interface UpdateCertificateAuthorityConfigDetails { /**
     * The name of the CA version. When the value is not null, a name is unique across versions of a given CA.
     *
     */ "versionName" ? : string ; /**
     * The rotation state of the CA. The default is `PENDING`, meaning that the CA is staged and available for use. A CA version
     * that you mark as `CURRENT` is currently in use, but you don't yet want to rotate it into current, active use. For example,
     * you might create or update a CA and mark its rotation state as `PENDING` if you haven't yet updated the certificate on the target system.
     *
     */ "stage" ? : UpdateCertificateAuthorityConfigDetails . Stage ; "configType" : string ; } export namespace UpdateCertificateAuthorityConfigDetails { export enum Stage { Current = "CURRENT" , Pending = "PENDING" } export function getJsonObj ( obj ) { const jsonObj = { ... obj , ... { } } ; if ( "configType" in obj && obj . configType ) { switch ( obj . configType ) { case "SUBORDINATE_CA_ISSUED_BY_INTERNAL_CA" : return model . UpdateSubordinateCaIssuedByInternalCaConfigDetails . getJsonObj ( < model . UpdateSubordinateCaIssuedByInternalCaConfigDetails > ( < object > jsonObj ) , true ) ; case "ROOT_CA_GENERATED_INTERNALLY" : return model . UpdateRootCaByGeneratingInternallyConfigDetails . getJsonObj ( < model . UpdateRootCaByGeneratingInternallyConfigDetails > ( < object > jsonObj ) , true ) ; default : throw Error ( "Unknown value for: " + obj . configType ) ; } } return jsonObj ; } export function getDeserializedJsonObj ( obj ) { const jsonObj = { ... obj , ... { } } ; if ( "configType" in obj && obj . configType ) { switch ( obj . configType ) { case "SUBORDINATE_CA_ISSUED_BY_INTERNAL_CA" : return model . UpdateSubordinateCaIssuedByInternalCaConfigDetails . getDeserializedJsonObj ( < model . UpdateSubordinateCaIssuedByInternalCaConfigDetails > ( < object > jsonObj ) , true ) ; case "ROOT_CA_GENERATED_INTERNALLY" : return model . UpdateRootCaByGeneratingInternallyConfigDetails . getDeserializedJsonObj ( < model . UpdateRootCaByGeneratingInternallyConfigDetails > ( < object > jsonObj ) , true ) ; default : throw Error ( "Unknown value for: " + obj . configType ) ; } } return jsonObj ; } }