// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package shared

import (
	"encoding/json"
	"errors"
	"fmt"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
)

type SourceOracleEnterpriseSchemasConnectionType string

const (
	SourceOracleEnterpriseSchemasConnectionTypeSid SourceOracleEnterpriseSchemasConnectionType = "sid"
)

func (e SourceOracleEnterpriseSchemasConnectionType) ToPointer() *SourceOracleEnterpriseSchemasConnectionType {
	return &e
}
func (e *SourceOracleEnterpriseSchemasConnectionType) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "sid":
		*e = SourceOracleEnterpriseSchemasConnectionType(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasConnectionType: %v", v)
	}
}

// SourceOracleEnterpriseSystemIDSID - Use Oracle System Identifier.
type SourceOracleEnterpriseSystemIDSID struct {
	ConnectionType       *SourceOracleEnterpriseSchemasConnectionType `default:"sid" json:"connection_type"`
	Sid                  string                                       `json:"sid"`
	AdditionalProperties any                                          `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseSystemIDSID) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseSystemIDSID) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseSystemIDSID) GetConnectionType() *SourceOracleEnterpriseSchemasConnectionType {
	if o == nil {
		return nil
	}
	return o.ConnectionType
}

func (o *SourceOracleEnterpriseSystemIDSID) GetSid() string {
	if o == nil {
		return ""
	}
	return o.Sid
}

func (o *SourceOracleEnterpriseSystemIDSID) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseConnectionType string

const (
	SourceOracleEnterpriseConnectionTypeServiceName SourceOracleEnterpriseConnectionType = "service_name"
)

func (e SourceOracleEnterpriseConnectionType) ToPointer() *SourceOracleEnterpriseConnectionType {
	return &e
}
func (e *SourceOracleEnterpriseConnectionType) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "service_name":
		*e = SourceOracleEnterpriseConnectionType(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseConnectionType: %v", v)
	}
}

// SourceOracleEnterpriseServiceName - Use service name.
type SourceOracleEnterpriseServiceName struct {
	ConnectionType       *SourceOracleEnterpriseConnectionType `default:"service_name" json:"connection_type"`
	ServiceName          string                                `json:"service_name"`
	AdditionalProperties any                                   `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseServiceName) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseServiceName) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseServiceName) GetConnectionType() *SourceOracleEnterpriseConnectionType {
	if o == nil {
		return nil
	}
	return o.ConnectionType
}

func (o *SourceOracleEnterpriseServiceName) GetServiceName() string {
	if o == nil {
		return ""
	}
	return o.ServiceName
}

func (o *SourceOracleEnterpriseServiceName) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseConnectByType string

const (
	SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseServiceName SourceOracleEnterpriseConnectByType = "source-oracle-enterprise_Service name"
	SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseSystemIDSID SourceOracleEnterpriseConnectByType = "source-oracle-enterprise_System ID (SID)"
)

// SourceOracleEnterpriseConnectBy - The scheme by which to establish a database connection.
type SourceOracleEnterpriseConnectBy struct {
	SourceOracleEnterpriseServiceName *SourceOracleEnterpriseServiceName `queryParam:"inline"`
	SourceOracleEnterpriseSystemIDSID *SourceOracleEnterpriseSystemIDSID `queryParam:"inline"`

	Type SourceOracleEnterpriseConnectByType
}

func CreateSourceOracleEnterpriseConnectBySourceOracleEnterpriseServiceName(sourceOracleEnterpriseServiceName SourceOracleEnterpriseServiceName) SourceOracleEnterpriseConnectBy {
	typ := SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseServiceName

	return SourceOracleEnterpriseConnectBy{
		SourceOracleEnterpriseServiceName: &sourceOracleEnterpriseServiceName,
		Type:                              typ,
	}
}

func CreateSourceOracleEnterpriseConnectBySourceOracleEnterpriseSystemIDSID(sourceOracleEnterpriseSystemIDSID SourceOracleEnterpriseSystemIDSID) SourceOracleEnterpriseConnectBy {
	typ := SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseSystemIDSID

	return SourceOracleEnterpriseConnectBy{
		SourceOracleEnterpriseSystemIDSID: &sourceOracleEnterpriseSystemIDSID,
		Type:                              typ,
	}
}

func (u *SourceOracleEnterpriseConnectBy) UnmarshalJSON(data []byte) error {

	var sourceOracleEnterpriseServiceName SourceOracleEnterpriseServiceName = SourceOracleEnterpriseServiceName{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseServiceName, "", true, true); err == nil {
		u.SourceOracleEnterpriseServiceName = &sourceOracleEnterpriseServiceName
		u.Type = SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseServiceName
		return nil
	}

	var sourceOracleEnterpriseSystemIDSID SourceOracleEnterpriseSystemIDSID = SourceOracleEnterpriseSystemIDSID{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseSystemIDSID, "", true, true); err == nil {
		u.SourceOracleEnterpriseSystemIDSID = &sourceOracleEnterpriseSystemIDSID
		u.Type = SourceOracleEnterpriseConnectByTypeSourceOracleEnterpriseSystemIDSID
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for SourceOracleEnterpriseConnectBy", string(data))
}

func (u SourceOracleEnterpriseConnectBy) MarshalJSON() ([]byte, error) {
	if u.SourceOracleEnterpriseServiceName != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseServiceName, "", true)
	}

	if u.SourceOracleEnterpriseSystemIDSID != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseSystemIDSID, "", true)
	}

	return nil, errors.New("could not marshal union type SourceOracleEnterpriseConnectBy: all fields are null")
}

