// 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 SourceOracleEnterpriseUpdateSchemasConnectionType string

const (
	SourceOracleEnterpriseUpdateSchemasConnectionTypeSid SourceOracleEnterpriseUpdateSchemasConnectionType = "sid"
)

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

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

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

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

func (o *SourceOracleEnterpriseUpdateSystemIDSID) GetConnectionType() *SourceOracleEnterpriseUpdateSchemasConnectionType {
	if o == nil {
		return nil
	}
	return o.ConnectionType
}

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

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

type SourceOracleEnterpriseUpdateConnectionType string

const (
	SourceOracleEnterpriseUpdateConnectionTypeServiceName SourceOracleEnterpriseUpdateConnectionType = "service_name"
)

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

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

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

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

func (o *SourceOracleEnterpriseUpdateServiceName) GetConnectionType() *SourceOracleEnterpriseUpdateConnectionType {
	if o == nil {
		return nil
	}
	return o.ConnectionType
}

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

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

type SourceOracleEnterpriseUpdateConnectByType string

const (
	SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateServiceName SourceOracleEnterpriseUpdateConnectByType = "source-oracle-enterprise-update_Service name"
	SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateSystemIDSID SourceOracleEnterpriseUpdateConnectByType = "source-oracle-enterprise-update_System ID (SID)"
)

// SourceOracleEnterpriseUpdateConnectBy - The scheme by which to establish a database connection.
type SourceOracleEnterpriseUpdateConnectBy struct {
	SourceOracleEnterpriseUpdateServiceName *SourceOracleEnterpriseUpdateServiceName `queryParam:"inline"`
	SourceOracleEnterpriseUpdateSystemIDSID *SourceOracleEnterpriseUpdateSystemIDSID `queryParam:"inline"`

	Type SourceOracleEnterpriseUpdateConnectByType
}

func CreateSourceOracleEnterpriseUpdateConnectBySourceOracleEnterpriseUpdateServiceName(sourceOracleEnterpriseUpdateServiceName SourceOracleEnterpriseUpdateServiceName) SourceOracleEnterpriseUpdateConnectBy {
	typ := SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateServiceName

	return SourceOracleEnterpriseUpdateConnectBy{
		SourceOracleEnterpriseUpdateServiceName: &sourceOracleEnterpriseUpdateServiceName,
		Type:                                    typ,
	}
}

func CreateSourceOracleEnterpriseUpdateConnectBySourceOracleEnterpriseUpdateSystemIDSID(sourceOracleEnterpriseUpdateSystemIDSID SourceOracleEnterpriseUpdateSystemIDSID) SourceOracleEnterpriseUpdateConnectBy {
	typ := SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateSystemIDSID

	return SourceOracleEnterpriseUpdateConnectBy{
		SourceOracleEnterpriseUpdateSystemIDSID: &sourceOracleEnterpriseUpdateSystemIDSID,
		Type:                                    typ,
	}
}

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

	var sourceOracleEnterpriseUpdateServiceName SourceOracleEnterpriseUpdateServiceName = SourceOracleEnterpriseUpdateServiceName{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateServiceName, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateServiceName = &sourceOracleEnterpriseUpdateServiceName
		u.Type = SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateServiceName
		return nil
	}

	var sourceOracleEnterpriseUpdateSystemIDSID SourceOracleEnterpriseUpdateSystemIDSID = SourceOracleEnterpriseUpdateSystemIDSID{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateSystemIDSID, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateSystemIDSID = &sourceOracleEnterpriseUpdateSystemIDSID
		u.Type = SourceOracleEnterpriseUpdateConnectByTypeSourceOracleEnterpriseUpdateSystemIDSID
		return nil
	}

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

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

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

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

type SourceOracleEnterpriseUpdateSchemasCursorMethod string

const (
	SourceOracleEnterpriseUpdateSchemasCursorMethodCdc SourceOracleEnterpriseUpdateSchemasCursorMethod = "cdc"
)

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

// SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced - 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 SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced string

const (
	SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvancedFailSync   SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced = "Fail sync"
	SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvancedReSyncData SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced = "Re-sync data"
)

func (e SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced) ToPointer() *SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced {
	return &e
}
func (e *SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced) 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 = SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced: %v", v)
	}
}

// SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC - <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 SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC struct {
	CursorMethod *SourceOracleEnterpriseUpdateSchemasCursorMethod `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 *SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced `default:"Fail sync" json:"invalid_cdc_cursor_position_behavior"`
	AdditionalProperties             any                                                             `additionalProperties:"true" json:"-"`
}

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

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

func (o *SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC) GetCursorMethod() *SourceOracleEnterpriseUpdateSchemasCursorMethod {
	if o == nil {
		return nil
	}
	return o.CursorMethod
}

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

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

func (o *SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC) GetInvalidCdcCursorPositionBehavior() *SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced {
	if o == nil {
		return nil
	}
	return o.InvalidCdcCursorPositionBehavior
}

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

type SourceOracleEnterpriseUpdateCursorMethod string

const (
	SourceOracleEnterpriseUpdateCursorMethodUserDefined SourceOracleEnterpriseUpdateCursorMethod = "user_defined"
)

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

// SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor - 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 SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor struct {
	CursorMethod         *SourceOracleEnterpriseUpdateCursorMethod `default:"user_defined" json:"cursor_method"`
	AdditionalProperties any                                       `additionalProperties:"true" json:"-"`
}

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

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

func (o *SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor) GetCursorMethod() *SourceOracleEnterpriseUpdateCursorMethod {
	if o == nil {
		return nil
	}
	return o.CursorMethod
}

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

type SourceOracleEnterpriseUpdateUpdateMethodType string

const (
	SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor     SourceOracleEnterpriseUpdateUpdateMethodType = "source-oracle-enterprise-update_Scan Changes with User Defined Cursor"
	SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseUpdateUpdateMethodType = "source-oracle-enterprise-update_Read Changes using Change Data Capture (CDC)"
)

// SourceOracleEnterpriseUpdateUpdateMethod - Configures how data is extracted from the database.
type SourceOracleEnterpriseUpdateUpdateMethod struct {
	SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor     *SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor     `queryParam:"inline"`
	SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC *SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC `queryParam:"inline"`

	Type SourceOracleEnterpriseUpdateUpdateMethodType
}

func CreateSourceOracleEnterpriseUpdateUpdateMethodSourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor(sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor) SourceOracleEnterpriseUpdateUpdateMethod {
	typ := SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor

	return SourceOracleEnterpriseUpdateUpdateMethod{
		SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor: &sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseUpdateUpdateMethodSourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC(sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC) SourceOracleEnterpriseUpdateUpdateMethod {
	typ := SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC

	return SourceOracleEnterpriseUpdateUpdateMethod{
		SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC: &sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC,
		Type: typ,
	}
}

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

	var sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor = SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor = &sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor
		u.Type = SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor
		return nil
	}

	var sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC = SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC = &sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC
		u.Type = SourceOracleEnterpriseUpdateUpdateMethodTypeSourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC
		return nil
	}

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

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

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

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

type SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod string

const (
	SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethodEncryptedVerifyCertificate SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod = "encrypted_verify_certificate"
)

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

// SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate - Verify and use the certificate provided by the server.
type SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate struct {
	EncryptionMethod *SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod `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 SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

func (o *SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate) GetEncryptionMethod() *SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

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

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

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

const (
	SourceOracleEnterpriseUpdateEncryptionAlgorithmAes256      SourceOracleEnterpriseUpdateEncryptionAlgorithm = "AES256"
	SourceOracleEnterpriseUpdateEncryptionAlgorithmAes192      SourceOracleEnterpriseUpdateEncryptionAlgorithm = "AES192"
	SourceOracleEnterpriseUpdateEncryptionAlgorithmAes128      SourceOracleEnterpriseUpdateEncryptionAlgorithm = "AES128"
	SourceOracleEnterpriseUpdateEncryptionAlgorithmThreeDes168 SourceOracleEnterpriseUpdateEncryptionAlgorithm = "3DES168"
	SourceOracleEnterpriseUpdateEncryptionAlgorithmThreeDes112 SourceOracleEnterpriseUpdateEncryptionAlgorithm = "3DES112"
	SourceOracleEnterpriseUpdateEncryptionAlgorithmDes         SourceOracleEnterpriseUpdateEncryptionAlgorithm = "DES"
)

