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

package shared

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

// ConnectionResponse - Provides details of a single connection.
type ConnectionResponse struct {
	ConnectionID  string               `json:"connectionId"`
	Name          string               `json:"name"`
	SourceID      string               `json:"sourceId"`
	DestinationID string               `json:"destinationId"`
	WorkspaceID   string               `json:"workspaceId"`
	Status        ConnectionStatusEnum `json:"status"`
	// schedule for when the the connection should run, per the schedule type
	Schedule ConnectionScheduleResponse `json:"schedule"`
	// Set how Airbyte handles syncs when it detects a non-breaking schema change in the source
	NonBreakingSchemaUpdatesBehavior *NonBreakingSchemaUpdatesBehaviorEnum `default:"ignore" json:"nonBreakingSchemaUpdatesBehavior"`
	// Define the location where the data will be stored in the destination
	NamespaceDefinition *NamespaceDefinitionEnum `default:"destination" json:"namespaceDefinition"`
	NamespaceFormat     *string                  `json:"namespaceFormat,omitempty"`
	Prefix              *string                  `json:"prefix,omitempty"`
	// A list of configured stream options for a connection.
	Configurations StreamConfigurations `json:"configurations"`
	CreatedAt      int64                `json:"createdAt"`
	Tags           []Tag                `json:"tags"`
}

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

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

func (o *ConnectionResponse) GetConnectionID() string {
	if o == nil {
		return ""
	}
	return o.ConnectionID
}

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

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

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

func (o *ConnectionResponse) GetWorkspaceID() string {
	if o == nil {
		return ""
	}
	return o.WorkspaceID
}

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

func (o *ConnectionResponse) GetSchedule() ConnectionScheduleResponse {
	if o == nil {
		return ConnectionScheduleResponse{}
	}
	return o.Schedule
}

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

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

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

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

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

func (o *ConnectionResponse) GetCreatedAt() int64 {
	if o == nil {
		return 0
	}
	return o.CreatedAt
}

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