// 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"
	"time"
)

type SourceS3UpdateSchemasDeliveryType string

const (
	SourceS3UpdateSchemasDeliveryTypeUseFileTransfer SourceS3UpdateSchemasDeliveryType = "use_file_transfer"
)

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

// SourceS3UpdateCopyRawFiles - Copy raw files without parsing their contents. Bits are copied into the destination exactly as they appeared in the source. Recommended for use with unstructured text data, non-text and compressed files.
type SourceS3UpdateCopyRawFiles struct {
	deliveryType *SourceS3UpdateSchemasDeliveryType `const:"use_file_transfer" json:"delivery_type"`
	// If enabled, sends subdirectory folder structure along with source file names to the destination. Otherwise, files will be synced by their names only. This option is ignored when file-based replication is not enabled.
	PreserveDirectoryStructure *bool `default:"true" json:"preserve_directory_structure"`
}

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

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

func (o *SourceS3UpdateCopyRawFiles) GetDeliveryType() *SourceS3UpdateSchemasDeliveryType {
	return SourceS3UpdateSchemasDeliveryTypeUseFileTransfer.ToPointer()
}

func (o *SourceS3UpdateCopyRawFiles) GetPreserveDirectoryStructure() *bool {
	if o == nil {
		return nil
	}
	return o.PreserveDirectoryStructure
}

type SourceS3UpdateDeliveryType string

const (
	SourceS3UpdateDeliveryTypeUseRecordsTransfer SourceS3UpdateDeliveryType = "use_records_transfer"
)

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

// SourceS3UpdateReplicateRecords - Recommended - Extract and load structured records into your destination of choice. This is the classic method of moving data in Airbyte. It allows for blocking and hashing individual fields or files from a structured schema. Data can be flattened, typed and deduped depending on the destination.
type SourceS3UpdateReplicateRecords struct {
	deliveryType *SourceS3UpdateDeliveryType `const:"use_records_transfer" json:"delivery_type"`
}

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

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

func (o *SourceS3UpdateReplicateRecords) GetDeliveryType() *SourceS3UpdateDeliveryType {
	return SourceS3UpdateDeliveryTypeUseRecordsTransfer.ToPointer()
}

type SourceS3UpdateDeliveryMethodType string

const (
	SourceS3UpdateDeliveryMethodTypeSourceS3UpdateReplicateRecords SourceS3UpdateDeliveryMethodType = "source-s3-update_Replicate Records"
	SourceS3UpdateDeliveryMethodTypeSourceS3UpdateCopyRawFiles     SourceS3UpdateDeliveryMethodType = "source-s3-update_Copy Raw Files"
)

type SourceS3UpdateDeliveryMethod struct {
	SourceS3UpdateReplicateRecords *SourceS3UpdateReplicateRecords `queryParam:"inline"`
	SourceS3UpdateCopyRawFiles     *SourceS3UpdateCopyRawFiles     `queryParam:"inline"`

	Type SourceS3UpdateDeliveryMethodType
}

func CreateSourceS3UpdateDeliveryMethodSourceS3UpdateReplicateRecords(sourceS3UpdateReplicateRecords SourceS3UpdateReplicateRecords) SourceS3UpdateDeliveryMethod {
	typ := SourceS3UpdateDeliveryMethodTypeSourceS3UpdateReplicateRecords

	return SourceS3UpdateDeliveryMethod{
		SourceS3UpdateReplicateRecords: &sourceS3UpdateReplicateRecords,
		Type:                           typ,
	}
}

func CreateSourceS3UpdateDeliveryMethodSourceS3UpdateCopyRawFiles(sourceS3UpdateCopyRawFiles SourceS3UpdateCopyRawFiles) SourceS3UpdateDeliveryMethod {
	typ := SourceS3UpdateDeliveryMethodTypeSourceS3UpdateCopyRawFiles

	return SourceS3UpdateDeliveryMethod{
		SourceS3UpdateCopyRawFiles: &sourceS3UpdateCopyRawFiles,
		Type:                       typ,
	}
}

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

	var sourceS3UpdateReplicateRecords SourceS3UpdateReplicateRecords = SourceS3UpdateReplicateRecords{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateReplicateRecords, "", true, true); err == nil {
		u.SourceS3UpdateReplicateRecords = &sourceS3UpdateReplicateRecords
		u.Type = SourceS3UpdateDeliveryMethodTypeSourceS3UpdateReplicateRecords
		return nil
	}

	var sourceS3UpdateCopyRawFiles SourceS3UpdateCopyRawFiles = SourceS3UpdateCopyRawFiles{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateCopyRawFiles, "", true, true); err == nil {
		u.SourceS3UpdateCopyRawFiles = &sourceS3UpdateCopyRawFiles
		u.Type = SourceS3UpdateDeliveryMethodTypeSourceS3UpdateCopyRawFiles
		return nil
	}

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

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

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

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