func (e SourceOracleEnterpriseUpdateEncryptionAlgorithm) ToPointer() *SourceOracleEnterpriseUpdateEncryptionAlgorithm {
	return &e
}
func (e *SourceOracleEnterpriseUpdateEncryptionAlgorithm) 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 = SourceOracleEnterpriseUpdateEncryptionAlgorithm(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceOracleEnterpriseUpdateEncryptionAlgorithm: %v", v)
	}
}

type SourceOracleEnterpriseUpdateSchemasEncryptionMethod string

const (
	SourceOracleEnterpriseUpdateSchemasEncryptionMethodClientNne SourceOracleEnterpriseUpdateSchemasEncryptionMethod = "client_nne"
)

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

// SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE - 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 SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE struct {
	// This parameter defines what encryption algorithm is used.
	EncryptionAlgorithm  *SourceOracleEnterpriseUpdateEncryptionAlgorithm     `default:"AES256" json:"encryption_algorithm"`
	EncryptionMethod     *SourceOracleEnterpriseUpdateSchemasEncryptionMethod `default:"client_nne" json:"encryption_method"`
	AdditionalProperties any                                                  `additionalProperties:"true" json:"-"`
}

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

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

func (o *SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE) GetEncryptionAlgorithm() *SourceOracleEnterpriseUpdateEncryptionAlgorithm {
	if o == nil {
		return nil
	}
	return o.EncryptionAlgorithm
}

func (o *SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE) GetEncryptionMethod() *SourceOracleEnterpriseUpdateSchemasEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

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

type SourceOracleEnterpriseUpdateEncryptionMethod string

const (
	SourceOracleEnterpriseUpdateEncryptionMethodUnencrypted SourceOracleEnterpriseUpdateEncryptionMethod = "unencrypted"
)

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

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

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

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

func (o *SourceOracleEnterpriseUpdateUnencrypted) GetEncryptionMethod() *SourceOracleEnterpriseUpdateEncryptionMethod {
	if o == nil {
		return nil
	}
	return o.EncryptionMethod
}

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

type SourceOracleEnterpriseUpdateEncryptionType string

const (
	SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateUnencrypted                   SourceOracleEnterpriseUpdateEncryptionType = "source-oracle-enterprise-update_Unencrypted"
	SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE    SourceOracleEnterpriseUpdateEncryptionType = "source-oracle-enterprise-update_Native Network Encryption (NNE)"
	SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate SourceOracleEnterpriseUpdateEncryptionType = "source-oracle-enterprise-update_TLS Encrypted (verify certificate)"
)

// SourceOracleEnterpriseUpdateEncryption - The encryption method with is used when communicating with the database.
type SourceOracleEnterpriseUpdateEncryption struct {
	SourceOracleEnterpriseUpdateUnencrypted                   *SourceOracleEnterpriseUpdateUnencrypted                   `queryParam:"inline"`
	SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE    *SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE    `queryParam:"inline"`
	SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate *SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate `queryParam:"inline"`

	Type SourceOracleEnterpriseUpdateEncryptionType
}

func CreateSourceOracleEnterpriseUpdateEncryptionSourceOracleEnterpriseUpdateUnencrypted(sourceOracleEnterpriseUpdateUnencrypted SourceOracleEnterpriseUpdateUnencrypted) SourceOracleEnterpriseUpdateEncryption {
	typ := SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateUnencrypted

	return SourceOracleEnterpriseUpdateEncryption{
		SourceOracleEnterpriseUpdateUnencrypted: &sourceOracleEnterpriseUpdateUnencrypted,
		Type:                                    typ,
	}
}

func CreateSourceOracleEnterpriseUpdateEncryptionSourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE(sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE) SourceOracleEnterpriseUpdateEncryption {
	typ := SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE

	return SourceOracleEnterpriseUpdateEncryption{
		SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE: &sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseUpdateEncryptionSourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate(sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate) SourceOracleEnterpriseUpdateEncryption {
	typ := SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate

	return SourceOracleEnterpriseUpdateEncryption{
		SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate: &sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate,
		Type: typ,
	}
}

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

	var sourceOracleEnterpriseUpdateUnencrypted SourceOracleEnterpriseUpdateUnencrypted = SourceOracleEnterpriseUpdateUnencrypted{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateUnencrypted, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateUnencrypted = &sourceOracleEnterpriseUpdateUnencrypted
		u.Type = SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateUnencrypted
		return nil
	}

	var sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE = SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE = &sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE
		u.Type = SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE
		return nil
	}

	var sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate = SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate = &sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate
		u.Type = SourceOracleEnterpriseUpdateEncryptionTypeSourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate
		return nil
	}

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

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

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

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

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

type SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod string

const (
	SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethodSSHPasswordAuth SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod = "SSH_PASSWORD_AUTH"
)

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

// SourceOracleEnterpriseUpdatePasswordAuthentication - Connect through a jump server tunnel host using username and password authentication
type SourceOracleEnterpriseUpdatePasswordAuthentication struct {
	// Hostname of the jump server host that allows inbound ssh tunnel.
	TunnelHost   string                                                       `json:"tunnel_host"`
	TunnelMethod *SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod `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 SourceOracleEnterpriseUpdatePasswordAuthentication) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

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

func (o *SourceOracleEnterpriseUpdatePasswordAuthentication) GetTunnelMethod() *SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

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

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

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

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

type SourceOracleEnterpriseUpdateSchemasTunnelMethod string

const (
	SourceOracleEnterpriseUpdateSchemasTunnelMethodSSHKeyAuth SourceOracleEnterpriseUpdateSchemasTunnelMethod = "SSH_KEY_AUTH"
)

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

// SourceOracleEnterpriseUpdateSSHKeyAuthentication - Connect through a jump server tunnel host using username and ssh key
type SourceOracleEnterpriseUpdateSSHKeyAuthentication 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 *SourceOracleEnterpriseUpdateSchemasTunnelMethod `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 SourceOracleEnterpriseUpdateSSHKeyAuthentication) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

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

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

func (o *SourceOracleEnterpriseUpdateSSHKeyAuthentication) GetTunnelMethod() *SourceOracleEnterpriseUpdateSchemasTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

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

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

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

type SourceOracleEnterpriseUpdateTunnelMethod string

const (
	SourceOracleEnterpriseUpdateTunnelMethodNoTunnel SourceOracleEnterpriseUpdateTunnelMethod = "NO_TUNNEL"
)

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

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

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

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

func (o *SourceOracleEnterpriseUpdateNoTunnel) GetTunnelMethod() *SourceOracleEnterpriseUpdateTunnelMethod {
	if o == nil {
		return nil
	}
	return o.TunnelMethod
}

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

type SourceOracleEnterpriseUpdateSSHTunnelMethodType string

const (
	SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateNoTunnel               SourceOracleEnterpriseUpdateSSHTunnelMethodType = "source-oracle-enterprise-update_No Tunnel"
	SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateSSHKeyAuthentication   SourceOracleEnterpriseUpdateSSHTunnelMethodType = "source-oracle-enterprise-update_SSH Key Authentication"
	SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdatePasswordAuthentication SourceOracleEnterpriseUpdateSSHTunnelMethodType = "source-oracle-enterprise-update_Password Authentication"
)

// SourceOracleEnterpriseUpdateSSHTunnelMethod - Whether to initiate an SSH tunnel before connecting to the database, and if so, which kind of authentication to use.
type SourceOracleEnterpriseUpdateSSHTunnelMethod struct {
	SourceOracleEnterpriseUpdateNoTunnel               *SourceOracleEnterpriseUpdateNoTunnel               `queryParam:"inline"`
	SourceOracleEnterpriseUpdateSSHKeyAuthentication   *SourceOracleEnterpriseUpdateSSHKeyAuthentication   `queryParam:"inline"`
	SourceOracleEnterpriseUpdatePasswordAuthentication *SourceOracleEnterpriseUpdatePasswordAuthentication `queryParam:"inline"`

	Type SourceOracleEnterpriseUpdateSSHTunnelMethodType
}

func CreateSourceOracleEnterpriseUpdateSSHTunnelMethodSourceOracleEnterpriseUpdateNoTunnel(sourceOracleEnterpriseUpdateNoTunnel SourceOracleEnterpriseUpdateNoTunnel) SourceOracleEnterpriseUpdateSSHTunnelMethod {
	typ := SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateNoTunnel

	return SourceOracleEnterpriseUpdateSSHTunnelMethod{
		SourceOracleEnterpriseUpdateNoTunnel: &sourceOracleEnterpriseUpdateNoTunnel,
		Type:                                 typ,
	}
}