type SourceOracleEnterpriseSchemasCursorMethod string

const (
	SourceOracleEnterpriseSchemasCursorMethodCdc SourceOracleEnterpriseSchemasCursorMethod = "cdc"
)

func (e SourceOracleEnterpriseSchemasCursorMethod) ToPointer() *SourceOracleEnterpriseSchemasCursorMethod {
	return &e
}
func (e *SourceOracleEnterpriseSchemasCursorMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "cdc":
		*e = SourceOracleEnterpriseSchemasCursorMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasCursorMethod: %v", v)
	}
}

// SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced - Determines whether Airbyte should fail or re-sync data in case of an stale/invalid cursor value in the mined logs. If 'Fail sync' is chosen, a user will have to manually reset the connection before being able to continue syncing data. If 'Re-sync data' is chosen, Airbyte will automatically trigger a refresh but could lead to higher cloud costs and data loss.
type SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced string

const (
	SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvancedFailSync   SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced = "Fail sync"
	SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvancedReSyncData SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced = "Re-sync data"
)

func (e SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced) ToPointer() *SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced {
	return &e
}
func (e *SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "Fail sync":
		fallthrough
	case "Re-sync data":
		*e = SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced: %v", v)
	}
}

// SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC - <i>Recommended</i> - Incrementally reads new inserts, updates, and deletes using Oracle's <a href="https://docs.airbyte.com/integrations/enterprise-connectors/source-oracle#getting-started"> change data capture feature</a>. This must be enabled on your database.
type SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC struct {
	CursorMethod *SourceOracleEnterpriseSchemasCursorMethod `default:"cdc" json:"cursor_method"`
	// The amount of time to allow the Debezium Engine to shut down, in seconds.
	DebeziumShutdownTimeoutSeconds *int64 `default:"60" json:"debezium_shutdown_timeout_seconds"`
	// The amount of time an initial load is allowed to continue for before catching up on CDC events.
	InitialLoadTimeoutHours *int64 `default:"8" json:"initial_load_timeout_hours"`
	// Determines whether Airbyte should fail or re-sync data in case of an stale/invalid cursor value in the mined logs. If 'Fail sync' is chosen, a user will have to manually reset the connection before being able to continue syncing data. If 'Re-sync data' is chosen, Airbyte will automatically trigger a refresh but could lead to higher cloud costs and data loss.
	InvalidCdcCursorPositionBehavior *SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced `default:"Fail sync" json:"invalid_cdc_cursor_position_behavior"`
	AdditionalProperties             any                                                       `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) GetCursorMethod() *SourceOracleEnterpriseSchemasCursorMethod {
	if o == nil {
		return nil
	}
	return o.CursorMethod
}

func (o *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) GetDebeziumShutdownTimeoutSeconds() *int64 {
	if o == nil {
		return nil
	}
	return o.DebeziumShutdownTimeoutSeconds
}

func (o *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) GetInitialLoadTimeoutHours() *int64 {
	if o == nil {
		return nil
	}
	return o.InitialLoadTimeoutHours
}

func (o *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) GetInvalidCdcCursorPositionBehavior() *SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced {
	if o == nil {
		return nil
	}
	return o.InvalidCdcCursorPositionBehavior
}

func (o *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseCursorMethod string

const (
	SourceOracleEnterpriseCursorMethodUserDefined SourceOracleEnterpriseCursorMethod = "user_defined"
)

func (e SourceOracleEnterpriseCursorMethod) ToPointer() *SourceOracleEnterpriseCursorMethod {
	return &e
}
func (e *SourceOracleEnterpriseCursorMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "user_defined":
		*e = SourceOracleEnterpriseCursorMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseCursorMethod: %v", v)
	}
}

// SourceOracleEnterpriseScanChangesWithUserDefinedCursor - Incrementally detects new inserts and updates using the <a href="https://docs.airbyte.com/understanding-airbyte/connections/incremental-append/#user-defined-cursor">cursor column</a> chosen when configuring a connection (e.g. created_at, updated_at).
type SourceOracleEnterpriseScanChangesWithUserDefinedCursor struct {
	CursorMethod         *SourceOracleEnterpriseCursorMethod `default:"user_defined" json:"cursor_method"`
	AdditionalProperties any                                 `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseScanChangesWithUserDefinedCursor) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseScanChangesWithUserDefinedCursor) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseScanChangesWithUserDefinedCursor) GetCursorMethod() *SourceOracleEnterpriseCursorMethod {
	if o == nil {
		return nil
	}
	return o.CursorMethod
}

