// Copyright (c) 2016, 2018, 2026, 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.
// Code generated. DO NOT EDIT.

// Big Data Service API
//
// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications.
//

package bds

import (
	"fmt"
	"github.com/oracle/oci-go-sdk/v65/common"
	"strings"
)

// BdsCertificateConfiguration The BDS certificate configuration information.
type BdsCertificateConfiguration struct {

	// The OCID of the bdsInstance which is the parent resource id.
	BdsInstanceId *string `mandatory:"true" json:"bdsInstanceId"`

	// The ID of the BDS certificate configuration defined under BDS resources, not OCID.
	Id *string `mandatory:"true" json:"id"`

	// The lifecycle status of the BDS certificate configuration.
	LifecycleState BdsCertificateConfigurationLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`

	// The display name of the BDS certificate configuration.
	DisplayName *string `mandatory:"true" json:"displayName"`

	// The time when the BDS certificate configuration was created, shown as an RFC 3339 formatted datetime string.
	TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`

	// The time the BDS certificate configuration was updated, shown as an RFC 3339 formatted datetime string.
	TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`

	// The type of the BDS certificate configuration, also the type of the BDS certificates which will be generated by the BDS certificate configuration.
	Type BdsCertificateConfigurationTypeEnum `mandatory:"true" json:"type"`

	// If this BDS certificate configuration is a default configuration or not. There will be only one Default certificate configuration per BDS cluster.
	IsDefaultConfiguration *bool `mandatory:"true" json:"isDefaultConfiguration"`

	// The OCID of the certificate authority which is associated with this certificate configuration. The value is Null when this BDS certificate configuration type is SELF_SIGNED.
	CertificateAuthorityId *string `mandatory:"false" json:"certificateAuthorityId"`

	// The last time the BDS certificate configuration was used to generate or renew the certificate(s).
	TimeLastRefreshedOrGenerated *common.SDKTime `mandatory:"false" json:"timeLastRefreshedOrGenerated"`

	// The OCID of the compartment of the certificate authority connecting to this certificate configuration.
	CompartmentId *string `mandatory:"false" json:"compartmentId"`
}

func (m BdsCertificateConfiguration) String() string {
	return common.PointerString(m)
}

// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m BdsCertificateConfiguration) ValidateEnumValue() (bool, error) {
	errMessage := []string{}
	if _, ok := GetMappingBdsCertificateConfigurationLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetBdsCertificateConfigurationLifecycleStateEnumStringValues(), ",")))
	}
	if _, ok := GetMappingBdsCertificateConfigurationTypeEnum(string(m.Type)); !ok && m.Type != "" {
		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetBdsCertificateConfigurationTypeEnumStringValues(), ",")))
	}

	if len(errMessage) > 0 {
		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
	}
	return false, nil
}

// BdsCertificateConfigurationLifecycleStateEnum Enum with underlying type: string
type BdsCertificateConfigurationLifecycleStateEnum string

// Set of constants representing the allowable values for BdsCertificateConfigurationLifecycleStateEnum
const (
	BdsCertificateConfigurationLifecycleStateCreating BdsCertificateConfigurationLifecycleStateEnum = "CREATING"
	BdsCertificateConfigurationLifecycleStateActive   BdsCertificateConfigurationLifecycleStateEnum = "ACTIVE"
	BdsCertificateConfigurationLifecycleStateDeleting BdsCertificateConfigurationLifecycleStateEnum = "DELETING"
	BdsCertificateConfigurationLifecycleStateDeleted  BdsCertificateConfigurationLifecycleStateEnum = "DELETED"
	BdsCertificateConfigurationLifecycleStateFailed   BdsCertificateConfigurationLifecycleStateEnum = "FAILED"
	BdsCertificateConfigurationLifecycleStateUpdating BdsCertificateConfigurationLifecycleStateEnum = "UPDATING"
)

var mappingBdsCertificateConfigurationLifecycleStateEnum = map[string]BdsCertificateConfigurationLifecycleStateEnum{
	"CREATING": BdsCertificateConfigurationLifecycleStateCreating,
	"ACTIVE":   BdsCertificateConfigurationLifecycleStateActive,
	"DELETING": BdsCertificateConfigurationLifecycleStateDeleting,
	"DELETED":  BdsCertificateConfigurationLifecycleStateDeleted,
	"FAILED":   BdsCertificateConfigurationLifecycleStateFailed,
	"UPDATING": BdsCertificateConfigurationLifecycleStateUpdating,
}

var mappingBdsCertificateConfigurationLifecycleStateEnumLowerCase = map[string]BdsCertificateConfigurationLifecycleStateEnum{
	"creating": BdsCertificateConfigurationLifecycleStateCreating,
	"active":   BdsCertificateConfigurationLifecycleStateActive,
	"deleting": BdsCertificateConfigurationLifecycleStateDeleting,
	"deleted":  BdsCertificateConfigurationLifecycleStateDeleted,
	"failed":   BdsCertificateConfigurationLifecycleStateFailed,
	"updating": BdsCertificateConfigurationLifecycleStateUpdating,
}

// GetBdsCertificateConfigurationLifecycleStateEnumValues Enumerates the set of values for BdsCertificateConfigurationLifecycleStateEnum
func GetBdsCertificateConfigurationLifecycleStateEnumValues() []BdsCertificateConfigurationLifecycleStateEnum {
	values := make([]BdsCertificateConfigurationLifecycleStateEnum, 0)
	for _, v := range mappingBdsCertificateConfigurationLifecycleStateEnum {
		values = append(values, v)
	}
	return values
}

// GetBdsCertificateConfigurationLifecycleStateEnumStringValues Enumerates the set of values in String for BdsCertificateConfigurationLifecycleStateEnum
func GetBdsCertificateConfigurationLifecycleStateEnumStringValues() []string {
	return []string{
		"CREATING",
		"ACTIVE",
		"DELETING",
		"DELETED",
		"FAILED",
		"UPDATING",
	}
}

// GetMappingBdsCertificateConfigurationLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingBdsCertificateConfigurationLifecycleStateEnum(val string) (BdsCertificateConfigurationLifecycleStateEnum, bool) {
	enum, ok := mappingBdsCertificateConfigurationLifecycleStateEnumLowerCase[strings.ToLower(val)]
	return enum, ok
}

// BdsCertificateConfigurationTypeEnum Enum with underlying type: string
type BdsCertificateConfigurationTypeEnum string

// Set of constants representing the allowable values for BdsCertificateConfigurationTypeEnum
const (
	BdsCertificateConfigurationTypeSelfSigned     BdsCertificateConfigurationTypeEnum = "SELF_SIGNED"
	BdsCertificateConfigurationTypeOciCertificate BdsCertificateConfigurationTypeEnum = "OCI_CERTIFICATE"
)

var mappingBdsCertificateConfigurationTypeEnum = map[string]BdsCertificateConfigurationTypeEnum{
	"SELF_SIGNED":     BdsCertificateConfigurationTypeSelfSigned,
	"OCI_CERTIFICATE": BdsCertificateConfigurationTypeOciCertificate,
}

var mappingBdsCertificateConfigurationTypeEnumLowerCase = map[string]BdsCertificateConfigurationTypeEnum{
	"self_signed":     BdsCertificateConfigurationTypeSelfSigned,
	"oci_certificate": BdsCertificateConfigurationTypeOciCertificate,
}

// GetBdsCertificateConfigurationTypeEnumValues Enumerates the set of values for BdsCertificateConfigurationTypeEnum
func GetBdsCertificateConfigurationTypeEnumValues() []BdsCertificateConfigurationTypeEnum {
	values := make([]BdsCertificateConfigurationTypeEnum, 0)
	for _, v := range mappingBdsCertificateConfigurationTypeEnum {
		values = append(values, v)
	}
	return values
}

// GetBdsCertificateConfigurationTypeEnumStringValues Enumerates the set of values in String for BdsCertificateConfigurationTypeEnum
func GetBdsCertificateConfigurationTypeEnumStringValues() []string {
	return []string{
		"SELF_SIGNED",
		"OCI_CERTIFICATE",
	}
}

// GetMappingBdsCertificateConfigurationTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingBdsCertificateConfigurationTypeEnum(val string) (BdsCertificateConfigurationTypeEnum, bool) {
	enum, ok := mappingBdsCertificateConfigurationTypeEnumLowerCase[strings.ToLower(val)]
	return enum, ok
}
