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

package provider

import (
	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 *DestinationYellowbrickResourceModel) ToSharedDestinationYellowbrickCreateRequest() *shared.DestinationYellowbrickCreateRequest {
	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()

	var database string
	database = r.Configuration.Database.ValueString()

	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
	}
	schema := new(string)
	if !r.Configuration.Schema.IsUnknown() && !r.Configuration.Schema.IsNull() {
		*schema = r.Configuration.Schema.ValueString()
	} else {
		schema = nil
	}
	ssl := new(bool)
	if !r.Configuration.Ssl.IsUnknown() && !r.Configuration.Ssl.IsNull() {
		*ssl = r.Configuration.Ssl.ValueBool()
	} else {
		ssl = nil
	}
	var sslMode *shared.DestinationYellowbrickSSLModes
	if r.Configuration.SslMode != nil {
		var destinationYellowbrickDisable *shared.DestinationYellowbrickDisable
		if r.Configuration.SslMode.Disable != nil {
			destinationYellowbrickDisable = &shared.DestinationYellowbrickDisable{}
		}
		if destinationYellowbrickDisable != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickDisable: destinationYellowbrickDisable,
			}
		}
		var destinationYellowbrickAllow *shared.DestinationYellowbrickAllow
		if r.Configuration.SslMode.Allow != nil {
			destinationYellowbrickAllow = &shared.DestinationYellowbrickAllow{}
		}
		if destinationYellowbrickAllow != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickAllow: destinationYellowbrickAllow,
			}
		}
		var destinationYellowbrickPrefer *shared.DestinationYellowbrickPrefer
		if r.Configuration.SslMode.Prefer != nil {
			destinationYellowbrickPrefer = &shared.DestinationYellowbrickPrefer{}
		}
		if destinationYellowbrickPrefer != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickPrefer: destinationYellowbrickPrefer,
			}
		}
		var destinationYellowbrickRequire *shared.DestinationYellowbrickRequire
		if r.Configuration.SslMode.Require != nil {
			destinationYellowbrickRequire = &shared.DestinationYellowbrickRequire{}
		}
		if destinationYellowbrickRequire != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickRequire: destinationYellowbrickRequire,
			}
		}
		var destinationYellowbrickVerifyCa *shared.DestinationYellowbrickVerifyCa
		if r.Configuration.SslMode.VerifyCa != nil {
			var caCertificate string
			caCertificate = r.Configuration.SslMode.VerifyCa.CaCertificate.ValueString()

			clientKeyPassword := new(string)
			if !r.Configuration.SslMode.VerifyCa.ClientKeyPassword.IsUnknown() && !r.Configuration.SslMode.VerifyCa.ClientKeyPassword.IsNull() {
				*clientKeyPassword = r.Configuration.SslMode.VerifyCa.ClientKeyPassword.ValueString()
			} else {
				clientKeyPassword = nil
			}
			destinationYellowbrickVerifyCa = &shared.DestinationYellowbrickVerifyCa{
				CaCertificate:     caCertificate,
				ClientKeyPassword: clientKeyPassword,
			}
		}
		if destinationYellowbrickVerifyCa != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickVerifyCa: destinationYellowbrickVerifyCa,
			}
		}
		var destinationYellowbrickVerifyFull *shared.DestinationYellowbrickVerifyFull
		if r.Configuration.SslMode.VerifyFull != nil {
			var caCertificate1 string
			caCertificate1 = r.Configuration.SslMode.VerifyFull.CaCertificate.ValueString()

			var clientCertificate string
			clientCertificate = r.Configuration.SslMode.VerifyFull.ClientCertificate.ValueString()

			var clientKey string
			clientKey = r.Configuration.SslMode.VerifyFull.ClientKey.ValueString()

			clientKeyPassword1 := new(string)
			if !r.Configuration.SslMode.VerifyFull.ClientKeyPassword.IsUnknown() && !r.Configuration.SslMode.VerifyFull.ClientKeyPassword.IsNull() {
				*clientKeyPassword1 = r.Configuration.SslMode.VerifyFull.ClientKeyPassword.ValueString()
			} else {
				clientKeyPassword1 = nil
			}
			destinationYellowbrickVerifyFull = &shared.DestinationYellowbrickVerifyFull{
				CaCertificate:     caCertificate1,
				ClientCertificate: clientCertificate,
				ClientKey:         clientKey,
				ClientKeyPassword: clientKeyPassword1,
			}
		}
		if destinationYellowbrickVerifyFull != nil {
			sslMode = &shared.DestinationYellowbrickSSLModes{
				DestinationYellowbrickVerifyFull: destinationYellowbrickVerifyFull,
			}
		}
	}
	var tunnelMethod *shared.DestinationYellowbrickSSHTunnelMethod
	if r.Configuration.TunnelMethod != nil {
		var destinationYellowbrickNoTunnel *shared.DestinationYellowbrickNoTunnel
		if r.Configuration.TunnelMethod.NoTunnel != nil {
			destinationYellowbrickNoTunnel = &shared.DestinationYellowbrickNoTunnel{}
		}
		if destinationYellowbrickNoTunnel != nil {
			tunnelMethod = &shared.DestinationYellowbrickSSHTunnelMethod{
				DestinationYellowbrickNoTunnel: destinationYellowbrickNoTunnel,
			}
		}
		var destinationYellowbrickSSHKeyAuthentication *shared.DestinationYellowbrickSSHKeyAuthentication
		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()

			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()

			destinationYellowbrickSSHKeyAuthentication = &shared.DestinationYellowbrickSSHKeyAuthentication{
				SSHKey:     sshKey,
				TunnelHost: tunnelHost,
				TunnelPort: tunnelPort,
				TunnelUser: tunnelUser,
			}
		}
		if destinationYellowbrickSSHKeyAuthentication != nil {
			tunnelMethod = &shared.DestinationYellowbrickSSHTunnelMethod{
				DestinationYellowbrickSSHKeyAuthentication: destinationYellowbrickSSHKeyAuthentication,
			}
		}
		var destinationYellowbrickPasswordAuthentication *shared.DestinationYellowbrickPasswordAuthentication
		if r.Configuration.TunnelMethod.PasswordAuthentication != nil {
			var tunnelHost1 string
			tunnelHost1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelHost.ValueString()

			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()

			destinationYellowbrickPasswordAuthentication = &shared.DestinationYellowbrickPasswordAuthentication{
				TunnelHost:         tunnelHost1,
				TunnelPort:         tunnelPort1,
				TunnelUser:         tunnelUser1,
				TunnelUserPassword: tunnelUserPassword,
			}
		}
		if destinationYellowbrickPasswordAuthentication != nil {
			tunnelMethod = &shared.DestinationYellowbrickSSHTunnelMethod{
				DestinationYellowbrickPasswordAuthentication: destinationYellowbrickPasswordAuthentication,
			}
		}
	}
	var username string
	username = r.Configuration.Username.ValueString()

	configuration := shared.DestinationYellowbrick{
		Database:      database,
		Host:          host,
		JdbcURLParams: jdbcURLParams,
		Password:      password,
		Port:          port,
		Schema:        schema,
		Ssl:           ssl,
		SslMode:       sslMode,
		TunnelMethod:  tunnelMethod,
		Username:      username,
	}
	out := shared.DestinationYellowbrickCreateRequest{
		Name:          name,
		DefinitionID:  definitionID,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
	}
	return &out
}

