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

package provider

import (
	"encoding/json"
	tfTypes "github.com/airbytehq/terraform-provider-airbyte/internal/provider/types"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/models/shared"
	"github.com/hashicorp/terraform-plugin-framework/types"
)

func (r *SourceOracleEnterpriseResourceModel) ToSharedSourceOracleEnterpriseCreateRequest() *shared.SourceOracleEnterpriseCreateRequest {
	var name string
	name = r.Name.ValueString()

	definitionID := new(string)
	if !r.DefinitionID.IsUnknown() && !r.DefinitionID.IsNull() {
		*definitionID = r.DefinitionID.ValueString()
	} else {
		definitionID = nil
	}
	var workspaceID string
	workspaceID = r.WorkspaceID.ValueString()

	checkPrivileges := new(bool)
	if !r.Configuration.CheckPrivileges.IsUnknown() && !r.Configuration.CheckPrivileges.IsNull() {
		*checkPrivileges = r.Configuration.CheckPrivileges.ValueBool()
	} else {
		checkPrivileges = nil
	}
	checkpointTargetIntervalSeconds := new(int64)
	if !r.Configuration.CheckpointTargetIntervalSeconds.IsUnknown() && !r.Configuration.CheckpointTargetIntervalSeconds.IsNull() {
		*checkpointTargetIntervalSeconds = r.Configuration.CheckpointTargetIntervalSeconds.ValueInt64()
	} else {
		checkpointTargetIntervalSeconds = nil
	}
	concurrency := new(int64)
	if !r.Configuration.Concurrency.IsUnknown() && !r.Configuration.Concurrency.IsNull() {
		*concurrency = r.Configuration.Concurrency.ValueInt64()
	} else {
		concurrency = nil
	}
	var connectionData shared.SourceOracleEnterpriseConnectBy
	var sourceOracleEnterpriseServiceName *shared.SourceOracleEnterpriseServiceName
	if r.Configuration.ConnectionData.ServiceName != nil {
		connectionType := new(shared.SourceOracleEnterpriseConnectionType)
		if !r.Configuration.ConnectionData.ServiceName.ConnectionType.IsUnknown() && !r.Configuration.ConnectionData.ServiceName.ConnectionType.IsNull() {
			*connectionType = shared.SourceOracleEnterpriseConnectionType(r.Configuration.ConnectionData.ServiceName.ConnectionType.ValueString())
		} else {
			connectionType = nil
		}
		var serviceName string
		serviceName = r.Configuration.ConnectionData.ServiceName.ServiceName.ValueString()

		var additionalProperties interface{}
		if !r.Configuration.ConnectionData.ServiceName.AdditionalProperties.IsUnknown() && !r.Configuration.ConnectionData.ServiceName.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.ConnectionData.ServiceName.AdditionalProperties.ValueString()), &additionalProperties)
		}
		sourceOracleEnterpriseServiceName = &shared.SourceOracleEnterpriseServiceName{
			ConnectionType:       connectionType,
			ServiceName:          serviceName,
			AdditionalProperties: additionalProperties,
		}
	}
	if sourceOracleEnterpriseServiceName != nil {
		connectionData = shared.SourceOracleEnterpriseConnectBy{
			SourceOracleEnterpriseServiceName: sourceOracleEnterpriseServiceName,
		}
	}
	var sourceOracleEnterpriseSystemIDSID *shared.SourceOracleEnterpriseSystemIDSID
	if r.Configuration.ConnectionData.SystemIDSID != nil {
		connectionType1 := new(shared.SourceOracleEnterpriseSchemasConnectionType)
		if !r.Configuration.ConnectionData.SystemIDSID.ConnectionType.IsUnknown() && !r.Configuration.ConnectionData.SystemIDSID.ConnectionType.IsNull() {
			*connectionType1 = shared.SourceOracleEnterpriseSchemasConnectionType(r.Configuration.ConnectionData.SystemIDSID.ConnectionType.ValueString())
		} else {
			connectionType1 = nil
		}
		var sid string
		sid = r.Configuration.ConnectionData.SystemIDSID.Sid.ValueString()

		var additionalProperties1 interface{}
		if !r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.IsUnknown() && !r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.ValueString()), &additionalProperties1)
		}
		sourceOracleEnterpriseSystemIDSID = &shared.SourceOracleEnterpriseSystemIDSID{
			ConnectionType:       connectionType1,
			Sid:                  sid,
			AdditionalProperties: additionalProperties1,
		}
	}
	if sourceOracleEnterpriseSystemIDSID != nil {
		connectionData = shared.SourceOracleEnterpriseConnectBy{
			SourceOracleEnterpriseSystemIDSID: sourceOracleEnterpriseSystemIDSID,
		}
	}
	var cursor shared.SourceOracleEnterpriseUpdateMethod
	var sourceOracleEnterpriseScanChangesWithUserDefinedCursor *shared.SourceOracleEnterpriseScanChangesWithUserDefinedCursor
	if r.Configuration.Cursor.ScanChangesWithUserDefinedCursor != nil {
		cursorMethod := new(shared.SourceOracleEnterpriseCursorMethod)
		if !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.IsUnknown() && !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.IsNull() {
			*cursorMethod = shared.SourceOracleEnterpriseCursorMethod(r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.ValueString())
		} else {
			cursorMethod = nil
		}
		var additionalProperties2 interface{}
		if !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.IsUnknown() && !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.ValueString()), &additionalProperties2)
		}
		sourceOracleEnterpriseScanChangesWithUserDefinedCursor = &shared.SourceOracleEnterpriseScanChangesWithUserDefinedCursor{
			CursorMethod:         cursorMethod,
			AdditionalProperties: additionalProperties2,
		}
	}
	if sourceOracleEnterpriseScanChangesWithUserDefinedCursor != nil {
		cursor = shared.SourceOracleEnterpriseUpdateMethod{
			SourceOracleEnterpriseScanChangesWithUserDefinedCursor: sourceOracleEnterpriseScanChangesWithUserDefinedCursor,
		}
	}
	var sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC *shared.SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC
	if r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC != nil {
		cursorMethod1 := new(shared.SourceOracleEnterpriseSchemasCursorMethod)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.IsNull() {
			*cursorMethod1 = shared.SourceOracleEnterpriseSchemasCursorMethod(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.ValueString())
		} else {
			cursorMethod1 = nil
		}
		debeziumShutdownTimeoutSeconds := new(int64)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.IsNull() {
			*debeziumShutdownTimeoutSeconds = r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.ValueInt64()
		} else {
			debeziumShutdownTimeoutSeconds = nil
		}
		initialLoadTimeoutHours := new(int64)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.IsNull() {
			*initialLoadTimeoutHours = r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.ValueInt64()
		} else {
			initialLoadTimeoutHours = nil
		}
		invalidCdcCursorPositionBehavior := new(shared.SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.IsNull() {
			*invalidCdcCursorPositionBehavior = shared.SourceOracleEnterpriseInvalidCDCPositionBehaviorAdvanced(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.ValueString())
		} else {
			invalidCdcCursorPositionBehavior = nil
		}
		var additionalProperties3 interface{}
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.ValueString()), &additionalProperties3)
		}
		sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC = &shared.SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC{
			CursorMethod:                     cursorMethod1,
			DebeziumShutdownTimeoutSeconds:   debeziumShutdownTimeoutSeconds,
			InitialLoadTimeoutHours:          initialLoadTimeoutHours,
			InvalidCdcCursorPositionBehavior: invalidCdcCursorPositionBehavior,
			AdditionalProperties:             additionalProperties3,
		}
	}
	if sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC != nil {
		cursor = shared.SourceOracleEnterpriseUpdateMethod{
			SourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC: sourceOracleEnterpriseReadChangesUsingChangeDataCaptureCDC,
		}
	}
	var encryption shared.SourceOracleEnterpriseEncryption
	var sourceOracleEnterpriseUnencrypted *shared.SourceOracleEnterpriseUnencrypted
	if r.Configuration.Encryption.Unencrypted != nil {
		encryptionMethod := new(shared.SourceOracleEnterpriseEncryptionMethod)
		if !r.Configuration.Encryption.Unencrypted.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.Unencrypted.EncryptionMethod.IsNull() {
			*encryptionMethod = shared.SourceOracleEnterpriseEncryptionMethod(r.Configuration.Encryption.Unencrypted.EncryptionMethod.ValueString())
		} else {
			encryptionMethod = nil
		}
		var additionalProperties4 interface{}
		if !r.Configuration.Encryption.Unencrypted.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.Unencrypted.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.Unencrypted.AdditionalProperties.ValueString()), &additionalProperties4)
		}
		sourceOracleEnterpriseUnencrypted = &shared.SourceOracleEnterpriseUnencrypted{
			EncryptionMethod:     encryptionMethod,
			AdditionalProperties: additionalProperties4,
		}
	}
	if sourceOracleEnterpriseUnencrypted != nil {
		encryption = shared.SourceOracleEnterpriseEncryption{
			SourceOracleEnterpriseUnencrypted: sourceOracleEnterpriseUnencrypted,
		}
	}
	var sourceOracleEnterpriseNativeNetworkEncryptionNNE *shared.SourceOracleEnterpriseNativeNetworkEncryptionNNE
	if r.Configuration.Encryption.NativeNetworkEncryptionNNE != nil {
		encryptionAlgorithm := new(shared.SourceOracleEnterpriseEncryptionAlgorithm)
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.IsNull() {
			*encryptionAlgorithm = shared.SourceOracleEnterpriseEncryptionAlgorithm(r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.ValueString())
		} else {
			encryptionAlgorithm = nil
		}
		encryptionMethod1 := new(shared.SourceOracleEnterpriseSchemasEncryptionMethod)
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.IsNull() {
			*encryptionMethod1 = shared.SourceOracleEnterpriseSchemasEncryptionMethod(r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.ValueString())
		} else {
			encryptionMethod1 = nil
		}
		var additionalProperties5 interface{}
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.ValueString()), &additionalProperties5)
		}
		sourceOracleEnterpriseNativeNetworkEncryptionNNE = &shared.SourceOracleEnterpriseNativeNetworkEncryptionNNE{
			EncryptionAlgorithm:  encryptionAlgorithm,
			EncryptionMethod:     encryptionMethod1,
			AdditionalProperties: additionalProperties5,
		}
	}
	if sourceOracleEnterpriseNativeNetworkEncryptionNNE != nil {
		encryption = shared.SourceOracleEnterpriseEncryption{
			SourceOracleEnterpriseNativeNetworkEncryptionNNE: sourceOracleEnterpriseNativeNetworkEncryptionNNE,
		}
	}
	var sourceOracleEnterpriseTLSEncryptedVerifyCertificate *shared.SourceOracleEnterpriseTLSEncryptedVerifyCertificate
	if r.Configuration.Encryption.TLSEncryptedVerifyCertificate != nil {
		encryptionMethod2 := new(shared.SourceOracleEnterpriseSchemasEncryptionEncryptionMethod)
		if !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.IsNull() {
			*encryptionMethod2 = shared.SourceOracleEnterpriseSchemasEncryptionEncryptionMethod(r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.ValueString())
		} else {
			encryptionMethod2 = nil
		}
		var sslCertificate string
		sslCertificate = r.Configuration.Encryption.TLSEncryptedVerifyCertificate.SslCertificate.ValueString()

		var additionalProperties6 interface{}
		if !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.ValueString()), &additionalProperties6)
		}
		sourceOracleEnterpriseTLSEncryptedVerifyCertificate = &shared.SourceOracleEnterpriseTLSEncryptedVerifyCertificate{
			EncryptionMethod:     encryptionMethod2,
			SslCertificate:       sslCertificate,
			AdditionalProperties: additionalProperties6,
		}
	}
	if sourceOracleEnterpriseTLSEncryptedVerifyCertificate != nil {
		encryption = shared.SourceOracleEnterpriseEncryption{
			SourceOracleEnterpriseTLSEncryptedVerifyCertificate: sourceOracleEnterpriseTLSEncryptedVerifyCertificate,
		}
	}
	var host string
	host = r.Configuration.Host.ValueString()

	jdbcURLParams := new(string)
	if !r.Configuration.JdbcURLParams.IsUnknown() && !r.Configuration.JdbcURLParams.IsNull() {
		*jdbcURLParams = r.Configuration.JdbcURLParams.ValueString()
	} else {
		jdbcURLParams = nil
	}
	password := new(string)
	if !r.Configuration.Password.IsUnknown() && !r.Configuration.Password.IsNull() {
		*password = r.Configuration.Password.ValueString()
	} else {
		password = nil
	}
	port := new(int64)
	if !r.Configuration.Port.IsUnknown() && !r.Configuration.Port.IsNull() {
		*port = r.Configuration.Port.ValueInt64()
	} else {
		port = nil
	}
	var schemas []string = []string{}
	for _, schemasItem := range r.Configuration.Schemas {
		schemas = append(schemas, schemasItem.ValueString())
	}
	var tunnelMethod shared.SourceOracleEnterpriseSSHTunnelMethod
	var sourceOracleEnterpriseNoTunnel *shared.SourceOracleEnterpriseNoTunnel
	if r.Configuration.TunnelMethod.NoTunnel != nil {
		tunnelMethod1 := new(shared.SourceOracleEnterpriseTunnelMethod)
		if !r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.IsNull() {
			*tunnelMethod1 = shared.SourceOracleEnterpriseTunnelMethod(r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.ValueString())
		} else {
			tunnelMethod1 = nil
		}
		var additionalProperties7 interface{}
		if !r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.ValueString()), &additionalProperties7)
		}
		sourceOracleEnterpriseNoTunnel = &shared.SourceOracleEnterpriseNoTunnel{
			TunnelMethod:         tunnelMethod1,
			AdditionalProperties: additionalProperties7,
		}
	}
	if sourceOracleEnterpriseNoTunnel != nil {
		tunnelMethod = shared.SourceOracleEnterpriseSSHTunnelMethod{
			SourceOracleEnterpriseNoTunnel: sourceOracleEnterpriseNoTunnel,
		}
	}
	var sourceOracleEnterpriseSSHKeyAuthentication *shared.SourceOracleEnterpriseSSHKeyAuthentication
	if r.Configuration.TunnelMethod.SSHKeyAuthentication != nil {
		var sshKey string
		sshKey = r.Configuration.TunnelMethod.SSHKeyAuthentication.SSHKey.ValueString()

		var tunnelHost string
		tunnelHost = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelHost.ValueString()

		tunnelMethod2 := new(shared.SourceOracleEnterpriseSchemasTunnelMethod)
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.IsNull() {
			*tunnelMethod2 = shared.SourceOracleEnterpriseSchemasTunnelMethod(r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.ValueString())
		} else {
			tunnelMethod2 = nil
		}
		tunnelPort := new(int64)
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.IsNull() {
			*tunnelPort = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.ValueInt64()
		} else {
			tunnelPort = nil
		}
		var tunnelUser string
		tunnelUser = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelUser.ValueString()

		var additionalProperties8 interface{}
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.ValueString()), &additionalProperties8)
		}
		sourceOracleEnterpriseSSHKeyAuthentication = &shared.SourceOracleEnterpriseSSHKeyAuthentication{
			SSHKey:               sshKey,
			TunnelHost:           tunnelHost,
			TunnelMethod:         tunnelMethod2,
			TunnelPort:           tunnelPort,
			TunnelUser:           tunnelUser,
			AdditionalProperties: additionalProperties8,
		}
	}
	if sourceOracleEnterpriseSSHKeyAuthentication != nil {
		tunnelMethod = shared.SourceOracleEnterpriseSSHTunnelMethod{
			SourceOracleEnterpriseSSHKeyAuthentication: sourceOracleEnterpriseSSHKeyAuthentication,
		}
	}
	var sourceOracleEnterprisePasswordAuthentication *shared.SourceOracleEnterprisePasswordAuthentication
	if r.Configuration.TunnelMethod.PasswordAuthentication != nil {
		var tunnelHost1 string
		tunnelHost1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelHost.ValueString()

		tunnelMethod3 := new(shared.SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod)
		if !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.IsNull() {
			*tunnelMethod3 = shared.SourceOracleEnterpriseSchemasTunnelMethodTunnelMethod(r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.ValueString())
		} else {
			tunnelMethod3 = nil
		}
		tunnelPort1 := new(int64)
		if !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.IsNull() {
			*tunnelPort1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.ValueInt64()
		} else {
			tunnelPort1 = nil
		}
		var tunnelUser1 string
		tunnelUser1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelUser.ValueString()

		var tunnelUserPassword string
		tunnelUserPassword = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelUserPassword.ValueString()

		var additionalProperties9 interface{}
		if !r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.ValueString()), &additionalProperties9)
		}
		sourceOracleEnterprisePasswordAuthentication = &shared.SourceOracleEnterprisePasswordAuthentication{
			TunnelHost:           tunnelHost1,
			TunnelMethod:         tunnelMethod3,
			TunnelPort:           tunnelPort1,
			TunnelUser:           tunnelUser1,
			TunnelUserPassword:   tunnelUserPassword,
			AdditionalProperties: additionalProperties9,
		}
	}
	if sourceOracleEnterprisePasswordAuthentication != nil {
		tunnelMethod = shared.SourceOracleEnterpriseSSHTunnelMethod{
			SourceOracleEnterprisePasswordAuthentication: sourceOracleEnterprisePasswordAuthentication,
		}
	}
	var username string
	username = r.Configuration.Username.ValueString()

	configuration := shared.SourceOracleEnterprise{
		CheckPrivileges:                 checkPrivileges,
		CheckpointTargetIntervalSeconds: checkpointTargetIntervalSeconds,
		Concurrency:                     concurrency,
		ConnectionData:                  connectionData,
		Cursor:                          cursor,
		Encryption:                      encryption,
		Host:                            host,
		JdbcURLParams:                   jdbcURLParams,
		Password:                        password,
		Port:                            port,
		Schemas:                         schemas,
		TunnelMethod:                    tunnelMethod,
		Username:                        username,
	}
	secretID := new(string)
	if !r.SecretID.IsUnknown() && !r.SecretID.IsNull() {
		*secretID = r.SecretID.ValueString()
	} else {
		secretID = nil
	}
	out := shared.SourceOracleEnterpriseCreateRequest{
		Name:          name,
		DefinitionID:  definitionID,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
		SecretID:      secretID,
	}
	return &out
}

