// Code generated by Fern. DO NOT EDIT.

package api

import (
	json "encoding/json"
	fmt "fmt"
	big "math/big"
	internal "pentagi/pkg/observability/langfuse/api/internal"
	time "time"
)

var (
	blobStorageIntegrationsDeleteBlobStorageIntegrationRequestFieldID = big.NewInt(1 << 0)
)

type BlobStorageIntegrationsDeleteBlobStorageIntegrationRequest struct {
	ID string `json:"-" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (b *BlobStorageIntegrationsDeleteBlobStorageIntegrationRequest) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationsDeleteBlobStorageIntegrationRequest) SetID(id string) {
	b.ID = id
	b.require(blobStorageIntegrationsDeleteBlobStorageIntegrationRequestFieldID)
}

type BlobStorageExportFrequency string

const (
	BlobStorageExportFrequencyHourly BlobStorageExportFrequency = "hourly"
	BlobStorageExportFrequencyDaily  BlobStorageExportFrequency = "daily"
	BlobStorageExportFrequencyWeekly BlobStorageExportFrequency = "weekly"
)

func NewBlobStorageExportFrequencyFromString(s string) (BlobStorageExportFrequency, error) {
	switch s {
	case "hourly":
		return BlobStorageExportFrequencyHourly, nil
	case "daily":
		return BlobStorageExportFrequencyDaily, nil
	case "weekly":
		return BlobStorageExportFrequencyWeekly, nil
	}
	var t BlobStorageExportFrequency
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (b BlobStorageExportFrequency) Ptr() *BlobStorageExportFrequency {
	return &b
}

type BlobStorageExportMode string

const (
	BlobStorageExportModeFullHistory    BlobStorageExportMode = "FULL_HISTORY"
	BlobStorageExportModeFromToday      BlobStorageExportMode = "FROM_TODAY"
	BlobStorageExportModeFromCustomDate BlobStorageExportMode = "FROM_CUSTOM_DATE"
)

func NewBlobStorageExportModeFromString(s string) (BlobStorageExportMode, error) {
	switch s {
	case "FULL_HISTORY":
		return BlobStorageExportModeFullHistory, nil
	case "FROM_TODAY":
		return BlobStorageExportModeFromToday, nil
	case "FROM_CUSTOM_DATE":
		return BlobStorageExportModeFromCustomDate, nil
	}
	var t BlobStorageExportMode
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (b BlobStorageExportMode) Ptr() *BlobStorageExportMode {
	return &b
}

var (
	blobStorageIntegrationDeletionResponseFieldMessage = big.NewInt(1 << 0)
)

type BlobStorageIntegrationDeletionResponse struct {
	Message string `json:"message" url:"message"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (b *BlobStorageIntegrationDeletionResponse) GetMessage() string {
	if b == nil {
		return ""
	}
	return b.Message
}

func (b *BlobStorageIntegrationDeletionResponse) GetExtraProperties() map[string]interface{} {
	return b.extraProperties
}

func (b *BlobStorageIntegrationDeletionResponse) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetMessage sets the Message field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationDeletionResponse) SetMessage(message string) {
	b.Message = message
	b.require(blobStorageIntegrationDeletionResponseFieldMessage)
}

func (b *BlobStorageIntegrationDeletionResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler BlobStorageIntegrationDeletionResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*b = BlobStorageIntegrationDeletionResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *b)
	if err != nil {
		return err
	}
	b.extraProperties = extraProperties
	b.rawJSON = json.RawMessage(data)
	return nil
}