type SourceS3UpdateSchemasStreamsFormatFormat6Filetype string

const (
	SourceS3UpdateSchemasStreamsFormatFormat6FiletypeExcel SourceS3UpdateSchemasStreamsFormatFormat6Filetype = "excel"
)

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

type SourceS3UpdateExcelFormat struct {
	filetype *SourceS3UpdateSchemasStreamsFormatFormat6Filetype `const:"excel" json:"filetype"`
}

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

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

func (o *SourceS3UpdateExcelFormat) GetFiletype() *SourceS3UpdateSchemasStreamsFormatFormat6Filetype {
	return SourceS3UpdateSchemasStreamsFormatFormat6FiletypeExcel.ToPointer()
}

type SourceS3UpdateSchemasStreamsFormatFormatFiletype string

const (
	SourceS3UpdateSchemasStreamsFormatFormatFiletypeUnstructured SourceS3UpdateSchemasStreamsFormatFormatFiletype = "unstructured"
)

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

type SourceS3UpdateMode string

const (
	SourceS3UpdateModeLocal SourceS3UpdateMode = "local"
)

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

// SourceS3UpdateLocal - Process files locally, supporting `fast` and `ocr` modes. This is the default option.
type SourceS3UpdateLocal struct {
	mode *SourceS3UpdateMode `const:"local" json:"mode"`
}

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

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

func (o *SourceS3UpdateLocal) GetMode() *SourceS3UpdateMode {
	return SourceS3UpdateModeLocal.ToPointer()
}

type SourceS3UpdateProcessingType string

const (
	SourceS3UpdateProcessingTypeSourceS3UpdateLocal SourceS3UpdateProcessingType = "source-s3-update_Local"
)

// SourceS3UpdateProcessing - Processing configuration
type SourceS3UpdateProcessing struct {
	SourceS3UpdateLocal *SourceS3UpdateLocal `queryParam:"inline"`

	Type SourceS3UpdateProcessingType
}

func CreateSourceS3UpdateProcessingSourceS3UpdateLocal(sourceS3UpdateLocal SourceS3UpdateLocal) SourceS3UpdateProcessing {
	typ := SourceS3UpdateProcessingTypeSourceS3UpdateLocal

	return SourceS3UpdateProcessing{
		SourceS3UpdateLocal: &sourceS3UpdateLocal,
		Type:                typ,
	}
}

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

	var sourceS3UpdateLocal SourceS3UpdateLocal = SourceS3UpdateLocal{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateLocal, "", true, true); err == nil {
		u.SourceS3UpdateLocal = &sourceS3UpdateLocal
		u.Type = SourceS3UpdateProcessingTypeSourceS3UpdateLocal
		return nil
	}

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

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

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

// SourceS3UpdateParsingStrategy - The strategy used to parse documents. `fast` extracts text directly from the document which doesn't work for all files. `ocr_only` is more reliable, but slower. `hi_res` is the most reliable, but requires an API key and a hosted instance of unstructured and can't be used with local mode. See the unstructured.io documentation for more details: https://unstructured-io.github.io/unstructured/core/partition.html#partition-pdf
type SourceS3UpdateParsingStrategy string

const (
	SourceS3UpdateParsingStrategyAuto    SourceS3UpdateParsingStrategy = "auto"
	SourceS3UpdateParsingStrategyFast    SourceS3UpdateParsingStrategy = "fast"
	SourceS3UpdateParsingStrategyOcrOnly SourceS3UpdateParsingStrategy = "ocr_only"
	SourceS3UpdateParsingStrategyHiRes   SourceS3UpdateParsingStrategy = "hi_res"
)

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

// SourceS3UpdateUnstructuredDocumentFormat - Extract text from document formats (.pdf, .docx, .md, .pptx) and emit as one record per file.
type SourceS3UpdateUnstructuredDocumentFormat struct {
	filetype *SourceS3UpdateSchemasStreamsFormatFormatFiletype `const:"unstructured" json:"filetype"`
	// Processing configuration
	Processing *SourceS3UpdateProcessing `json:"processing,omitempty"`
	// If true, skip files that cannot be parsed and pass the error message along as the _ab_source_file_parse_error field. If false, fail the sync.
	SkipUnprocessableFiles *bool `default:"true" json:"skip_unprocessable_files"`
	// The strategy used to parse documents. `fast` extracts text directly from the document which doesn't work for all files. `ocr_only` is more reliable, but slower. `hi_res` is the most reliable, but requires an API key and a hosted instance of unstructured and can't be used with local mode. See the unstructured.io documentation for more details: https://unstructured-io.github.io/unstructured/core/partition.html#partition-pdf
	Strategy *SourceS3UpdateParsingStrategy `default:"auto" json:"strategy"`
}

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

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