func (o *SourceOracleEnterpriseScanChangesWithUserDefinedCursor) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseUpdateMethodType string

const (
	SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseScanChangesWithUserDefinedCursor     SourceOracleEnterpriseUpdateMethodType = "source-oracle-enterprise_Scan Changes with User Defined Cursor"
	SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseUpdateMethodType = "source-oracle-enterprise_Read Changes using Change Data Capture (CDC)"
)

// SourceOracleEnterpriseUpdateMethod - Configures how data is extracted from the database.
type SourceOracleEnterpriseUpdateMethod struct {
	SourceOracleEnterpriseScanChangesWithUserDefinedCursor     *SourceOracleEnterpriseScanChangesWithUserDefinedCursor     `queryParam:"inline"`
	SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC *SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC `queryParam:"inline"`

	Type SourceOracleEnterpriseUpdateMethodType
}

func CreateSourceOracleEnterpriseUpdateMethodSourceOracleEnterpriseScanChangesWithUserDefinedCursor(sourceOracleEnterpriseScanChangesWithUserDefinedCursor SourceOracleEnterpriseScanChangesWithUserDefinedCursor) SourceOracleEnterpriseUpdateMethod {
	typ := SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseScanChangesWithUserDefinedCursor

	return SourceOracleEnterpriseUpdateMethod{
		SourceOracleEnterpriseScanChangesWithUserDefinedCursor: &sourceOracleEnterpriseScanChangesWithUserDefinedCursor,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseUpdateMethodSourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC(sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC) SourceOracleEnterpriseUpdateMethod {
	typ := SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC

	return SourceOracleEnterpriseUpdateMethod{
		SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC: &sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC,
		Type: typ,
	}
}

func (u *SourceOracleEnterpriseUpdateMethod) UnmarshalJSON(data []byte) error {

	var sourceOracleEnterpriseScanChangesWithUserDefinedCursor SourceOracleEnterpriseScanChangesWithUserDefinedCursor = SourceOracleEnterpriseScanChangesWithUserDefinedCursor{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseScanChangesWithUserDefinedCursor, "", true, true); err == nil {
		u.SourceOracleEnterpriseScanChangesWithUserDefinedCursor = &sourceOracleEnterpriseScanChangesWithUserDefinedCursor
		u.Type = SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseScanChangesWithUserDefinedCursor
		return nil
	}

	var sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC = SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC, "", true, true); err == nil {
		u.SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC = &sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC
		u.Type = SourceOracleEnterpriseUpdateMethodTypeSourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for SourceOracleEnterpriseUpdateMethod", string(data))
}

func (u SourceOracleEnterpriseUpdateMethod) MarshalJSON() ([]byte, error) {
	if u.SourceOracleEnterpriseScanChangesWithUserDefinedCursor != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseScanChangesWithUserDefinedCursor, "", true)
	}

	if u.SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC, "", true)
	}

	return nil, errors.New("could not marshal union type SourceOracleEnterpriseUpdateMethod: all fields are null")
}

type SourceOracleEnterpriseSchemasEncryptionEncryptionMethod string

const (
	SourceOracleEnterpriseSchemasEncryptionEncryptionMethodEncryptedVerifyCertificate SourceOracleEnterpriseSchemasEncryptionEncryptionMethod = "encrypted_verify_certificate"
)

func (e SourceOracleEnterpriseSchemasEncryptionEncryptionMethod) ToPointer() *SourceOracleEnterpriseSchemasEncryptionEncryptionMethod {
	return &e
}
func (e *SourceOracleEnterpriseSchemasEncryptionEncryptionMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "encrypted_verify_certificate":
		*e = SourceOracleEnterpriseSchemasEncryptionEncryptionMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasEncryptionEncryptionMethod: %v", v)
	}
}

