// 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"
)

// BdsCertificateConfigurationSummary Summary details of the BDS certificate configuration.
type BdsCertificateConfigurationSummary struct {

	// 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 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 bdsInstance which is the parent resource id.
	BdsInstanceId *string `mandatory:"false" json:"bdsInstanceId"`

	// 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 display name of BDS certificate configuration.
	DisplayName *string `mandatory:"false" json:"displayName"`

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

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

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

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

	// Simple key-value pair that is applied without any predefined name, type, or scope.
	// Exists for cross-compatibility only. For example, `{"bar-key": "value"}`
	FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`

	// Defined tags for this resource. Each key is predefined and scoped to a namespace.
	// For example, `{"foo-namespace": {"bar-key": "value"}}`
	DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
}

func (m BdsCertificateConfigurationSummary) 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 BdsCertificateConfigurationSummary) 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
}