func (r *DestinationYellowbrickResourceModel) RefreshFromSharedDestinationResponse(resp *shared.DestinationResponse) {
	if resp != nil {
		r.CreatedAt = types.Int64Value(resp.CreatedAt)
		r.DefinitionID = types.StringValue(resp.DefinitionID)
		r.DestinationID = types.StringValue(resp.DestinationID)
		r.DestinationType = types.StringValue(resp.DestinationType)
		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.WorkspaceID = types.StringValue(resp.WorkspaceID)
	}
}

func (r *DestinationYellowbrickResourceModel) ToSharedDestinationYellowbrickPutRequest() *shared.DestinationYellowbrickPutRequest {
	var name string
	name = r.Name.ValueString()

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

	var database string
	database = r.Configuration.Database.ValueString()

	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
	}
	schema := new(string)
	if !r.Configuration.Schema.IsUnknown() && !r.Configuration.Schema.IsNull() {
		*schema = r.Configuration.Schema.ValueString()
	} else {
		schema = nil
	}
	ssl := new(bool)
	if !r.Configuration.Ssl.IsUnknown() && !r.Configuration.Ssl.IsNull() {
		*ssl = r.Configuration.Ssl.ValueBool()
	} else {
		ssl = nil
	}
	var sslMode *shared.DestinationYellowbrickUpdateSSLModes
	if r.Configuration.SslMode != nil {
		var destinationYellowbrickUpdateDisable *shared.DestinationYellowbrickUpdateDisable
		if r.Configuration.SslMode.Disable != nil {
			destinationYellowbrickUpdateDisable = &shared.DestinationYellowbrickUpdateDisable{}
		}
		if destinationYellowbrickUpdateDisable != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdateDisable: destinationYellowbrickUpdateDisable,
			}
		}
		var destinationYellowbrickUpdateAllow *shared.DestinationYellowbrickUpdateAllow
		if r.Configuration.SslMode.Allow != nil {
			destinationYellowbrickUpdateAllow = &shared.DestinationYellowbrickUpdateAllow{}
		}
		if destinationYellowbrickUpdateAllow != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdateAllow: destinationYellowbrickUpdateAllow,
			}
		}
		var destinationYellowbrickUpdatePrefer *shared.DestinationYellowbrickUpdatePrefer
		if r.Configuration.SslMode.Prefer != nil {
			destinationYellowbrickUpdatePrefer = &shared.DestinationYellowbrickUpdatePrefer{}
		}
		if destinationYellowbrickUpdatePrefer != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdatePrefer: destinationYellowbrickUpdatePrefer,
			}
		}
		var destinationYellowbrickUpdateRequire *shared.DestinationYellowbrickUpdateRequire
		if r.Configuration.SslMode.Require != nil {
			destinationYellowbrickUpdateRequire = &shared.DestinationYellowbrickUpdateRequire{}
		}
		if destinationYellowbrickUpdateRequire != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdateRequire: destinationYellowbrickUpdateRequire,
			}
		}
		var destinationYellowbrickUpdateVerifyCa *shared.DestinationYellowbrickUpdateVerifyCa
		if r.Configuration.SslMode.VerifyCa != nil {
			var caCertificate string
			caCertificate = r.Configuration.SslMode.VerifyCa.CaCertificate.ValueString()

			clientKeyPassword := new(string)
			if !r.Configuration.SslMode.VerifyCa.ClientKeyPassword.IsUnknown() && !r.Configuration.SslMode.VerifyCa.ClientKeyPassword.IsNull() {
				*clientKeyPassword = r.Configuration.SslMode.VerifyCa.ClientKeyPassword.ValueString()
			} else {
				clientKeyPassword = nil
			}
			destinationYellowbrickUpdateVerifyCa = &shared.DestinationYellowbrickUpdateVerifyCa{
				CaCertificate:     caCertificate,
				ClientKeyPassword: clientKeyPassword,
			}
		}
		if destinationYellowbrickUpdateVerifyCa != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdateVerifyCa: destinationYellowbrickUpdateVerifyCa,
			}
		}
		var destinationYellowbrickUpdateVerifyFull *shared.DestinationYellowbrickUpdateVerifyFull
		if r.Configuration.SslMode.VerifyFull != nil {
			var caCertificate1 string
			caCertificate1 = r.Configuration.SslMode.VerifyFull.CaCertificate.ValueString()

			var clientCertificate string
			clientCertificate = r.Configuration.SslMode.VerifyFull.ClientCertificate.ValueString()

			var clientKey string
			clientKey = r.Configuration.SslMode.VerifyFull.ClientKey.ValueString()

			clientKeyPassword1 := new(string)
			if !r.Configuration.SslMode.VerifyFull.ClientKeyPassword.IsUnknown() && !r.Configuration.SslMode.VerifyFull.ClientKeyPassword.IsNull() {
				*clientKeyPassword1 = r.Configuration.SslMode.VerifyFull.ClientKeyPassword.ValueString()
			} else {
				clientKeyPassword1 = nil
			}
			destinationYellowbrickUpdateVerifyFull = &shared.DestinationYellowbrickUpdateVerifyFull{
				CaCertificate:     caCertificate1,
				ClientCertificate: clientCertificate,
				ClientKey:         clientKey,
				ClientKeyPassword: clientKeyPassword1,
			}
		}
		if destinationYellowbrickUpdateVerifyFull != nil {
			sslMode = &shared.DestinationYellowbrickUpdateSSLModes{
				DestinationYellowbrickUpdateVerifyFull: destinationYellowbrickUpdateVerifyFull,
			}
		}
	}
	var tunnelMethod *shared.DestinationYellowbrickUpdateSSHTunnelMethod
	if r.Configuration.TunnelMethod != nil {
		var destinationYellowbrickUpdateNoTunnel *shared.DestinationYellowbrickUpdateNoTunnel
		if r.Configuration.TunnelMethod.NoTunnel != nil {
			destinationYellowbrickUpdateNoTunnel = &shared.DestinationYellowbrickUpdateNoTunnel{}
		}
		if destinationYellowbrickUpdateNoTunnel != nil {
			tunnelMethod = &shared.DestinationYellowbrickUpdateSSHTunnelMethod{
				DestinationYellowbrickUpdateNoTunnel: destinationYellowbrickUpdateNoTunnel,
			}
		}
		var destinationYellowbrickUpdateSSHKeyAuthentication *shared.DestinationYellowbrickUpdateSSHKeyAuthentication
		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()

			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()

			destinationYellowbrickUpdateSSHKeyAuthentication = &shared.DestinationYellowbrickUpdateSSHKeyAuthentication{
				SSHKey:     sshKey,
				TunnelHost: tunnelHost,
				TunnelPort: tunnelPort,
				TunnelUser: tunnelUser,
			}
		}
		if destinationYellowbrickUpdateSSHKeyAuthentication != nil {
			tunnelMethod = &shared.DestinationYellowbrickUpdateSSHTunnelMethod{
				DestinationYellowbrickUpdateSSHKeyAuthentication: destinationYellowbrickUpdateSSHKeyAuthentication,
			}
		}
		var destinationYellowbrickUpdatePasswordAuthentication *shared.DestinationYellowbrickUpdatePasswordAuthentication
		if r.Configuration.TunnelMethod.PasswordAuthentication != nil {
			var tunnelHost1 string
			tunnelHost1 = r.Configuration.TunnelMethod.PasswordAuthentication.TunnelHost.ValueString()

			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()

			destinationYellowbrickUpdatePasswordAuthentication = &shared.DestinationYellowbrickUpdatePasswordAuthentication{
				TunnelHost:         tunnelHost1,
				TunnelPort:         tunnelPort1,
				TunnelUser:         tunnelUser1,
				TunnelUserPassword: tunnelUserPassword,
			}
		}
		if destinationYellowbrickUpdatePasswordAuthentication != nil {
			tunnelMethod = &shared.DestinationYellowbrickUpdateSSHTunnelMethod{
				DestinationYellowbrickUpdatePasswordAuthentication: destinationYellowbrickUpdatePasswordAuthentication,
			}
		}
	}
	var username string
	username = r.Configuration.Username.ValueString()

	configuration := shared.DestinationYellowbrickUpdate{
		Database:      database,
		Host:          host,
		JdbcURLParams: jdbcURLParams,
		Password:      password,
		Port:          port,
		Schema:        schema,
		Ssl:           ssl,
		SslMode:       sslMode,
		TunnelMethod:  tunnelMethod,
		Username:      username,
	}
	out := shared.DestinationYellowbrickPutRequest{
		Name:          name,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
	}
	return &out
}