// SourceOracleEnterpriseTLSEncryptedVerifyCertificate - Verify and use the certificate provided by the server.
type SourceOracleEnterpriseTLSEncryptedVerifyCertificate struct {
	EncryptionMethod *SourceOracleEnterpriseSchemasEncryptionEncryptionMethod `default:"encrypted_verify_certificate" json:"encryption_method"`
	// Privacy Enhanced Mail (PEM) files are concatenated certificate containers frequently used in certificate installations.
	SslCertificate       string `json:"ssl_certificate"`
	AdditionalProperties any    `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseTLSEncryptedVerifyCertificate) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseTLSEncryptedVerifyCertificate) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseTLSEncryptedVerifyCertificate) GetEncryptionMethod() *SourceOracleEnterpriseSchemasEncryptionEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

func (o *SourceOracleEnterpriseTLSEncryptedVerifyCertificate) GetSslCertificate() string {
	if o == nil {
		return ""
	}
	return o.SslCertificate
}

func (o *SourceOracleEnterpriseTLSEncryptedVerifyCertificate) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

// SourceOracleEnterpriseEncryptionAlgorithm - This parameter defines what encryption algorithm is used.
type SourceOracleEnterpriseEncryptionAlgorithm string

const (
	SourceOracleEnterpriseEncryptionAlgorithmAes256      SourceOracleEnterpriseEncryptionAlgorithm = "AES256"
	SourceOracleEnterpriseEncryptionAlgorithmAes192      SourceOracleEnterpriseEncryptionAlgorithm = "AES192"
	SourceOracleEnterpriseEncryptionAlgorithmAes128      SourceOracleEnterpriseEncryptionAlgorithm = "AES128"
	SourceOracleEnterpriseEncryptionAlgorithmThreeDes168 SourceOracleEnterpriseEncryptionAlgorithm = "3DES168"
	SourceOracleEnterpriseEncryptionAlgorithmThreeDes112 SourceOracleEnterpriseEncryptionAlgorithm = "3DES112"
	SourceOracleEnterpriseEncryptionAlgorithmDes         SourceOracleEnterpriseEncryptionAlgorithm = "DES"
)

func (e SourceOracleEnterpriseEncryptionAlgorithm) ToPointer() *SourceOracleEnterpriseEncryptionAlgorithm {
	return &e
}
func (e *SourceOracleEnterpriseEncryptionAlgorithm) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "AES256":
		fallthrough
	case "AES192":
		fallthrough
	case "AES128":
		fallthrough
	case "3DES168":
		fallthrough
	case "3DES112":
		fallthrough
	case "DES":
		*e = SourceOracleEnterpriseEncryptionAlgorithm(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseEncryptionAlgorithm: %v", v)
	}
}

type SourceOracleEnterpriseSchemasEncryptionMethod string

const (
	SourceOracleEnterpriseSchemasEncryptionMethodClientNne SourceOracleEnterpriseSchemasEncryptionMethod = "client_nne"
)

func (e SourceOracleEnterpriseSchemasEncryptionMethod) ToPointer() *SourceOracleEnterpriseSchemasEncryptionMethod {
	return &e
}
func (e *SourceOracleEnterpriseSchemasEncryptionMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "client_nne":
		*e = SourceOracleEnterpriseSchemasEncryptionMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasEncryptionMethod: %v", v)
	}
}

// SourceOracleEnterpriseNativeNetworkEncryptionNNE - The native network encryption gives you the ability to encrypt database connections, without the configuration overhead of TCP/IP and SSL/TLS and without the need to open and listen on different ports.
type SourceOracleEnterpriseNativeNetworkEncryptionNNE struct {
	// This parameter defines what encryption algorithm is used.
	EncryptionAlgorithm  *SourceOracleEnterpriseEncryptionAlgorithm     `default:"AES256" json:"encryption_algorithm"`
	EncryptionMethod     *SourceOracleEnterpriseSchemasEncryptionMethod `default:"client_nne" json:"encryption_method"`
	AdditionalProperties any                                            `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseNativeNetworkEncryptionNNE) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseNativeNetworkEncryptionNNE) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseNativeNetworkEncryptionNNE) GetEncryptionAlgorithm() *SourceOracleEnterpriseEncryptionAlgorithm {
	if o == nil {
		return nil
	}
	return o.EncryptionAlgorithm
}

func (o *SourceOracleEnterpriseNativeNetworkEncryptionNNE) GetEncryptionMethod() *SourceOracleEnterpriseSchemasEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

func (o *SourceOracleEnterpriseNativeNetworkEncryptionNNE) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseEncryptionMethod string

const (
	SourceOracleEnterpriseEncryptionMethodUnencrypted SourceOracleEnterpriseEncryptionMethod = "unencrypted"
)

func (e SourceOracleEnterpriseEncryptionMethod) ToPointer() *SourceOracleEnterpriseEncryptionMethod {
	return &e
}
func (e *SourceOracleEnterpriseEncryptionMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "unencrypted":
		*e = SourceOracleEnterpriseEncryptionMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseEncryptionMethod: %v", v)
	}
}