func (b *BlobStorageIntegrationDeletionResponse) MarshalJSON() ([]byte, error) {
	type embed BlobStorageIntegrationDeletionResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*b),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (b *BlobStorageIntegrationDeletionResponse) String() string {
	if len(b.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(b); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", b)
}

type BlobStorageIntegrationFileType string

const (
	BlobStorageIntegrationFileTypeJSON  BlobStorageIntegrationFileType = "JSON"
	BlobStorageIntegrationFileTypeCsv   BlobStorageIntegrationFileType = "CSV"
	BlobStorageIntegrationFileTypeJsonl BlobStorageIntegrationFileType = "JSONL"
)

func NewBlobStorageIntegrationFileTypeFromString(s string) (BlobStorageIntegrationFileType, error) {
	switch s {
	case "JSON":
		return BlobStorageIntegrationFileTypeJSON, nil
	case "CSV":
		return BlobStorageIntegrationFileTypeCsv, nil
	case "JSONL":
		return BlobStorageIntegrationFileTypeJsonl, nil
	}
	var t BlobStorageIntegrationFileType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (b BlobStorageIntegrationFileType) Ptr() *BlobStorageIntegrationFileType {
	return &b
}

var (
	blobStorageIntegrationResponseFieldID              = big.NewInt(1 << 0)
	blobStorageIntegrationResponseFieldProjectID       = big.NewInt(1 << 1)
	blobStorageIntegrationResponseFieldType            = big.NewInt(1 << 2)
	blobStorageIntegrationResponseFieldBucketName      = big.NewInt(1 << 3)
	blobStorageIntegrationResponseFieldEndpoint        = big.NewInt(1 << 4)
	blobStorageIntegrationResponseFieldRegion          = big.NewInt(1 << 5)
	blobStorageIntegrationResponseFieldAccessKeyID     = big.NewInt(1 << 6)
	blobStorageIntegrationResponseFieldPrefix          = big.NewInt(1 << 7)
	blobStorageIntegrationResponseFieldExportFrequency = big.NewInt(1 << 8)
	blobStorageIntegrationResponseFieldEnabled         = big.NewInt(1 << 9)
	blobStorageIntegrationResponseFieldForcePathStyle  = big.NewInt(1 << 10)
	blobStorageIntegrationResponseFieldFileType        = big.NewInt(1 << 11)
	blobStorageIntegrationResponseFieldExportMode      = big.NewInt(1 << 12)
	blobStorageIntegrationResponseFieldExportStartDate = big.NewInt(1 << 13)
	blobStorageIntegrationResponseFieldNextSyncAt      = big.NewInt(1 << 14)
	blobStorageIntegrationResponseFieldLastSyncAt      = big.NewInt(1 << 15)
	blobStorageIntegrationResponseFieldCreatedAt       = big.NewInt(1 << 16)
	blobStorageIntegrationResponseFieldUpdatedAt       = big.NewInt(1 << 17)
)

type BlobStorageIntegrationResponse struct {
	ID              string                         `json:"id" url:"id"`
	ProjectID       string                         `json:"projectId" url:"projectId"`
	Type            BlobStorageIntegrationType     `json:"type" url:"type"`
	BucketName      string                         `json:"bucketName" url:"bucketName"`
	Endpoint        *string                        `json:"endpoint,omitempty" url:"endpoint,omitempty"`
	Region          string                         `json:"region" url:"region"`
	AccessKeyID     *string                        `json:"accessKeyId,omitempty" url:"accessKeyId,omitempty"`
	Prefix          string                         `json:"prefix" url:"prefix"`
	ExportFrequency BlobStorageExportFrequency     `json:"exportFrequency" url:"exportFrequency"`
	Enabled         bool                           `json:"enabled" url:"enabled"`
	ForcePathStyle  bool                           `json:"forcePathStyle" url:"forcePathStyle"`
	FileType        BlobStorageIntegrationFileType `json:"fileType" url:"fileType"`
	ExportMode      BlobStorageExportMode          `json:"exportMode" url:"exportMode"`
	ExportStartDate *time.Time                     `json:"exportStartDate,omitempty" url:"exportStartDate,omitempty"`
	NextSyncAt      *time.Time                     `json:"nextSyncAt,omitempty" url:"nextSyncAt,omitempty"`
	LastSyncAt      *time.Time                     `json:"lastSyncAt,omitempty" url:"lastSyncAt,omitempty"`
	CreatedAt       time.Time                      `json:"createdAt" url:"createdAt"`
	UpdatedAt       time.Time                      `json:"updatedAt" url:"updatedAt"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (b *BlobStorageIntegrationResponse) GetID() string {
	if b == nil {
		return ""
	}
	return b.ID
}

func (b *BlobStorageIntegrationResponse) GetProjectID() string {
	if b == nil {
		return ""
	}
	return b.ProjectID
}

func (b *BlobStorageIntegrationResponse) GetType() BlobStorageIntegrationType {
	if b == nil {
		return ""
	}
	return b.Type
}

func (b *BlobStorageIntegrationResponse) GetBucketName() string {
	if b == nil {
		return ""
	}
	return b.BucketName
}

func (b *BlobStorageIntegrationResponse) GetEndpoint() *string {
	if b == nil {
		return nil
	}
	return b.Endpoint
}

func (b *BlobStorageIntegrationResponse) GetRegion() string {
	if b == nil {
		return ""
	}
	return b.Region
}

func (b *BlobStorageIntegrationResponse) GetAccessKeyID() *string {
	if b == nil {
		return nil
	}
	return b.AccessKeyID
}

func (b *BlobStorageIntegrationResponse) GetPrefix() string {
	if b == nil {
		return ""
	}
	return b.Prefix
}

func (b *BlobStorageIntegrationResponse) GetExportFrequency() BlobStorageExportFrequency {
	if b == nil {
		return ""
	}
	return b.ExportFrequency
}

func (b *BlobStorageIntegrationResponse) GetEnabled() bool {
	if b == nil {
		return false
	}
	return b.Enabled
}

func (b *BlobStorageIntegrationResponse) GetForcePathStyle() bool {
	if b == nil {
		return false
	}
	return b.ForcePathStyle
}

func (b *BlobStorageIntegrationResponse) GetFileType() BlobStorageIntegrationFileType {
	if b == nil {
		return ""
	}
	return b.FileType
}

func (b *BlobStorageIntegrationResponse) GetExportMode() BlobStorageExportMode {
	if b == nil {
		return ""
	}
	return b.ExportMode
}

func (b *BlobStorageIntegrationResponse) GetExportStartDate() *time.Time {
	if b == nil {
		return nil
	}
	return b.ExportStartDate
}

func (b *BlobStorageIntegrationResponse) GetNextSyncAt() *time.Time {
	if b == nil {
		return nil
	}
	return b.NextSyncAt
}

func (b *BlobStorageIntegrationResponse) GetLastSyncAt() *time.Time {
	if b == nil {
		return nil
	}
	return b.LastSyncAt
}

func (b *BlobStorageIntegrationResponse) GetCreatedAt() time.Time {
	if b == nil {
		return time.Time{}
	}
	return b.CreatedAt
}

func (b *BlobStorageIntegrationResponse) GetUpdatedAt() time.Time {
	if b == nil {
		return time.Time{}
	}
	return b.UpdatedAt
}

func (b *BlobStorageIntegrationResponse) GetExtraProperties() map[string]interface{} {
	return b.extraProperties
}

func (b *BlobStorageIntegrationResponse) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetID(id string) {
	b.ID = id
	b.require(blobStorageIntegrationResponseFieldID)
}

// SetProjectID sets the ProjectID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetProjectID(projectID string) {
	b.ProjectID = projectID
	b.require(blobStorageIntegrationResponseFieldProjectID)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetType(type_ BlobStorageIntegrationType) {
	b.Type = type_
	b.require(blobStorageIntegrationResponseFieldType)
}

// SetBucketName sets the BucketName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetBucketName(bucketName string) {
	b.BucketName = bucketName
	b.require(blobStorageIntegrationResponseFieldBucketName)
}

// SetEndpoint sets the Endpoint field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetEndpoint(endpoint *string) {
	b.Endpoint = endpoint
	b.require(blobStorageIntegrationResponseFieldEndpoint)
}

// SetRegion sets the Region field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetRegion(region string) {
	b.Region = region
	b.require(blobStorageIntegrationResponseFieldRegion)
}

// SetAccessKeyID sets the AccessKeyID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetAccessKeyID(accessKeyID *string) {
	b.AccessKeyID = accessKeyID
	b.require(blobStorageIntegrationResponseFieldAccessKeyID)
}

// SetPrefix sets the Prefix field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetPrefix(prefix string) {
	b.Prefix = prefix
	b.require(blobStorageIntegrationResponseFieldPrefix)
}

// SetExportFrequency sets the ExportFrequency field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetExportFrequency(exportFrequency BlobStorageExportFrequency) {
	b.ExportFrequency = exportFrequency
	b.require(blobStorageIntegrationResponseFieldExportFrequency)
}

// SetEnabled sets the Enabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetEnabled(enabled bool) {
	b.Enabled = enabled
	b.require(blobStorageIntegrationResponseFieldEnabled)
}

// SetForcePathStyle sets the ForcePathStyle field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetForcePathStyle(forcePathStyle bool) {
	b.ForcePathStyle = forcePathStyle
	b.require(blobStorageIntegrationResponseFieldForcePathStyle)
}

// SetFileType sets the FileType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetFileType(fileType BlobStorageIntegrationFileType) {
	b.FileType = fileType
	b.require(blobStorageIntegrationResponseFieldFileType)
}

// SetExportMode sets the ExportMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetExportMode(exportMode BlobStorageExportMode) {
	b.ExportMode = exportMode
	b.require(blobStorageIntegrationResponseFieldExportMode)
}

// SetExportStartDate sets the ExportStartDate field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetExportStartDate(exportStartDate *time.Time) {
	b.ExportStartDate = exportStartDate
	b.require(blobStorageIntegrationResponseFieldExportStartDate)
}

// SetNextSyncAt sets the NextSyncAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetNextSyncAt(nextSyncAt *time.Time) {
	b.NextSyncAt = nextSyncAt
	b.require(blobStorageIntegrationResponseFieldNextSyncAt)
}

// SetLastSyncAt sets the LastSyncAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetLastSyncAt(lastSyncAt *time.Time) {
	b.LastSyncAt = lastSyncAt
	b.require(blobStorageIntegrationResponseFieldLastSyncAt)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetCreatedAt(createdAt time.Time) {
	b.CreatedAt = createdAt
	b.require(blobStorageIntegrationResponseFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationResponse) SetUpdatedAt(updatedAt time.Time) {
	b.UpdatedAt = updatedAt
	b.require(blobStorageIntegrationResponseFieldUpdatedAt)
}

func (b *BlobStorageIntegrationResponse) UnmarshalJSON(data []byte) error {
	type embed BlobStorageIntegrationResponse
	var unmarshaler = struct {
		embed
		ExportStartDate *internal.DateTime `json:"exportStartDate,omitempty"`
		NextSyncAt      *internal.DateTime `json:"nextSyncAt,omitempty"`
		LastSyncAt      *internal.DateTime `json:"lastSyncAt,omitempty"`
		CreatedAt       *internal.DateTime `json:"createdAt"`
		UpdatedAt       *internal.DateTime `json:"updatedAt"`
	}{
		embed: embed(*b),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*b = BlobStorageIntegrationResponse(unmarshaler.embed)
	b.ExportStartDate = unmarshaler.ExportStartDate.TimePtr()
	b.NextSyncAt = unmarshaler.NextSyncAt.TimePtr()
	b.LastSyncAt = unmarshaler.LastSyncAt.TimePtr()
	b.CreatedAt = unmarshaler.CreatedAt.Time()
	b.UpdatedAt = unmarshaler.UpdatedAt.Time()
	extraProperties, err := internal.ExtractExtraProperties(data, *b)
	if err != nil {
		return err
	}
	b.extraProperties = extraProperties
	b.rawJSON = json.RawMessage(data)
	return nil
}

func (b *BlobStorageIntegrationResponse) MarshalJSON() ([]byte, error) {
	type embed BlobStorageIntegrationResponse
	var marshaler = struct {
		embed
		ExportStartDate *internal.DateTime `json:"exportStartDate,omitempty"`
		NextSyncAt      *internal.DateTime `json:"nextSyncAt,omitempty"`
		LastSyncAt      *internal.DateTime `json:"lastSyncAt,omitempty"`
		CreatedAt       *internal.DateTime `json:"createdAt"`
		UpdatedAt       *internal.DateTime `json:"updatedAt"`
	}{
		embed:           embed(*b),
		ExportStartDate: internal.NewOptionalDateTime(b.ExportStartDate),
		NextSyncAt:      internal.NewOptionalDateTime(b.NextSyncAt),
		LastSyncAt:      internal.NewOptionalDateTime(b.LastSyncAt),
		CreatedAt:       internal.NewDateTime(b.CreatedAt),
		UpdatedAt:       internal.NewDateTime(b.UpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (b *BlobStorageIntegrationResponse) String() string {
	if len(b.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(b); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", b)
}

type BlobStorageIntegrationType string

const (
	BlobStorageIntegrationTypeS3               BlobStorageIntegrationType = "S3"
	BlobStorageIntegrationTypeS3Compatible     BlobStorageIntegrationType = "S3_COMPATIBLE"
	BlobStorageIntegrationTypeAzureBlobStorage BlobStorageIntegrationType = "AZURE_BLOB_STORAGE"
)

func NewBlobStorageIntegrationTypeFromString(s string) (BlobStorageIntegrationType, error) {
	switch s {
	case "S3":
		return BlobStorageIntegrationTypeS3, nil
	case "S3_COMPATIBLE":
		return BlobStorageIntegrationTypeS3Compatible, nil
	case "AZURE_BLOB_STORAGE":
		return BlobStorageIntegrationTypeAzureBlobStorage, nil
	}
	var t BlobStorageIntegrationType
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (b BlobStorageIntegrationType) Ptr() *BlobStorageIntegrationType {
	return &b
}

var (
	blobStorageIntegrationsResponseFieldData = big.NewInt(1 << 0)
)

type BlobStorageIntegrationsResponse struct {
	Data []*BlobStorageIntegrationResponse `json:"data" url:"data"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (b *BlobStorageIntegrationsResponse) GetData() []*BlobStorageIntegrationResponse {
	if b == nil {
		return nil
	}
	return b.Data
}

func (b *BlobStorageIntegrationsResponse) GetExtraProperties() map[string]interface{} {
	return b.extraProperties
}

func (b *BlobStorageIntegrationsResponse) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetData sets the Data field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BlobStorageIntegrationsResponse) SetData(data []*BlobStorageIntegrationResponse) {
	b.Data = data
	b.require(blobStorageIntegrationsResponseFieldData)
}

func (b *BlobStorageIntegrationsResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler BlobStorageIntegrationsResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*b = BlobStorageIntegrationsResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *b)
	if err != nil {
		return err
	}
	b.extraProperties = extraProperties
	b.rawJSON = json.RawMessage(data)
	return nil
}

func (b *BlobStorageIntegrationsResponse) MarshalJSON() ([]byte, error) {
	type embed BlobStorageIntegrationsResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*b),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (b *BlobStorageIntegrationsResponse) String() string {
	if len(b.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(b); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", b)
}

var (
	createBlobStorageIntegrationRequestFieldProjectID       = big.NewInt(1 << 0)
	createBlobStorageIntegrationRequestFieldType            = big.NewInt(1 << 1)
	createBlobStorageIntegrationRequestFieldBucketName      = big.NewInt(1 << 2)
	createBlobStorageIntegrationRequestFieldEndpoint        = big.NewInt(1 << 3)
	createBlobStorageIntegrationRequestFieldRegion          = big.NewInt(1 << 4)
	createBlobStorageIntegrationRequestFieldAccessKeyID     = big.NewInt(1 << 5)
	createBlobStorageIntegrationRequestFieldSecretAccessKey = big.NewInt(1 << 6)
	createBlobStorageIntegrationRequestFieldPrefix          = big.NewInt(1 << 7)
	createBlobStorageIntegrationRequestFieldExportFrequency = big.NewInt(1 << 8)
	createBlobStorageIntegrationRequestFieldEnabled         = big.NewInt(1 << 9)
	createBlobStorageIntegrationRequestFieldForcePathStyle  = big.NewInt(1 << 10)
	createBlobStorageIntegrationRequestFieldFileType        = big.NewInt(1 << 11)
	createBlobStorageIntegrationRequestFieldExportMode      = big.NewInt(1 << 12)
	createBlobStorageIntegrationRequestFieldExportStartDate = big.NewInt(1 << 13)
)

type CreateBlobStorageIntegrationRequest struct {
	// ID of the project in which to configure the blob storage integration
	ProjectID string                     `json:"projectId" url:"-"`
	Type      BlobStorageIntegrationType `json:"type" url:"-"`
	// Name of the storage bucket
	BucketName string `json:"bucketName" url:"-"`
	// Custom endpoint URL (required for S3_COMPATIBLE type)
	Endpoint *string `json:"endpoint,omitempty" url:"-"`
	// Storage region
	Region string `json:"region" url:"-"`
	// Access key ID for authentication
	AccessKeyID *string `json:"accessKeyId,omitempty" url:"-"`
	// Secret access key for authentication (will be encrypted when stored)
	SecretAccessKey *string `json:"secretAccessKey,omitempty" url:"-"`
	// Path prefix for exported files (must end with forward slash if provided)
	Prefix          *string                    `json:"prefix,omitempty" url:"-"`
	ExportFrequency BlobStorageExportFrequency `json:"exportFrequency" url:"-"`
	// Whether the integration is active
	Enabled bool `json:"enabled" url:"-"`
	// Use path-style URLs for S3 requests
	ForcePathStyle bool                           `json:"forcePathStyle" url:"-"`
	FileType       BlobStorageIntegrationFileType `json:"fileType" url:"-"`
	ExportMode     BlobStorageExportMode          `json:"exportMode" url:"-"`
	// Custom start date for exports (required when exportMode is FROM_CUSTOM_DATE)
	ExportStartDate *time.Time `json:"exportStartDate,omitempty" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (c *CreateBlobStorageIntegrationRequest) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetProjectID sets the ProjectID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetProjectID(projectID string) {
	c.ProjectID = projectID
	c.require(createBlobStorageIntegrationRequestFieldProjectID)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetType(type_ BlobStorageIntegrationType) {
	c.Type = type_
	c.require(createBlobStorageIntegrationRequestFieldType)
}

// SetBucketName sets the BucketName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetBucketName(bucketName string) {
	c.BucketName = bucketName
	c.require(createBlobStorageIntegrationRequestFieldBucketName)
}

// SetEndpoint sets the Endpoint field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetEndpoint(endpoint *string) {
	c.Endpoint = endpoint
	c.require(createBlobStorageIntegrationRequestFieldEndpoint)
}

// SetRegion sets the Region field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetRegion(region string) {
	c.Region = region
	c.require(createBlobStorageIntegrationRequestFieldRegion)
}

// SetAccessKeyID sets the AccessKeyID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetAccessKeyID(accessKeyID *string) {
	c.AccessKeyID = accessKeyID
	c.require(createBlobStorageIntegrationRequestFieldAccessKeyID)
}

// SetSecretAccessKey sets the SecretAccessKey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetSecretAccessKey(secretAccessKey *string) {
	c.SecretAccessKey = secretAccessKey
	c.require(createBlobStorageIntegrationRequestFieldSecretAccessKey)
}

// SetPrefix sets the Prefix field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetPrefix(prefix *string) {
	c.Prefix = prefix
	c.require(createBlobStorageIntegrationRequestFieldPrefix)
}

// SetExportFrequency sets the ExportFrequency field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetExportFrequency(exportFrequency BlobStorageExportFrequency) {
	c.ExportFrequency = exportFrequency
	c.require(createBlobStorageIntegrationRequestFieldExportFrequency)
}

// SetEnabled sets the Enabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetEnabled(enabled bool) {
	c.Enabled = enabled
	c.require(createBlobStorageIntegrationRequestFieldEnabled)
}

// SetForcePathStyle sets the ForcePathStyle field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetForcePathStyle(forcePathStyle bool) {
	c.ForcePathStyle = forcePathStyle
	c.require(createBlobStorageIntegrationRequestFieldForcePathStyle)
}

// SetFileType sets the FileType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetFileType(fileType BlobStorageIntegrationFileType) {
	c.FileType = fileType
	c.require(createBlobStorageIntegrationRequestFieldFileType)
}

// SetExportMode sets the ExportMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetExportMode(exportMode BlobStorageExportMode) {
	c.ExportMode = exportMode
	c.require(createBlobStorageIntegrationRequestFieldExportMode)
}

// SetExportStartDate sets the ExportStartDate field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateBlobStorageIntegrationRequest) SetExportStartDate(exportStartDate *time.Time) {
	c.ExportStartDate = exportStartDate
	c.require(createBlobStorageIntegrationRequestFieldExportStartDate)
}

func (c *CreateBlobStorageIntegrationRequest) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateBlobStorageIntegrationRequest
	var body unmarshaler
	if err := json.Unmarshal(data, &body); err != nil {
		return err
	}
	*c = CreateBlobStorageIntegrationRequest(body)
	return nil
}

func (c *CreateBlobStorageIntegrationRequest) MarshalJSON() ([]byte, error) {
	type embed CreateBlobStorageIntegrationRequest
	var marshaler = struct {
		embed
		ExportStartDate *internal.DateTime `json:"exportStartDate,omitempty"`
	}{
		embed:           embed(*c),
		ExportStartDate: internal.NewOptionalDateTime(c.ExportStartDate),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}