func CreateSourceOracleEnterpriseUpdateSSHTunnelMethodSourceOracleEnterpriseUpdateSSHKeyAuthentication(sourceOracleEnterpriseUpdateSSHKeyAuthentication SourceOracleEnterpriseUpdateSSHKeyAuthentication) SourceOracleEnterpriseUpdateSSHTunnelMethod {
	typ := SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateSSHKeyAuthentication

	return SourceOracleEnterpriseUpdateSSHTunnelMethod{
		SourceOracleEnterpriseUpdateSSHKeyAuthentication: &sourceOracleEnterpriseUpdateSSHKeyAuthentication,
		Type: typ,
	}
}

func CreateSourceOracleEnterpriseUpdateSSHTunnelMethodSourceOracleEnterpriseUpdatePasswordAuthentication(sourceOracleEnterpriseUpdatePasswordAuthentication SourceOracleEnterpriseUpdatePasswordAuthentication) SourceOracleEnterpriseUpdateSSHTunnelMethod {
	typ := SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdatePasswordAuthentication

	return SourceOracleEnterpriseUpdateSSHTunnelMethod{
		SourceOracleEnterpriseUpdatePasswordAuthentication: &sourceOracleEnterpriseUpdatePasswordAuthentication,
		Type: typ,
	}
}

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

	var sourceOracleEnterpriseUpdateNoTunnel SourceOracleEnterpriseUpdateNoTunnel = SourceOracleEnterpriseUpdateNoTunnel{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateNoTunnel, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateNoTunnel = &sourceOracleEnterpriseUpdateNoTunnel
		u.Type = SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateNoTunnel
		return nil
	}

	var sourceOracleEnterpriseUpdateSSHKeyAuthentication SourceOracleEnterpriseUpdateSSHKeyAuthentication = SourceOracleEnterpriseUpdateSSHKeyAuthentication{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdateSSHKeyAuthentication, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdateSSHKeyAuthentication = &sourceOracleEnterpriseUpdateSSHKeyAuthentication
		u.Type = SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdateSSHKeyAuthentication
		return nil
	}

	var sourceOracleEnterpriseUpdatePasswordAuthentication SourceOracleEnterpriseUpdatePasswordAuthentication = SourceOracleEnterpriseUpdatePasswordAuthentication{}
	if err := utils.UnmarshalJSON(data, &sourceOracleEnterpriseUpdatePasswordAuthentication, "", true, true); err == nil {
		u.SourceOracleEnterpriseUpdatePasswordAuthentication = &sourceOracleEnterpriseUpdatePasswordAuthentication
		u.Type = SourceOracleEnterpriseUpdateSSHTunnelMethodTypeSourceOracleEnterpriseUpdatePasswordAuthentication
		return nil
	}

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

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

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

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

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

type SourceOracleEnterpriseUpdate 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 SourceOracleEnterpriseUpdateConnectBy `json:"connection_data"`
	// Configures how data is extracted from the database.
	Cursor SourceOracleEnterpriseUpdateUpdateMethod `json:"cursor"`
	// The encryption method with is used when communicating with the database.
	Encryption SourceOracleEnterpriseUpdateEncryption `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 SourceOracleEnterpriseUpdateSSHTunnelMethod `json:"tunnel_method"`
	// The username which is used to access the database.
	Username string `json:"username"`
}

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

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

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

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

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

func (o *SourceOracleEnterpriseUpdate) GetConnectionData() SourceOracleEnterpriseUpdateConnectBy {
	if o == nil {
		return SourceOracleEnterpriseUpdateConnectBy{}
	}
	return o.ConnectionData
}

func (o *SourceOracleEnterpriseUpdate) GetCursor() SourceOracleEnterpriseUpdateUpdateMethod {
	if o == nil {
		return SourceOracleEnterpriseUpdateUpdateMethod{}
	}
	return o.Cursor
}

func (o *SourceOracleEnterpriseUpdate) GetEncryption() SourceOracleEnterpriseUpdateEncryption {
	if o == nil {
		return SourceOracleEnterpriseUpdateEncryption{}
	}
	return o.Encryption
}

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

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

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

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

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

func (o *SourceOracleEnterpriseUpdate) GetTunnelMethod() SourceOracleEnterpriseUpdateSSHTunnelMethod {
	if o == nil {
		return SourceOracleEnterpriseUpdateSSHTunnelMethod{}
	}
	return o.TunnelMethod
}

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