func (r *SourceOracleEnterpriseResourceModel) RefreshFromSharedSourceResponse(resp *shared.SourceResponse) {
	if resp != nil {
		r.CreatedAt = types.Int64Value(resp.CreatedAt)
		r.DefinitionID = types.StringValue(resp.DefinitionID)
		r.Name = types.StringValue(resp.Name)
		if resp.ResourceAllocation == nil {
			r.ResourceAllocation = nil
		} else {
			r.ResourceAllocation = &tfTypes.ScopedResourceRequirements{}
			if resp.ResourceAllocation.Default == nil {
				r.ResourceAllocation.Default = nil
			} else {
				r.ResourceAllocation.Default = &tfTypes.ResourceRequirements{}
				r.ResourceAllocation.Default.CPULimit = types.StringPointerValue(resp.ResourceAllocation.Default.CPULimit)
				r.ResourceAllocation.Default.CPURequest = types.StringPointerValue(resp.ResourceAllocation.Default.CPURequest)
				r.ResourceAllocation.Default.EphemeralStorageLimit = types.StringPointerValue(resp.ResourceAllocation.Default.EphemeralStorageLimit)
				r.ResourceAllocation.Default.EphemeralStorageRequest = types.StringPointerValue(resp.ResourceAllocation.Default.EphemeralStorageRequest)
				r.ResourceAllocation.Default.MemoryLimit = types.StringPointerValue(resp.ResourceAllocation.Default.MemoryLimit)
				r.ResourceAllocation.Default.MemoryRequest = types.StringPointerValue(resp.ResourceAllocation.Default.MemoryRequest)
			}
			r.ResourceAllocation.JobSpecific = []tfTypes.JobTypeResourceLimit{}
			if len(r.ResourceAllocation.JobSpecific) > len(resp.ResourceAllocation.JobSpecific) {
				r.ResourceAllocation.JobSpecific = r.ResourceAllocation.JobSpecific[:len(resp.ResourceAllocation.JobSpecific)]
			}
			for jobSpecificCount, jobSpecificItem := range resp.ResourceAllocation.JobSpecific {
				var jobSpecific1 tfTypes.JobTypeResourceLimit
				jobSpecific1.JobType = types.StringValue(string(jobSpecificItem.JobType))
				jobSpecific1.ResourceRequirements.CPULimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.CPULimit)
				jobSpecific1.ResourceRequirements.CPURequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.CPURequest)
				jobSpecific1.ResourceRequirements.EphemeralStorageLimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.EphemeralStorageLimit)
				jobSpecific1.ResourceRequirements.EphemeralStorageRequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.EphemeralStorageRequest)
				jobSpecific1.ResourceRequirements.MemoryLimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.MemoryLimit)
				jobSpecific1.ResourceRequirements.MemoryRequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.MemoryRequest)
				if jobSpecificCount+1 > len(r.ResourceAllocation.JobSpecific) {
					r.ResourceAllocation.JobSpecific = append(r.ResourceAllocation.JobSpecific, jobSpecific1)
				} else {
					r.ResourceAllocation.JobSpecific[jobSpecificCount].JobType = jobSpecific1.JobType
					r.ResourceAllocation.JobSpecific[jobSpecificCount].ResourceRequirements = jobSpecific1.ResourceRequirements
				}
			}
		}
		r.SourceID = types.StringValue(resp.SourceID)
		r.SourceType = types.StringValue(resp.SourceType)
		r.WorkspaceID = types.StringValue(resp.WorkspaceID)
	}
}