func (o *SourceS3UpdateUnstructuredDocumentFormat) GetFiletype() *SourceS3UpdateSchemasStreamsFormatFormatFiletype {
	return SourceS3UpdateSchemasStreamsFormatFormatFiletypeUnstructured.ToPointer()
}

func (o *SourceS3UpdateUnstructuredDocumentFormat) GetProcessing() *SourceS3UpdateProcessing {
	if o == nil {
		return nil
	}
	return o.Processing
}

func (o *SourceS3UpdateUnstructuredDocumentFormat) GetSkipUnprocessableFiles() *bool {
	if o == nil {
		return nil
	}
	return o.SkipUnprocessableFiles
}

func (o *SourceS3UpdateUnstructuredDocumentFormat) GetStrategy() *SourceS3UpdateParsingStrategy {
	if o == nil {
		return nil
	}
	return o.Strategy
}

type SourceS3UpdateSchemasStreamsFormatFiletype string

const (
	SourceS3UpdateSchemasStreamsFormatFiletypeParquet SourceS3UpdateSchemasStreamsFormatFiletype = "parquet"
)

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

type SourceS3UpdateParquetFormat struct {
	// Whether to convert decimal fields to floats. There is a loss of precision when converting decimals to floats, so this is not recommended.
	DecimalAsFloat *bool                                       `default:"false" json:"decimal_as_float"`
	filetype       *SourceS3UpdateSchemasStreamsFormatFiletype `const:"parquet" json:"filetype"`
}

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

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

func (o *SourceS3UpdateParquetFormat) GetDecimalAsFloat() *bool {
	if o == nil {
		return nil
	}
	return o.DecimalAsFloat
}

func (o *SourceS3UpdateParquetFormat) GetFiletype() *SourceS3UpdateSchemasStreamsFormatFiletype {
	return SourceS3UpdateSchemasStreamsFormatFiletypeParquet.ToPointer()
}

type SourceS3UpdateSchemasStreamsFiletype string

const (
	SourceS3UpdateSchemasStreamsFiletypeJsonl SourceS3UpdateSchemasStreamsFiletype = "jsonl"
)

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

type SourceS3UpdateJsonlFormat struct {
	filetype *SourceS3UpdateSchemasStreamsFiletype `const:"jsonl" json:"filetype"`
}

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

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

func (o *SourceS3UpdateJsonlFormat) GetFiletype() *SourceS3UpdateSchemasStreamsFiletype {
	return SourceS3UpdateSchemasStreamsFiletypeJsonl.ToPointer()
}

type SourceS3UpdateSchemasFiletype string

const (
	SourceS3UpdateSchemasFiletypeCsv SourceS3UpdateSchemasFiletype = "csv"
)

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

type SourceS3UpdateSchemasStreamsHeaderDefinitionType string

const (
	SourceS3UpdateSchemasStreamsHeaderDefinitionTypeUserProvided SourceS3UpdateSchemasStreamsHeaderDefinitionType = "User Provided"
)

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

type SourceS3UpdateUserProvided struct {
	// The column names that will be used while emitting the CSV records
	ColumnNames          []string                                          `json:"column_names"`
	headerDefinitionType *SourceS3UpdateSchemasStreamsHeaderDefinitionType `const:"User Provided" json:"header_definition_type"`
}

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

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

func (o *SourceS3UpdateUserProvided) GetColumnNames() []string {
	if o == nil {
		return []string{}
	}
	return o.ColumnNames
}

func (o *SourceS3UpdateUserProvided) GetHeaderDefinitionType() *SourceS3UpdateSchemasStreamsHeaderDefinitionType {
	return SourceS3UpdateSchemasStreamsHeaderDefinitionTypeUserProvided.ToPointer()
}

type SourceS3UpdateSchemasHeaderDefinitionType string

const (
	SourceS3UpdateSchemasHeaderDefinitionTypeAutogenerated SourceS3UpdateSchemasHeaderDefinitionType = "Autogenerated"
)

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

type SourceS3UpdateAutogenerated struct {
	headerDefinitionType *SourceS3UpdateSchemasHeaderDefinitionType `const:"Autogenerated" json:"header_definition_type"`
}

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

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