// SourceOracleEnterpriseUnencrypted - Data transfer will not be encrypted.
type SourceOracleEnterpriseUnencrypted struct {
	EncryptionMethod     *SourceOracleEnterpriseEncryptionMethod `default:"unencrypted" json:"encryption_method"`
	AdditionalProperties any                                     `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseUnencrypted) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseUnencrypted) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseUnencrypted) GetEncryptionMethod() *SourceOracleEnterpriseEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

func (o *SourceOracleEnterpriseUnencrypted) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseEncryptionType string

const (
	SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseUnencrypted                   SourceOracleEnterpriseEncryptionType = "source-oracle-enterprise_Unencrypted"
	SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseNativeNetworkEncryptionNNE    SourceOracleEnterpriseEncryptionType = "source-oracle-enterprise_Native Network Encryption (NNE)"
	SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseTLSEncryptedVerifyCertificate SourceOracleEnterpriseEncryptionType = "source-oracle-enterprise_TLS Encrypted (verify certificate)"
)

// SourceOracleEnterpriseEncryption - The encryption method with is used when communicating with the database.
type SourceOracleEnterpriseEncryption struct {
	SourceOracleEnterpriseUnencrypted                   *SourceOracleEnterpriseUnencrypted                   `queryParam:"inline"`
	SourceOracleEnterpriseNativeNetworkEncryptionNNE    *SourceOracleEnterpriseNativeNetworkEncryptionNNE    `queryParam:"inline"`
	SourceOracleEnterpriseTLSEncryptedVerifyCertificate *SourceOracleEnterpriseTLSEncryptedVerifyCertificate `queryParam:"inline"`

	Type SourceOracleEnterpriseEncryptionType
}

func CreateSourceOracleEnterpriseEncryptionSourceOracleEnterpriseUnencrypted(sourceOracleEnterpriseUnencrypted SourceOracleEnterpriseUnencrypted) SourceOracleEnterpriseEncryption {
	typ := SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseUnencrypted

	return SourceOracleEnterpriseEncryption{
		SourceOracleEnterpriseUnencrypted: &sourceOracleEnterpriseUnencrypted,
		Type:                              typ,
	}
}

func CreateSourceOracleEnterpriseEncryptionSourceOracleEnterpriseNativeNetworkEncryptionNNE(sourceOracleEnterpriseNativeNetworkEncryptionNNE SourceOracleEnterpriseNativeNetworkEncryptionNNE) SourceOracleEnterpriseEncryption {
	typ := SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseNativeNetworkEncryptionNNE

	return SourceOracleEnterpriseEncryption{
		SourceOracleEnterpriseNativeNetworkEncryptionNNE: &sourceOracleEnterpriseNativeNetworkEncryptionNNE,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseEncryptionSourceOracleEnterpriseTLSEncryptedVerifyCertificate(sourceOracleEnterpriseTLSEncryptedVerifyCertificate SourceOracleEnterpriseTLSEncryptedVerifyCertificate) SourceOracleEnterpriseEncryption {
	typ := SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseTLSEncryptedVerifyCertificate

	return SourceOracleEnterpriseEncryption{
		SourceOracleEnterpriseTLSEncryptedVerifyCertificate: &sourceOracleEnterpriseTLSEncryptedVerifyCertificate,
		Type: typ,
	}
}

func (u *SourceOracleEnterpriseEncryption) UnmarshalJSON(data []byte) error {

	var sourceOracleEnterpriseUnencrypted SourceOracleEnterpriseUnencrypted = SourceOracleEnterpriseUnencrypted{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUnencrypted, "", true, true); err == nil {
		u.SourceOracleEnterpriseUnencrypted = &sourceOracleEnterpriseUnencrypted
		u.Type = SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseUnencrypted
		return nil
	}

	var sourceOracleEnterpriseNativeNetworkEncryptionNNE SourceOracleEnterpriseNativeNetworkEncryptionNNE = SourceOracleEnterpriseNativeNetworkEncryptionNNE{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseNativeNetworkEncryptionNNE, "", true, true); err == nil {
		u.SourceOracleEnterpriseNativeNetworkEncryptionNNE = &sourceOracleEnterpriseNativeNetworkEncryptionNNE
		u.Type = SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseNativeNetworkEncryptionNNE
		return nil
	}

	var sourceOracleEnterpriseTLSEncryptedVerifyCertificate SourceOracleEnterpriseTLSEncryptedVerifyCertificate = SourceOracleEnterpriseTLSEncryptedVerifyCertificate{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseTLSEncryptedVerifyCertificate, "", true, true); err == nil {
		u.SourceOracleEnterpriseTLSEncryptedVerifyCertificate = &sourceOracleEnterpriseTLSEncryptedVerifyCertificate
		u.Type = SourceOracleEnterpriseEncryptionTypeSourceOracleEnterpriseTLSEncryptedVerifyCertificate
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for SourceOracleEnterpriseEncryption", string(data))
}

func (u SourceOracleEnterpriseEncryption) MarshalJSON() ([]byte, error) {
	if u.SourceOracleEnterpriseUnencrypted != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseUnencrypted, "", true)
	}

	if u.SourceOracleEnterpriseNativeNetworkEncryptionNNE != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseNativeNetworkEncryptionNNE, "", true)
	}

	if u.SourceOracleEnterpriseTLSEncryptedVerifyCertificate != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseTLSEncryptedVerifyCertificate, "", true)
	}

	return nil, errors.New("could not marshal union type SourceOracleEnterpriseEncryption: all fields are null")
}

type SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod string

const (
	SourceOracleEnterpriseSchemasTunnelMethodTunnelMethodSSHPasswordAuth SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod = "SSH_PASSWORD_AUTH"
)

func (e SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod) ToPointer() *SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod {
	return &e
}
func (e *SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "SSH_PASSWORD_AUTH":
		*e = SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod: %v", v)
	}
}

// SourceOracleEnterprisePasswordAuthentication - Connect through a jump server tunnel host using username and password authentication
type SourceOracleEnterprisePasswordAuthentication struct {
	// Hostname of the jump server host that allows inbound ssh tunnel.
	TunnelHost   string                                                 `json:"tunnel_host"`
	TunnelMethod *SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod `default:"SSH_PASSWORD_AUTH" json:"tunnel_method"`
	// Port on the proxy/jump server that accepts inbound ssh connections.
	TunnelPort *int64 `default:"22" json:"tunnel_port"`
	// OS-level username for logging into the jump server host
	TunnelUser string `json:"tunnel_user"`
	// OS-level password for logging into the jump server host
	TunnelUserPassword   string `json:"tunnel_user_password"`
	AdditionalProperties any    `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterprisePasswordAuthentication) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterprisePasswordAuthentication) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetTunnelHost() string {
	if o == nil {
		return ""
	}
	return o.TunnelHost
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetTunnelMethod() *SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetTunnelPort() *int64 {
	if o == nil {
		return nil
	}
	return o.TunnelPort
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetTunnelUser() string {
	if o == nil {
		return ""
	}
	return o.TunnelUser
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetTunnelUserPassword() string {
	if o == nil {
		return ""
	}
	return o.TunnelUserPassword
}

func (o *SourceOracleEnterprisePasswordAuthentication) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseSchemasTunnelMethod string

const (
	SourceOracleEnterpriseSchemasTunnelMethodSSHKeyAuth SourceOracleEnterpriseSchemasTunnelMethod = "SSH_KEY_AUTH"
)

func (e SourceOracleEnterpriseSchemasTunnelMethod) ToPointer() *SourceOracleEnterpriseSchemasTunnelMethod {
	return &e
}
func (e *SourceOracleEnterpriseSchemasTunnelMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "SSH_KEY_AUTH":
		*e = SourceOracleEnterpriseSchemasTunnelMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseSchemasTunnelMethod: %v", v)
	}
}

// SourceOracleEnterpriseSSHKeyAuthentication - Connect through a jump server tunnel host using username and ssh key
type SourceOracleEnterpriseSSHKeyAuthentication struct {
	// OS-level user account ssh key credentials in RSA PEM format ( created with ssh-keygen -t rsa -m PEM -f myuser_rsa )
	SSHKey string `json:"ssh_key"`
	// Hostname of the jump server host that allows inbound ssh tunnel.
	TunnelHost   string                                     `json:"tunnel_host"`
	TunnelMethod *SourceOracleEnterpriseSchemasTunnelMethod `default:"SSH_KEY_AUTH" json:"tunnel_method"`
	// Port on the proxy/jump server that accepts inbound ssh connections.
	TunnelPort *int64 `default:"22" json:"tunnel_port"`
	// OS-level username for logging into the jump server host
	TunnelUser           string `json:"tunnel_user"`
	AdditionalProperties any    `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseSSHKeyAuthentication) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseSSHKeyAuthentication) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetSSHKey() string {
	if o == nil {
		return ""
	}
	return o.SSHKey
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetTunnelHost() string {
	if o == nil {
		return ""
	}
	return o.TunnelHost
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetTunnelMethod() *SourceOracleEnterpriseSchemasTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetTunnelPort() *int64 {
	if o == nil {
		return nil
	}
	return o.TunnelPort
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetTunnelUser() string {
	if o == nil {
		return ""
	}
	return o.TunnelUser
}

func (o *SourceOracleEnterpriseSSHKeyAuthentication) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseTunnelMethod string

const (
	SourceOracleEnterpriseTunnelMethodNoTunnel SourceOracleEnterpriseTunnelMethod = "NO_TUNNEL"
)

func (e SourceOracleEnterpriseTunnelMethod) ToPointer() *SourceOracleEnterpriseTunnelMethod {
	return &e
}
func (e *SourceOracleEnterpriseTunnelMethod) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "NO_TUNNEL":
		*e = SourceOracleEnterpriseTunnelMethod(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseTunnelMethod: %v", v)
	}
}

// SourceOracleEnterpriseNoTunnel - No ssh tunnel needed to connect to database
type SourceOracleEnterpriseNoTunnel struct {
	TunnelMethod         *SourceOracleEnterpriseTunnelMethod `default:"NO_TUNNEL" json:"tunnel_method"`
	AdditionalProperties any                                 `additionalProperties:"true" json:"-"`
}

func (s SourceOracleEnterpriseNoTunnel) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterpriseNoTunnel) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, true); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterpriseNoTunnel) GetTunnelMethod() *SourceOracleEnterpriseTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

func (o *SourceOracleEnterpriseNoTunnel) GetAdditionalProperties() any {
	if o == nil {
		return nil
	}
	return o.AdditionalProperties
}

type SourceOracleEnterpriseSSHTunnelMethodType string

const (
	SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseNoTunnel               SourceOracleEnterpriseSSHTunnelMethodType = "source-oracle-enterprise_No Tunnel"
	SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseSSHKeyAuthentication   SourceOracleEnterpriseSSHTunnelMethodType = "source-oracle-enterprise_SSH Key Authentication"
	SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterprisePasswordAuthentication SourceOracleEnterpriseSSHTunnelMethodType = "source-oracle-enterprise_Password Authentication"
)

// SourceOracleEnterpriseSSHTunnelMethod - Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.
type SourceOracleEnterpriseSSHTunnelMethod struct {
	SourceOracleEnterpriseNoTunnel               *SourceOracleEnterpriseNoTunnel               `queryParam:"inline"`
	SourceOracleEnterpriseSSHKeyAuthentication   *SourceOracleEnterpriseSSHKeyAuthentication   `queryParam:"inline"`
	SourceOracleEnterprisePasswordAuthentication *SourceOracleEnterprisePasswordAuthentication `queryParam:"inline"`

	Type SourceOracleEnterpriseSSHTunnelMethodType
}

func CreateSourceOracleEnterpriseSSHTunnelMethodSourceOracleEnterpriseNoTunnel(sourceOracleEnterpriseNoTunnel SourceOracleEnterpriseNoTunnel) SourceOracleEnterpriseSSHTunnelMethod {
	typ := SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseNoTunnel

	return SourceOracleEnterpriseSSHTunnelMethod{
		SourceOracleEnterpriseNoTunnel: &sourceOracleEnterpriseNoTunnel,
		Type:                           typ,
	}
}

func CreateSourceOracleEnterpriseSSHTunnelMethodSourceOracleEnterpriseSSHKeyAuthentication(sourceOracleEnterpriseSSHKeyAuthentication SourceOracleEnterpriseSSHKeyAuthentication) SourceOracleEnterpriseSSHTunnelMethod {
	typ := SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseSSHKeyAuthentication

	return SourceOracleEnterpriseSSHTunnelMethod{
		SourceOracleEnterpriseSSHKeyAuthentication: &sourceOracleEnterpriseSSHKeyAuthentication,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseSSHTunnelMethodSourceOracleEnterprisePasswordAuthentication(sourceOracleEnterprisePasswordAuthentication SourceOracleEnterprisePasswordAuthentication) SourceOracleEnterpriseSSHTunnelMethod {
	typ := SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterprisePasswordAuthentication

	return SourceOracleEnterpriseSSHTunnelMethod{
		SourceOracleEnterprisePasswordAuthentication: &sourceOracleEnterprisePasswordAuthentication,
		Type: typ,
	}
}

func (u *SourceOracleEnterpriseSSHTunnelMethod) UnmarshalJSON(data []byte) error {

	var sourceOracleEnterpriseNoTunnel SourceOracleEnterpriseNoTunnel = SourceOracleEnterpriseNoTunnel{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseNoTunnel, "", true, true); err == nil {
		u.SourceOracleEnterpriseNoTunnel = &sourceOracleEnterpriseNoTunnel
		u.Type = SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseNoTunnel
		return nil
	}

	var sourceOracleEnterpriseSSHKeyAuthentication SourceOracleEnterpriseSSHKeyAuthentication = SourceOracleEnterpriseSSHKeyAuthentication{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseSSHKeyAuthentication, "", true, true); err == nil {
		u.SourceOracleEnterpriseSSHKeyAuthentication = &sourceOracleEnterpriseSSHKeyAuthentication
		u.Type = SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterpriseSSHKeyAuthentication
		return nil
	}

	var sourceOracleEnterprisePasswordAuthentication SourceOracleEnterprisePasswordAuthentication = SourceOracleEnterprisePasswordAuthentication{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterprisePasswordAuthentication, "", true, true); err == nil {
		u.SourceOracleEnterprisePasswordAuthentication = &sourceOracleEnterprisePasswordAuthentication
		u.Type = SourceOracleEnterpriseSSHTunnelMethodTypeSourceOracleEnterprisePasswordAuthentication
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for SourceOracleEnterpriseSSHTunnelMethod", string(data))
}

func (u SourceOracleEnterpriseSSHTunnelMethod) MarshalJSON() ([]byte, error) {
	if u.SourceOracleEnterpriseNoTunnel != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseNoTunnel, "", true)
	}

	if u.SourceOracleEnterpriseSSHKeyAuthentication != nil {
		return utils.MarshalJSON(u.SourceOracleEnterpriseSSHKeyAuthentication, "", true)
	}

	if u.SourceOracleEnterprisePasswordAuthentication != nil {
		return utils.MarshalJSON(u.SourceOracleEnterprisePasswordAuthentication, "", true)
	}

	return nil, errors.New("could not marshal union type SourceOracleEnterpriseSSHTunnelMethod: all fields are null")
}

type OracleEnterprise string

const (
	OracleEnterpriseOracleEnterprise OracleEnterprise = "oracle-enterprise"
)

func (e OracleEnterprise) ToPointer() *OracleEnterprise {
	return &e
}
func (e *OracleEnterprise) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "oracle-enterprise":
		*e = OracleEnterprise(v)
		return nil
	default:
		return fmt.Errorf("invalid value for OracleEnterprise: %v", v)
	}
}

type SourceOracleEnterprise struct {
	// When this feature is enabled, during schema discovery the connector will query each table or view individually to check access privileges and inaccessible tables, views, or columns therein will be removed. In large schemas, this might cause schema discovery to take too long, in which case it might be advisable to disable this feature.
	CheckPrivileges *bool `default:"true" json:"check_privileges"`
	// How often (in seconds) a stream should checkpoint, when possible.
	CheckpointTargetIntervalSeconds *int64 `default:"300" json:"checkpoint_target_interval_seconds"`
	// Maximum number of concurrent queries to the database.
	Concurrency *int64 `default:"1" json:"concurrency"`
	// The scheme by which to establish a database connection.
	ConnectionData SourceOracleEnterpriseConnectBy `json:"connection_data"`
	// Configures how data is extracted from the database.
	Cursor SourceOracleEnterpriseUpdateMethod `json:"cursor"`
	// The encryption method with is used when communicating with the database.
	Encryption SourceOracleEnterpriseEncryption `json:"encryption"`
	// Hostname of the database.
	Host string `json:"host"`
	// Additional properties to pass to the JDBC URL string when connecting to the database formatted as 'key=value' pairs separated by the symbol '&'. (example: key1=value1&key2=value2&key3=value3).
	JdbcURLParams *string `json:"jdbc_url_params,omitempty"`
	// The password associated with the username.
	Password *string `json:"password,omitempty"`
	// Port of the database.
	// Oracle Corporations recommends the following port numbers:
	// 1521 - Default listening port for client connections to the listener.
	// 2484 - Recommended and officially registered listening port for client connections to the listener using TCP/IP with SSL.
	Port *int64 `default:"1521" json:"port"`
	// The list of schemas to sync from. Defaults to user. Case sensitive.
	Schemas []string `json:"schemas,omitempty"`
	// Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.
	TunnelMethod SourceOracleEnterpriseSSHTunnelMethod `json:"tunnel_method"`
	// The username which is used to access the database.
	Username   string           `json:"username"`
	sourceType OracleEnterprise `const:"oracle-enterprise" json:"sourceType"`
}

func (s SourceOracleEnterprise) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceOracleEnterprise) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
		return err
	}
	return nil
}

func (o *SourceOracleEnterprise) GetCheckPrivileges() *bool {
	if o == nil {
		return nil
	}
	return o.CheckPrivileges
}

func (o *SourceOracleEnterprise) GetCheckpointTargetIntervalSeconds() *int64 {
	if o == nil {
		return nil
	}
	return o.CheckpointTargetIntervalSeconds
}

func (o *SourceOracleEnterprise) GetConcurrency() *int64 {
	if o == nil {
		return nil
	}
	return o.Concurrency
}

func (o *SourceOracleEnterprise) GetConnectionData() SourceOracleEnterpriseConnectBy {
	if o == nil {
		return SourceOracleEnterpriseConnectBy{}
	}
	return o.ConnectionData
}

func (o *SourceOracleEnterprise) GetCursor() SourceOracleEnterpriseUpdateMethod {
	if o == nil {
		return SourceOracleEnterpriseUpdateMethod{}
	}
	return o.Cursor
}

func (o *SourceOracleEnterprise) GetEncryption() SourceOracleEnterpriseEncryption {
	if o == nil {
		return SourceOracleEnterpriseEncryption{}
	}
	return o.Encryption
}

func (o *SourceOracleEnterprise) GetHost() string {
	if o == nil {
		return ""
	}
	return o.Host
}

func (o *SourceOracleEnterprise) GetJdbcURLParams() *string {
	if o == nil {
		return nil
	}
	return o.JdbcURLParams
}

func (o *SourceOracleEnterprise) GetPassword() *string {
	if o == nil {
		return nil
	}
	return o.Password
}

func (o *SourceOracleEnterprise) GetPort() *int64 {
	if o == nil {
		return nil
	}
	return o.Port
}

func (o *SourceOracleEnterprise) GetSchemas() []string {
	if o == nil {
		return nil
	}
	return o.Schemas
}

func (o *SourceOracleEnterprise) GetTunnelMethod() SourceOracleEnterpriseSSHTunnelMethod {
	if o == nil {
		return SourceOracleEnterpriseSSHTunnelMethod{}
	}
	return o.TunnelMethod
}

func (o *SourceOracleEnterprise) GetUsername() string {
	if o == nil {
		return ""
	}
	return o.Username
}

func (o *SourceOracleEnterprise) GetSourceType() OracleEnterprise {
	return OracleEnterpriseOracleEnterprise
}
