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

package shared

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

type ConnectionCreateRequest struct {
	// Optional name of the connection
	Name          *string `json:"name,omitempty"`
	SourceID      string  `json:"sourceId"`
	DestinationID string  `json:"destinationId"`
	// A list of configured stream options for a connection.
	Configurations *StreamConfigurations `json:"configurations,omitempty"`
	// schedule for when the the connection should run, per the schedule type
	Schedule *AirbyteAPIConnectionSchedule `json:"schedule,omitempty"`
	// Deprecated: We no longer support modifying dataResidency on Community and Enterprise connections. All connections will use the dataResidency of their associated workspace..
	DataResidency *string `json:"dataResidency,omitempty"`
	// Define the location where the data will be stored in the destination
	NamespaceDefinition *NamespaceDefinitionEnum `default:"destination" json:"namespaceDefinition"`
	// Used when namespaceDefinition is 'custom_format'. If blank then behaves like namespaceDefinition = 'destination'. If "${SOURCE_NAMESPACE}" then behaves like namespaceDefinition = 'source'.
	NamespaceFormat *string `default:"null" json:"namespaceFormat"`
	// Prefix that will be prepended to the name of each stream when it is written to the destination (ex. “airbyte_” causes “projects” => “airbyte_projects”).
	Prefix *string `default:"" json:"prefix"`
	// Set how Airbyte handles syncs when it detects a non-breaking schema change in the source
	NonBreakingSchemaUpdatesBehavior *NonBreakingSchemaUpdatesBehaviorEnum `default:"ignore" json:"nonBreakingSchemaUpdatesBehavior"`
	Status                           *ConnectionStatusEnum                 `json:"status,omitempty"`
	Tags                             []Tag                                 `json:"tags,omitempty"`
}

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

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

func (o *ConnectionCreateRequest) GetName() *string {
	if o == nil {
		return nil
	}
	return o.Name
}

func (o *ConnectionCreateRequest) GetSourceID() string {
	if o == nil {
		return ""
	}
	return o.SourceID
}

func (o *ConnectionCreateRequest) GetDestinationID() string {
	if o == nil {
		return ""
	}
	return o.DestinationID
}

func (o *ConnectionCreateRequest) GetConfigurations() *StreamConfigurations {
	if o == nil {
		return nil
	}
	return o.Configurations
}

func (o *ConnectionCreateRequest) GetSchedule() *AirbyteAPIConnectionSchedule {
	if o == nil {
		return nil
	}
	return o.Schedule
}

func (o *ConnectionCreateRequest) GetDataResidency() *string {
	if o == nil {
		return nil
	}
	return o.DataResidency
}

func (o *ConnectionCreateRequest) GetNamespaceDefinition() *NamespaceDefinitionEnum {
	if o == nil {
		return nil
	}
	return o.NamespaceDefinition
}

func (o *ConnectionCreateRequest) GetNamespaceFormat() *string {
	if o == nil {
		return nil
	}
	return o.NamespaceFormat
}

func (o *ConnectionCreateRequest) GetPrefix() *string {
	if o == nil {
		return nil
	}
	return o.Prefix
}

func (o *ConnectionCreateRequest) GetNonBreakingSchemaUpdatesBehavior() *NonBreakingSchemaUpdatesBehaviorEnum {
	if o == nil {
		return nil
	}
	return o.NonBreakingSchemaUpdatesBehavior
}

func (o *ConnectionCreateRequest) GetStatus() *ConnectionStatusEnum {
	if o == nil {
		return nil
	}
	return o.Status
}

func (o *ConnectionCreateRequest) GetTags() []Tag {
	if o == nil {
		return nil
	}
	return o.Tags
}