func (o *SourceS3UpdateAutogenerated) GetHeaderDefinitionType() *SourceS3UpdateSchemasHeaderDefinitionType {
	return SourceS3UpdateSchemasHeaderDefinitionTypeAutogenerated.ToPointer()
}

type SourceS3UpdateHeaderDefinitionType string

const (
	SourceS3UpdateHeaderDefinitionTypeFromCsv SourceS3UpdateHeaderDefinitionType = "From CSV"
)

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

type SourceS3UpdateFromCSV struct {
	headerDefinitionType *SourceS3UpdateHeaderDefinitionType `const:"From CSV" json:"header_definition_type"`
}

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

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

func (o *SourceS3UpdateFromCSV) GetHeaderDefinitionType() *SourceS3UpdateHeaderDefinitionType {
	return SourceS3UpdateHeaderDefinitionTypeFromCsv.ToPointer()
}

type SourceS3UpdateCSVHeaderDefinitionType string

const (
	SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateFromCSV       SourceS3UpdateCSVHeaderDefinitionType = "source-s3-update_From CSV"
	SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateAutogenerated SourceS3UpdateCSVHeaderDefinitionType = "source-s3-update_Autogenerated"
	SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateUserProvided  SourceS3UpdateCSVHeaderDefinitionType = "source-s3-update_User Provided"
)

// SourceS3UpdateCSVHeaderDefinition - How headers will be defined. `User Provided` assumes the CSV does not have a header row and uses the headers provided and `Autogenerated` assumes the CSV does not have a header row and the CDK will generate headers using for `f{i}` where `i` is the index starting from 0. Else, the default behavior is to use the header from the CSV file. If a user wants to autogenerate or provide column names for a CSV having headers, they can skip rows.
type SourceS3UpdateCSVHeaderDefinition struct {
	SourceS3UpdateFromCSV       *SourceS3UpdateFromCSV       `queryParam:"inline"`
	SourceS3UpdateAutogenerated *SourceS3UpdateAutogenerated `queryParam:"inline"`
	SourceS3UpdateUserProvided  *SourceS3UpdateUserProvided  `queryParam:"inline"`

	Type SourceS3UpdateCSVHeaderDefinitionType
}

func CreateSourceS3UpdateCSVHeaderDefinitionSourceS3UpdateFromCSV(sourceS3UpdateFromCSV SourceS3UpdateFromCSV) SourceS3UpdateCSVHeaderDefinition {
	typ := SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateFromCSV

	return SourceS3UpdateCSVHeaderDefinition{
		SourceS3UpdateFromCSV: &sourceS3UpdateFromCSV,
		Type:                  typ,
	}
}

func CreateSourceS3UpdateCSVHeaderDefinitionSourceS3UpdateAutogenerated(sourceS3UpdateAutogenerated SourceS3UpdateAutogenerated) SourceS3UpdateCSVHeaderDefinition {
	typ := SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateAutogenerated

	return SourceS3UpdateCSVHeaderDefinition{
		SourceS3UpdateAutogenerated: &sourceS3UpdateAutogenerated,
		Type:                        typ,
	}
}

func CreateSourceS3UpdateCSVHeaderDefinitionSourceS3UpdateUserProvided(sourceS3UpdateUserProvided SourceS3UpdateUserProvided) SourceS3UpdateCSVHeaderDefinition {
	typ := SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateUserProvided

	return SourceS3UpdateCSVHeaderDefinition{
		SourceS3UpdateUserProvided: &sourceS3UpdateUserProvided,
		Type:                       typ,
	}
}

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

	var sourceS3UpdateFromCSV SourceS3UpdateFromCSV = SourceS3UpdateFromCSV{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateFromCSV, "", true, true); err == nil {
		u.SourceS3UpdateFromCSV = &sourceS3UpdateFromCSV
		u.Type = SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateFromCSV
		return nil
	}

	var sourceS3UpdateAutogenerated SourceS3UpdateAutogenerated = SourceS3UpdateAutogenerated{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateAutogenerated, "", true, true); err == nil {
		u.SourceS3UpdateAutogenerated = &sourceS3UpdateAutogenerated
		u.Type = SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateAutogenerated
		return nil
	}

	var sourceS3UpdateUserProvided SourceS3UpdateUserProvided = SourceS3UpdateUserProvided{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateUserProvided, "", true, true); err == nil {
		u.SourceS3UpdateUserProvided = &sourceS3UpdateUserProvided
		u.Type = SourceS3UpdateCSVHeaderDefinitionTypeSourceS3UpdateUserProvided
		return nil
	}

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

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

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

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

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