func (r *SourceOracleEnterpriseResourceModel) ToSharedSourceOracleEnterprisePutRequest() *shared.SourceOracleEnterprisePutRequest {
	var name string
	name = r.Name.ValueString()

	var workspaceID string
	workspaceID = r.WorkspaceID.ValueString()

	checkPrivileges := new(bool)
	if !r.Configuration.CheckPrivileges.IsUnknown() && !r.Configuration.CheckPrivileges.IsNull() {
		*checkPrivileges = r.Configuration.CheckPrivileges.ValueBool()
	} else {
		checkPrivileges = nil
	}
	checkpointTargetIntervalSeconds := new(int64)
	if !r.Configuration.CheckpointTargetIntervalSeconds.IsUnknown() && !r.Configuration.CheckpointTargetIntervalSeconds.IsNull() {
		*checkpointTargetIntervalSeconds = r.Configuration.CheckpointTargetIntervalSeconds.ValueInt64()
	} else {
		checkpointTargetIntervalSeconds = nil
	}
	concurrency := new(int64)
	if !r.Configuration.Concurrency.IsUnknown() && !r.Configuration.Concurrency.IsNull() {
		*concurrency = r.Configuration.Concurrency.ValueInt64()
	} else {
		concurrency = nil
	}
	var connectionData shared.SourceOracleEnterpriseUpdateConnectBy
	var sourceOracleEnterpriseUpdateServiceName *shared.SourceOracleEnterpriseUpdateServiceName
	if r.Configuration.ConnectionData.ServiceName != nil {
		connectionType := new(shared.SourceOracleEnterpriseUpdateConnectionType)
		if !r.Configuration.ConnectionData.ServiceName.ConnectionType.IsUnknown() && !r.Configuration.ConnectionData.ServiceName.ConnectionType.IsNull() {
			*connectionType = shared.SourceOracleEnterpriseUpdateConnectionType(r.Configuration.ConnectionData.ServiceName.ConnectionType.ValueString())
		} else {
			connectionType = nil
		}
		var serviceName string
		serviceName = r.Configuration.ConnectionData.ServiceName.ServiceName.ValueString()

		var additionalProperties interface{}
		if !r.Configuration.ConnectionData.ServiceName.AdditionalProperties.IsUnknown() && !r.Configuration.ConnectionData.ServiceName.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.ConnectionData.ServiceName.AdditionalProperties.ValueString()), &additionalProperties)
		}
		sourceOracleEnterpriseUpdateServiceName = &shared.SourceOracleEnterpriseUpdateServiceName{
			ConnectionType:       connectionType,
			ServiceName:          serviceName,
			AdditionalProperties: additionalProperties,
		}
	}
	if sourceOracleEnterpriseUpdateServiceName != nil {
		connectionData = shared.SourceOracleEnterpriseUpdateConnectBy{
			SourceOracleEnterpriseUpdateServiceName: sourceOracleEnterpriseUpdateServiceName,
		}
	}
	var sourceOracleEnterpriseUpdateSystemIDSID *shared.SourceOracleEnterpriseUpdateSystemIDSID
	if r.Configuration.ConnectionData.SystemIDSID != nil {
		connectionType1 := new(shared.SourceOracleEnterpriseUpdateSchemasConnectionType)
		if !r.Configuration.ConnectionData.SystemIDSID.ConnectionType.IsUnknown() && !r.Configuration.ConnectionData.SystemIDSID.ConnectionType.IsNull() {
			*connectionType1 = shared.SourceOracleEnterpriseUpdateSchemasConnectionType(r.Configuration.ConnectionData.SystemIDSID.ConnectionType.ValueString())
		} else {
			connectionType1 = nil
		}
		var sid string
		sid = r.Configuration.ConnectionData.SystemIDSID.Sid.ValueString()

		var additionalProperties1 interface{}
		if !r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.IsUnknown() && !r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.ConnectionData.SystemIDSID.AdditionalProperties.ValueString()), &additionalProperties1)
		}
		sourceOracleEnterpriseUpdateSystemIDSID = &shared.SourceOracleEnterpriseUpdateSystemIDSID{
			ConnectionType:       connectionType1,
			Sid:                  sid,
			AdditionalProperties: additionalProperties1,
		}
	}
	if sourceOracleEnterpriseUpdateSystemIDSID != nil {
		connectionData = shared.SourceOracleEnterpriseUpdateConnectBy{
			SourceOracleEnterpriseUpdateSystemIDSID: sourceOracleEnterpriseUpdateSystemIDSID,
		}
	}
	var cursor shared.SourceOracleEnterpriseUpdateUpdateMethod
	var sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor *shared.SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor
	if r.Configuration.Cursor.ScanChangesWithUserDefinedCursor != nil {
		cursorMethod := new(shared.SourceOracleEnterpriseUpdateCursorMethod)
		if !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.IsUnknown() && !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.IsNull() {
			*cursorMethod = shared.SourceOracleEnterpriseUpdateCursorMethod(r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.CursorMethod.ValueString())
		} else {
			cursorMethod = nil
		}
		var additionalProperties2 interface{}
		if !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.IsUnknown() && !r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Cursor.ScanChangesWithUserDefinedCursor.AdditionalProperties.ValueString()), &additionalProperties2)
		}
		sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor = &shared.SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor{
			CursorMethod:         cursorMethod,
			AdditionalProperties: additionalProperties2,
		}
	}
	if sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor != nil {
		cursor = shared.SourceOracleEnterpriseUpdateUpdateMethod{
			SourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor: sourceOracleEnterpriseUpdateScanChangesWithUserDefinedCursor,
		}
	}
	var sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC *shared.SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC
	if r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC != nil {
		cursorMethod1 := new(shared.SourceOracleEnterpriseUpdateSchemasCursorMethod)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.IsNull() {
			*cursorMethod1 = shared.SourceOracleEnterpriseUpdateSchemasCursorMethod(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.CursorMethod.ValueString())
		} else {
			cursorMethod1 = nil
		}
		debeziumShutdownTimeoutSeconds := new(int64)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.IsNull() {
			*debeziumShutdownTimeoutSeconds = r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.DebeziumShutdownTimeoutSeconds.ValueInt64()
		} else {
			debeziumShutdownTimeoutSeconds = nil
		}
		initialLoadTimeoutHours := new(int64)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.IsNull() {
			*initialLoadTimeoutHours = r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InitialLoadTimeoutHours.ValueInt64()
		} else {
			initialLoadTimeoutHours = nil
		}
		invalidCdcCursorPositionBehavior := new(shared.SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced)
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.IsNull() {
			*invalidCdcCursorPositionBehavior = shared.SourceOracleEnterpriseUpdateInvalidCDCPositionBehaviorAdvanced(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.InvalidCdcCursorPositionBehavior.ValueString())
		} else {
			invalidCdcCursorPositionBehavior = nil
		}
		var additionalProperties3 interface{}
		if !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.IsUnknown() && !r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Cursor.ReadChangesUsingChangeDataCaptureCDC.AdditionalProperties.ValueString()), &additionalProperties3)
		}
		sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC = &shared.SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC{
			CursorMethod:                     cursorMethod1,
			DebeziumShutdownTimeoutSeconds:   debeziumShutdownTimeoutSeconds,
			InitialLoadTimeoutHours:          initialLoadTimeoutHours,
			InvalidCdcCursorPositionBehavior: invalidCdcCursorPositionBehavior,
			AdditionalProperties:             additionalProperties3,
		}
	}
	if sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC != nil {
		cursor = shared.SourceOracleEnterpriseUpdateUpdateMethod{
			SourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC: sourceOracleEnterpriseUpdateReadChangesUsingChangeDataCaptureCDC,
		}
	}
	var encryption shared.SourceOracleEnterpriseUpdateEncryption
	var sourceOracleEnterpriseUpdateUnencrypted *shared.SourceOracleEnterpriseUpdateUnencrypted
	if r.Configuration.Encryption.Unencrypted != nil {
		encryptionMethod := new(shared.SourceOracleEnterpriseUpdateEncryptionMethod)
		if !r.Configuration.Encryption.Unencrypted.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.Unencrypted.EncryptionMethod.IsNull() {
			*encryptionMethod = shared.SourceOracleEnterpriseUpdateEncryptionMethod(r.Configuration.Encryption.Unencrypted.EncryptionMethod.ValueString())
		} else {
			encryptionMethod = nil
		}
		var additionalProperties4 interface{}
		if !r.Configuration.Encryption.Unencrypted.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.Unencrypted.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.Unencrypted.AdditionalProperties.ValueString()), &additionalProperties4)
		}
		sourceOracleEnterpriseUpdateUnencrypted = &shared.SourceOracleEnterpriseUpdateUnencrypted{
			EncryptionMethod:     encryptionMethod,
			AdditionalProperties: additionalProperties4,
		}
	}
	if sourceOracleEnterpriseUpdateUnencrypted != nil {
		encryption = shared.SourceOracleEnterpriseUpdateEncryption{
			SourceOracleEnterpriseUpdateUnencrypted: sourceOracleEnterpriseUpdateUnencrypted,
		}
	}
	var sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE *shared.SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE
	if r.Configuration.Encryption.NativeNetworkEncryptionNNE != nil {
		encryptionAlgorithm := new(shared.SourceOracleEnterpriseUpdateEncryptionAlgorithm)
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.IsNull() {
			*encryptionAlgorithm = shared.SourceOracleEnterpriseUpdateEncryptionAlgorithm(r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionAlgorithm.ValueString())
		} else {
			encryptionAlgorithm = nil
		}
		encryptionMethod1 := new(shared.SourceOracleEnterpriseUpdateSchemasEncryptionMethod)
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.IsNull() {
			*encryptionMethod1 = shared.SourceOracleEnterpriseUpdateSchemasEncryptionMethod(r.Configuration.Encryption.NativeNetworkEncryptionNNE.EncryptionMethod.ValueString())
		} else {
			encryptionMethod1 = nil
		}
		var additionalProperties5 interface{}
		if !r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.NativeNetworkEncryptionNNE.AdditionalProperties.ValueString()), &additionalProperties5)
		}
		sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE = &shared.SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE{
			EncryptionAlgorithm:  encryptionAlgorithm,
			EncryptionMethod:     encryptionMethod1,
			AdditionalProperties: additionalProperties5,
		}
	}
	if sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE != nil {
		encryption = shared.SourceOracleEnterpriseUpdateEncryption{
			SourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE: sourceOracleEnterpriseUpdateNativeNetworkEncryptionNNE,
		}
	}
	var sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate *shared.SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate
	if r.Configuration.Encryption.TLSEncryptedVerifyCertificate != nil {
		encryptionMethod2 := new(shared.SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod)
		if !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.IsUnknown() && !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.IsNull() {
			*encryptionMethod2 = shared.SourceOracleEnterpriseUpdateSchemasEncryptionEncryptionMethod(r.Configuration.Encryption.TLSEncryptedVerifyCertificate.EncryptionMethod.ValueString())
		} else {
			encryptionMethod2 = nil
		}
		var sslCertificate string
		sslCertificate = r.Configuration.Encryption.TLSEncryptedVerifyCertificate.SslCertificate.ValueString()

		var additionalProperties6 interface{}
		if !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.IsUnknown() && !r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.Encryption.TLSEncryptedVerifyCertificate.AdditionalProperties.ValueString()), &additionalProperties6)
		}
		sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate = &shared.SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate{
			EncryptionMethod:     encryptionMethod2,
			SslCertificate:       sslCertificate,
			AdditionalProperties: additionalProperties6,
		}
	}
	if sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate != nil {
		encryption = shared.SourceOracleEnterpriseUpdateEncryption{
			SourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate: sourceOracleEnterpriseUpdateTLSEncryptedVerifyCertificate,
		}
	}
	var host string
	host = r.Configuration.Host.ValueString()

	jdbcURLParams := new(string)
	if !r.Configuration.JdbcURLParams.IsUnknown() && !r.Configuration.JdbcURLParams.IsNull() {
		*jdbcURLParams = r.Configuration.JdbcURLParams.ValueString()
	} else {
		jdbcURLParams = nil
	}
	password := new(string)
	if !r.Configuration.Password.IsUnknown() && !r.Configuration.Password.IsNull() {
		*password = r.Configuration.Password.ValueString()
	} else {
		password = nil
	}
	port := new(int64)
	if !r.Configuration.Port.IsUnknown() && !r.Configuration.Port.IsNull() {
		*port = r.Configuration.Port.ValueInt64()
	} else {
		port = nil
	}
	var schemas []string = []string{}
	for _, schemasItem := range r.Configuration.Schemas {
		schemas = append(schemas, schemasItem.ValueString())
	}
	var tunnelMethod shared.SourceOracleEnterpriseUpdateSSHTunnelMethod
	var sourceOracleEnterpriseUpdateNoTunnel *shared.SourceOracleEnterpriseUpdateNoTunnel
	if r.Configuration.TunnelMethod.NoTunnel != nil {
		tunnelMethod1 := new(shared.SourceOracleEnterpriseUpdateTunnelMethod)
		if !r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.IsNull() {
			*tunnelMethod1 = shared.SourceOracleEnterpriseUpdateTunnelMethod(r.Configuration.TunnelMethod.NoTunnel.TunnelMethod.ValueString())
		} else {
			tunnelMethod1 = nil
		}
		var additionalProperties7 interface{}
		if !r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.NoTunnel.AdditionalProperties.ValueString()), &additionalProperties7)
		}
		sourceOracleEnterpriseUpdateNoTunnel = &shared.SourceOracleEnterpriseUpdateNoTunnel{
			TunnelMethod:         tunnelMethod1,
			AdditionalProperties: additionalProperties7,
		}
	}
	if sourceOracleEnterpriseUpdateNoTunnel != nil {
		tunnelMethod = shared.SourceOracleEnterpriseUpdateSSHTunnelMethod{
			SourceOracleEnterpriseUpdateNoTunnel: sourceOracleEnterpriseUpdateNoTunnel,
		}
	}
	var sourceOracleEnterpriseUpdateSSHKeyAuthentication *shared.SourceOracleEnterpriseUpdateSSHKeyAuthentication
	if r.Configuration.TunnelMethod.SSHKeyAuthentication != nil {
		var sshKey string
		sshKey = r.Configuration.TunnelMethod.SSHKeyAuthentication.SSHKey.ValueString()

		var tunnelHost string
		tunnelHost = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelHost.ValueString()

		tunnelMethod2 := new(shared.SourceOracleEnterpriseUpdateSchemasTunnelMethod)
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.IsNull() {
			*tunnelMethod2 = shared.SourceOracleEnterpriseUpdateSchemasTunnelMethod(r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelMethod.ValueString())
		} else {
			tunnelMethod2 = nil
		}
		tunnelPort := new(int64)
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.IsNull() {
			*tunnelPort = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelPort.ValueInt64()
		} else {
			tunnelPort = nil
		}
		var tunnelUser string
		tunnelUser = r.Configuration.TunnelMethod.SSHKeyAuthentication.TunnelUser.ValueString()

		var additionalProperties8 interface{}
		if !r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.SSHKeyAuthentication.AdditionalProperties.ValueString()), &additionalProperties8)
		}
		sourceOracleEnterpriseUpdateSSHKeyAuthentication = &shared.SourceOracleEnterpriseUpdateSSHKeyAuthentication{
			SSHKey:               sshKey,
			TunnelHost:           tunnelHost,
			TunnelMethod:         tunnelMethod2,
			TunnelPort:           tunnelPort,
			TunnelUser:           tunnelUser,
			AdditionalProperties: additionalProperties8,
		}
	}
	if sourceOracleEnterpriseUpdateSSHKeyAuthentication != nil {
		tunnelMethod = shared.SourceOracleEnterpriseUpdateSSHTunnelMethod{
			SourceOracleEnterpriseUpdateSSHKeyAuthentication: sourceOracleEnterpriseUpdateSSHKeyAuthentication,
		}
	}
	var sourceOracleEnterpriseUpdatePasswordAuthentication *shared.SourceOracleEnterpriseUpdatePasswordAuthentication
	if r.Configuration.TunnelMethod.PasswordAuthentication != nil {
		var tunnelHost1 string
		tunnelHost1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelHost.ValueString()

		tunnelMethod3 := new(shared.SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod)
		if !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.IsNull() {
			*tunnelMethod3 = shared.SourceOracleEnterpriseUpdateSchemasTunnelMethodTunnelMethod(r.Configuration.TunnelMethod.PasswordAuthentication.TunnelMethod.ValueString())
		} else {
			tunnelMethod3 = nil
		}
		tunnelPort1 := new(int64)
		if !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.IsNull() {
			*tunnelPort1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelPort.ValueInt64()
		} else {
			tunnelPort1 = nil
		}
		var tunnelUser1 string
		tunnelUser1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelUser.ValueString()

		var tunnelUserPassword string
		tunnelUserPassword = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelUserPassword.ValueString()

		var additionalProperties9 interface{}
		if !r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.IsUnknown() && !r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.IsNull() {
			_ = json.Unmarshal([]byte(r.Configuration.TunnelMethod.PasswordAuthentication.AdditionalProperties.ValueString()), &additionalProperties9)
		}
		sourceOracleEnterpriseUpdatePasswordAuthentication = &shared.SourceOracleEnterpriseUpdatePasswordAuthentication{
			TunnelHost:           tunnelHost1,
			TunnelMethod:         tunnelMethod3,
			TunnelPort:           tunnelPort1,
			TunnelUser:           tunnelUser1,
			TunnelUserPassword:   tunnelUserPassword,
			AdditionalProperties: additionalProperties9,
		}
	}
	if sourceOracleEnterpriseUpdatePasswordAuthentication != nil {
		tunnelMethod = shared.SourceOracleEnterpriseUpdateSSHTunnelMethod{
			SourceOracleEnterpriseUpdatePasswordAuthentication: sourceOracleEnterpriseUpdatePasswordAuthentication,
		}
	}
	var username string
	username = r.Configuration.Username.ValueString()

	configuration := shared.SourceOracleEnterpriseUpdate{
		CheckPrivileges:                 checkPrivileges,
		CheckpointTargetIntervalSeconds: checkpointTargetIntervalSeconds,
		Concurrency:                     concurrency,
		ConnectionData:                  connectionData,
		Cursor:                          cursor,
		Encryption:                      encryption,
		Host:                            host,
		JdbcURLParams:                   jdbcURLParams,
		Password:                        password,
		Port:                            port,
		Schemas:                         schemas,
		TunnelMethod:                    tunnelMethod,
		Username:                        username,
	}
	out := shared.SourceOracleEnterprisePutRequest{
		Name:          name,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
	}
	return &out
}