type SourceS3UpdateCSVFormat struct {
	// The character delimiting individual cells in the CSV data. This may only be a 1-character string. For tab-delimited data enter '\t'.
	Delimiter *string `default:"," json:"delimiter"`
	// Whether two quotes in a quoted CSV value denote a single quote in the data.
	DoubleQuote *bool `default:"true" json:"double_quote"`
	// The character encoding of the CSV data. Leave blank to default to <strong>UTF8</strong>. See <a href="https://docs.python.org/3/library/codecs.html#standard-encodings" target="_blank">list of python encodings</a> for allowable options.
	Encoding *string `default:"utf8" json:"encoding"`
	// The character used for escaping special characters. To disallow escaping, leave this field blank.
	EscapeChar *string `json:"escape_char,omitempty"`
	// A set of case-sensitive strings that should be interpreted as false values.
	FalseValues []string                       `json:"false_values,omitempty"`
	filetype    *SourceS3UpdateSchemasFiletype `const:"csv" json:"filetype"`
	// How headers will be defined. `User Provided` assumes the CSV does not have a header row and uses the headers provided and `Autogenerated` assumes the CSV does not have a header row and the CDK will generate headers using for `f{i}` where `i` is the index starting from 0. Else, the default behavior is to use the header from the CSV file. If a user wants to autogenerate or provide column names for a CSV having headers, they can skip rows.
	HeaderDefinition *SourceS3UpdateCSVHeaderDefinition `json:"header_definition,omitempty"`
	// Whether to ignore errors that occur when the number of fields in the CSV does not match the number of columns in the schema.
	IgnoreErrorsOnFieldsMismatch *bool `default:"false" json:"ignore_errors_on_fields_mismatch"`
	// A set of case-sensitive strings that should be interpreted as null values. For example, if the value 'NA' should be interpreted as null, enter 'NA' in this field.
	NullValues []string `json:"null_values,omitempty"`
	// The character used for quoting CSV values. To disallow quoting, make this field blank.
	QuoteChar *string `default:"\"" json:"quote_char"`
	// The number of rows to skip after the header row.
	SkipRowsAfterHeader *int64 `default:"0" json:"skip_rows_after_header"`
	// The number of rows to skip before the header row. For example, if the header row is on the 3rd row, enter 2 in this field.
	SkipRowsBeforeHeader *int64 `default:"0" json:"skip_rows_before_header"`
	// Whether strings can be interpreted as null values. If true, strings that match the null_values set will be interpreted as null. If false, strings that match the null_values set will be interpreted as the string itself.
	StringsCanBeNull *bool `default:"true" json:"strings_can_be_null"`
	// A set of case-sensitive strings that should be interpreted as true values.
	TrueValues []string `json:"true_values,omitempty"`
}

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

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

func (o *SourceS3UpdateCSVFormat) GetDelimiter() *string {
	if o == nil {
		return nil
	}
	return o.Delimiter
}

func (o *SourceS3UpdateCSVFormat) GetDoubleQuote() *bool {
	if o == nil {
		return nil
	}
	return o.DoubleQuote
}

func (o *SourceS3UpdateCSVFormat) GetEncoding() *string {
	if o == nil {
		return nil
	}
	return o.Encoding
}

func (o *SourceS3UpdateCSVFormat) GetEscapeChar() *string {
	if o == nil {
		return nil
	}
	return o.EscapeChar
}

func (o *SourceS3UpdateCSVFormat) GetFalseValues() []string {
	if o == nil {
		return nil
	}
	return o.FalseValues
}

func (o *SourceS3UpdateCSVFormat) GetFiletype() *SourceS3UpdateSchemasFiletype {
	return SourceS3UpdateSchemasFiletypeCsv.ToPointer()
}

func (o *SourceS3UpdateCSVFormat) GetHeaderDefinition() *SourceS3UpdateCSVHeaderDefinition {
	if o == nil {
		return nil
	}
	return o.HeaderDefinition
}

func (o *SourceS3UpdateCSVFormat) GetIgnoreErrorsOnFieldsMismatch() *bool {
	if o == nil {
		return nil
	}
	return o.IgnoreErrorsOnFieldsMismatch
}

func (o *SourceS3UpdateCSVFormat) GetNullValues() []string {
	if o == nil {
		return nil
	}
	return o.NullValues
}

func (o *SourceS3UpdateCSVFormat) GetQuoteChar() *string {
	if o == nil {
		return nil
	}
	return o.QuoteChar
}

func (o *SourceS3UpdateCSVFormat) GetSkipRowsAfterHeader() *int64 {
	if o == nil {
		return nil
	}
	return o.SkipRowsAfterHeader
}

func (o *SourceS3UpdateCSVFormat) GetSkipRowsBeforeHeader() *int64 {
	if o == nil {
		return nil
	}
	return o.SkipRowsBeforeHeader
}

func (o *SourceS3UpdateCSVFormat) GetStringsCanBeNull() *bool {
	if o == nil {
		return nil
	}
	return o.StringsCanBeNull
}

func (o *SourceS3UpdateCSVFormat) GetTrueValues() []string {
	if o == nil {
		return nil
	}
	return o.TrueValues
}

type SourceS3UpdateFiletype string

const (
	SourceS3UpdateFiletypeAvro SourceS3UpdateFiletype = "avro"
)

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

type SourceS3UpdateAvroFormat struct {
	// Whether to convert double fields to strings. This is recommended if you have decimal numbers with a high degree of precision because there can be a loss precision when handling floating point numbers.
	DoubleAsString *bool                   `default:"false" json:"double_as_string"`
	filetype       *SourceS3UpdateFiletype `const:"avro" json:"filetype"`
}

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

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

func (o *SourceS3UpdateAvroFormat) GetDoubleAsString() *bool {
	if o == nil {
		return nil
	}
	return o.DoubleAsString
}

func (o *SourceS3UpdateAvroFormat) GetFiletype() *SourceS3UpdateFiletype {
	return SourceS3UpdateFiletypeAvro.ToPointer()
}

type SourceS3UpdateFormatType string

const (
	SourceS3UpdateFormatTypeSourceS3UpdateAvroFormat                 SourceS3UpdateFormatType = "source-s3-update_Avro Format"
	SourceS3UpdateFormatTypeSourceS3UpdateCSVFormat                  SourceS3UpdateFormatType = "source-s3-update_CSV Format"
	SourceS3UpdateFormatTypeSourceS3UpdateJsonlFormat                SourceS3UpdateFormatType = "source-s3-update_Jsonl Format"
	SourceS3UpdateFormatTypeSourceS3UpdateParquetFormat              SourceS3UpdateFormatType = "source-s3-update_Parquet Format"
	SourceS3UpdateFormatTypeSourceS3UpdateUnstructuredDocumentFormat SourceS3UpdateFormatType = "source-s3-update_Unstructured Document Format"
	SourceS3UpdateFormatTypeSourceS3UpdateExcelFormat                SourceS3UpdateFormatType = "source-s3-update_Excel Format"
)

// SourceS3UpdateFormat - The configuration options that are used to alter how to read incoming files that deviate from the standard formatting.
type SourceS3UpdateFormat struct {
	SourceS3UpdateAvroFormat                 *SourceS3UpdateAvroFormat                 `queryParam:"inline"`
	SourceS3UpdateCSVFormat                  *SourceS3UpdateCSVFormat                  `queryParam:"inline"`
	SourceS3UpdateJsonlFormat                *SourceS3UpdateJsonlFormat                `queryParam:"inline"`
	SourceS3UpdateParquetFormat              *SourceS3UpdateParquetFormat              `queryParam:"inline"`
	SourceS3UpdateUnstructuredDocumentFormat *SourceS3UpdateUnstructuredDocumentFormat `queryParam:"inline"`
	SourceS3UpdateExcelFormat                *SourceS3UpdateExcelFormat                `queryParam:"inline"`

	Type SourceS3UpdateFormatType
}

func CreateSourceS3UpdateFormatSourceS3UpdateAvroFormat(sourceS3UpdateAvroFormat SourceS3UpdateAvroFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateAvroFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateAvroFormat: &sourceS3UpdateAvroFormat,
		Type:                     typ,
	}
}

func CreateSourceS3UpdateFormatSourceS3UpdateCSVFormat(sourceS3UpdateCSVFormat SourceS3UpdateCSVFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateCSVFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateCSVFormat: &sourceS3UpdateCSVFormat,
		Type:                    typ,
	}
}

func CreateSourceS3UpdateFormatSourceS3UpdateJsonlFormat(sourceS3UpdateJsonlFormat SourceS3UpdateJsonlFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateJsonlFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateJsonlFormat: &sourceS3UpdateJsonlFormat,
		Type:                      typ,
	}
}

func CreateSourceS3UpdateFormatSourceS3UpdateParquetFormat(sourceS3UpdateParquetFormat SourceS3UpdateParquetFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateParquetFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateParquetFormat: &sourceS3UpdateParquetFormat,
		Type:                        typ,
	}
}

func CreateSourceS3UpdateFormatSourceS3UpdateUnstructuredDocumentFormat(sourceS3UpdateUnstructuredDocumentFormat SourceS3UpdateUnstructuredDocumentFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateUnstructuredDocumentFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateUnstructuredDocumentFormat: &sourceS3UpdateUnstructuredDocumentFormat,
		Type:                                     typ,
	}
}

func CreateSourceS3UpdateFormatSourceS3UpdateExcelFormat(sourceS3UpdateExcelFormat SourceS3UpdateExcelFormat) SourceS3UpdateFormat {
	typ := SourceS3UpdateFormatTypeSourceS3UpdateExcelFormat

	return SourceS3UpdateFormat{
		SourceS3UpdateExcelFormat: &sourceS3UpdateExcelFormat,
		Type:                      typ,
	}
}

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

	var sourceS3UpdateJsonlFormat SourceS3UpdateJsonlFormat = SourceS3UpdateJsonlFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateJsonlFormat, "", true, true); err == nil {
		u.SourceS3UpdateJsonlFormat = &sourceS3UpdateJsonlFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateJsonlFormat
		return nil
	}

	var sourceS3UpdateExcelFormat SourceS3UpdateExcelFormat = SourceS3UpdateExcelFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateExcelFormat, "", true, true); err == nil {
		u.SourceS3UpdateExcelFormat = &sourceS3UpdateExcelFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateExcelFormat
		return nil
	}

	var sourceS3UpdateAvroFormat SourceS3UpdateAvroFormat = SourceS3UpdateAvroFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateAvroFormat, "", true, true); err == nil {
		u.SourceS3UpdateAvroFormat = &sourceS3UpdateAvroFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateAvroFormat
		return nil
	}

	var sourceS3UpdateParquetFormat SourceS3UpdateParquetFormat = SourceS3UpdateParquetFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateParquetFormat, "", true, true); err == nil {
		u.SourceS3UpdateParquetFormat = &sourceS3UpdateParquetFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateParquetFormat
		return nil
	}

	var sourceS3UpdateUnstructuredDocumentFormat SourceS3UpdateUnstructuredDocumentFormat = SourceS3UpdateUnstructuredDocumentFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateUnstructuredDocumentFormat, "", true, true); err == nil {
		u.SourceS3UpdateUnstructuredDocumentFormat = &sourceS3UpdateUnstructuredDocumentFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateUnstructuredDocumentFormat
		return nil
	}

	var sourceS3UpdateCSVFormat SourceS3UpdateCSVFormat = SourceS3UpdateCSVFormat{}
	if err := utils.UnmarshalJSON(data, &sourceS3UpdateCSVFormat, "", true, true); err == nil {
		u.SourceS3UpdateCSVFormat = &sourceS3UpdateCSVFormat
		u.Type = SourceS3UpdateFormatTypeSourceS3UpdateCSVFormat
		return nil
	}

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

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

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

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

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

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

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

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

// SourceS3UpdateValidationPolicy - The name of the validation policy that dictates sync behavior when a record does not adhere to the stream schema.
type SourceS3UpdateValidationPolicy string

const (
	SourceS3UpdateValidationPolicyEmitRecord      SourceS3UpdateValidationPolicy = "Emit Record"
	SourceS3UpdateValidationPolicySkipRecord      SourceS3UpdateValidationPolicy = "Skip Record"
	SourceS3UpdateValidationPolicyWaitForDiscover SourceS3UpdateValidationPolicy = "Wait for Discover"
)

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

type SourceS3UpdateFileBasedStreamConfig struct {
	// When the state history of the file store is full, syncs will only read files that were last modified in the provided day range.
	DaysToSyncIfHistoryIsFull *int64 `default:"3" json:"days_to_sync_if_history_is_full"`
	// The configuration options that are used to alter how to read incoming files that deviate from the standard formatting.
	Format SourceS3UpdateFormat `json:"format"`
	// The pattern used to specify which files should be selected from the file system. For more information on glob pattern matching look <a href="https://en.wikipedia.org/wiki/Glob_(programming)">here</a>.
	Globs []string `json:"globs,omitempty"`
	// The schema that will be used to validate records extracted from the file. This will override the stream schema that is auto-detected from incoming files.
	InputSchema *string `json:"input_schema,omitempty"`
	// The name of the stream.
	Name string `json:"name"`
	// The number of resent files which will be used to discover the schema for this stream.
	RecentNFilesToReadForSchemaDiscovery *int64 `json:"recent_n_files_to_read_for_schema_discovery,omitempty"`
	// When enabled, syncs will not validate or structure records against the stream's schema.
	Schemaless *bool `default:"false" json:"schemaless"`
	// The name of the validation policy that dictates sync behavior when a record does not adhere to the stream schema.
	ValidationPolicy *SourceS3UpdateValidationPolicy `default:"Emit Record" json:"validation_policy"`
}

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

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

func (o *SourceS3UpdateFileBasedStreamConfig) GetDaysToSyncIfHistoryIsFull() *int64 {
	if o == nil {
		return nil
	}
	return o.DaysToSyncIfHistoryIsFull
}

func (o *SourceS3UpdateFileBasedStreamConfig) GetFormat() SourceS3UpdateFormat {
	if o == nil {
		return SourceS3UpdateFormat{}
	}
	return o.Format
}

func (o *SourceS3UpdateFileBasedStreamConfig) GetGlobs() []string {
	if o == nil {
		return nil
	}
	return o.Globs
}

func (o *SourceS3UpdateFileBasedStreamConfig) GetInputSchema() *string {
	if o == nil {
		return nil
	}
	return o.InputSchema
}

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

func (o *SourceS3UpdateFileBasedStreamConfig) GetRecentNFilesToReadForSchemaDiscovery() *int64 {
	if o == nil {
		return nil
	}
	return o.RecentNFilesToReadForSchemaDiscovery
}

func (o *SourceS3UpdateFileBasedStreamConfig) GetSchemaless() *bool {
	if o == nil {
		return nil
	}
	return o.Schemaless
}

func (o *SourceS3UpdateFileBasedStreamConfig) GetValidationPolicy() *SourceS3UpdateValidationPolicy {
	if o == nil {
		return nil
	}
	return o.ValidationPolicy
}

// SourceS3Update - NOTE: When this Spec is changed, legacy_config_transformer.py must also be modified to uptake the changes
// because it is responsible for converting legacy S3 v3 configs into v4 configs using the File-Based CDK.
type SourceS3Update struct {
	// In order to access private Buckets stored on AWS S3, this connector requires credentials with the proper permissions. If accessing publicly available data, this field is not necessary.
	AwsAccessKeyID *string `json:"aws_access_key_id,omitempty"`
	// In order to access private Buckets stored on AWS S3, this connector requires credentials with the proper permissions. If accessing publicly available data, this field is not necessary.
	AwsSecretAccessKey *string `json:"aws_secret_access_key,omitempty"`
	// Name of the S3 bucket where the file(s) exist.
	Bucket         string                        `json:"bucket"`
	DeliveryMethod *SourceS3UpdateDeliveryMethod `json:"delivery_method,omitempty"`
	// Endpoint to an S3 compatible service. Leave empty to use AWS.
	Endpoint *string `default:"" json:"endpoint"`
	// AWS region where the S3 bucket is located. If not provided, the region will be determined automatically.
	RegionName *string `json:"region_name,omitempty"`
	// Specifies the Amazon Resource Name (ARN) of an IAM role that you want to use to perform operations requested using this profile. Set the External ID to the Airbyte workspace ID, which can be found in the URL of this page.
	RoleArn *string `json:"role_arn,omitempty"`
	// UTC date and time in the format 2017-01-25T00:00:00.000000Z. Any file modified before this date will not be replicated.
	StartDate *time.Time `json:"start_date,omitempty"`
	// Each instance of this configuration defines a <a href="https://docs.airbyte.com/cloud/core-concepts#stream">stream</a>. Use this to define which files belong in the stream, their format, and how they should be parsed and validated. When sending data to warehouse destination such as Snowflake or BigQuery, each stream is a separate table.
	Streams []SourceS3UpdateFileBasedStreamConfig `json:"streams"`
}

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

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

func (o *SourceS3Update) GetAwsAccessKeyID() *string {
	if o == nil {
		return nil
	}
	return o.AwsAccessKeyID
}

func (o *SourceS3Update) GetAwsSecretAccessKey() *string {
	if o == nil {
		return nil
	}
	return o.AwsSecretAccessKey
}

func (o *SourceS3Update) GetBucket() string {
	if o == nil {
		return ""
	}
	return o.Bucket
}

func (o *SourceS3Update) GetDeliveryMethod() *SourceS3UpdateDeliveryMethod {
	if o == nil {
		return nil
	}
	return o.DeliveryMethod
}

func (o *SourceS3Update) GetEndpoint() *string {
	if o == nil {
		return nil
	}
	return o.Endpoint
}

func (o *SourceS3Update) GetRegionName() *string {
	if o == nil {
		return nil
	}
	return o.RegionName
}

func (o *SourceS3Update) GetRoleArn() *string {
	if o == nil {
		return nil
	}
	return o.RoleArn
}

func (o *SourceS3Update) GetStartDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartDate
}

func (o *SourceS3Update) GetStreams() []SourceS3UpdateFileBasedStreamConfig {
	if o == nil {
		return []SourceS3UpdateFileBasedStreamConfig{}
	}
	return o.Streams
}
