// 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 SourceMicrosoftSharepointUpdateSchemasAuthType string

const (
	SourceMicrosoftSharepointUpdateSchemasAuthTypeService SourceMicrosoftSharepointUpdateSchemasAuthType = "Service"
)

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

// SourceMicrosoftSharepointUpdateServiceKeyAuthentication - ServiceCredentials class for service key authentication.
// This class is structured similarly to OAuthCredentials but for a different authentication method.
type SourceMicrosoftSharepointUpdateServiceKeyAuthentication struct {
	authType *SourceMicrosoftSharepointUpdateSchemasAuthType `const:"Service" json:"auth_type"`
	// Client ID of your Microsoft developer application
	ClientID string `json:"client_id"`
	// Client Secret of your Microsoft developer application
	ClientSecret string `json:"client_secret"`
	// Tenant ID of the Microsoft SharePoint user
	TenantID string `json:"tenant_id"`
	// Special characters such as a period, comma, space, and the at sign (@) are converted to underscores (_). More details: https://learn.microsoft.com/en-us/sharepoint/list-onedrive-urls
	UserPrincipalName string `json:"user_principal_name"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateServiceKeyAuthentication) GetAuthType() *SourceMicrosoftSharepointUpdateSchemasAuthType {
	return SourceMicrosoftSharepointUpdateSchemasAuthTypeService.ToPointer()
}

func (o *SourceMicrosoftSharepointUpdateServiceKeyAuthentication) GetClientID() string {
	if o == nil {
		return ""
	}
	return o.ClientID
}

func (o *SourceMicrosoftSharepointUpdateServiceKeyAuthentication) GetClientSecret() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret
}

func (o *SourceMicrosoftSharepointUpdateServiceKeyAuthentication) GetTenantID() string {
	if o == nil {
		return ""
	}
	return o.TenantID
}

func (o *SourceMicrosoftSharepointUpdateServiceKeyAuthentication) GetUserPrincipalName() string {
	if o == nil {
		return ""
	}
	return o.UserPrincipalName
}

type SourceMicrosoftSharepointUpdateAuthType string

const (
	SourceMicrosoftSharepointUpdateAuthTypeClient SourceMicrosoftSharepointUpdateAuthType = "Client"
)

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

// SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth - OAuthCredentials class to hold authentication details for Microsoft OAuth authentication.
// This class uses pydantic for data validation and settings management.
type SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth struct {
	authType *SourceMicrosoftSharepointUpdateAuthType `const:"Client" json:"auth_type"`
	// Client ID of your Microsoft developer application
	ClientID string `json:"client_id"`
	// Client Secret of your Microsoft developer application
	ClientSecret string `json:"client_secret"`
	// Refresh Token of your Microsoft developer application
	RefreshToken *string `json:"refresh_token,omitempty"`
	// Tenant ID of the Microsoft SharePoint user
	TenantID string `json:"tenant_id"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) GetAuthType() *SourceMicrosoftSharepointUpdateAuthType {
	return SourceMicrosoftSharepointUpdateAuthTypeClient.ToPointer()
}

func (o *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) GetClientID() string {
	if o == nil {
		return ""
	}
	return o.ClientID
}

func (o *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) GetClientSecret() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret
}

func (o *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) GetRefreshToken() *string {
	if o == nil {
		return nil
	}
	return o.RefreshToken
}

func (o *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) GetTenantID() string {
	if o == nil {
		return ""
	}
	return o.TenantID
}

type SourceMicrosoftSharepointUpdateAuthenticationType string

const (
	SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth SourceMicrosoftSharepointUpdateAuthenticationType = "source-microsoft-sharepoint-update_Authenticate via Microsoft (OAuth)"
	SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateServiceKeyAuthentication      SourceMicrosoftSharepointUpdateAuthenticationType = "source-microsoft-sharepoint-update_Service Key Authentication"
)

// SourceMicrosoftSharepointUpdateAuthentication - Credentials for connecting to the One Drive API
type SourceMicrosoftSharepointUpdateAuthentication struct {
	SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth *SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateServiceKeyAuthentication      *SourceMicrosoftSharepointUpdateServiceKeyAuthentication      `queryParam:"inline"`

	Type SourceMicrosoftSharepointUpdateAuthenticationType
}

func CreateSourceMicrosoftSharepointUpdateAuthenticationSourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth(sourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth) SourceMicrosoftSharepointUpdateAuthentication {
	typ := SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth

	return SourceMicrosoftSharepointUpdateAuthentication{
		SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth: &sourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateAuthenticationSourceMicrosoftSharepointUpdateServiceKeyAuthentication(sourceMicrosoftSharepointUpdateServiceKeyAuthentication SourceMicrosoftSharepointUpdateServiceKeyAuthentication) SourceMicrosoftSharepointUpdateAuthentication {
	typ := SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateServiceKeyAuthentication

	return SourceMicrosoftSharepointUpdateAuthentication{
		SourceMicrosoftSharepointUpdateServiceKeyAuthentication: &sourceMicrosoftSharepointUpdateServiceKeyAuthentication,
		Type: typ,
	}
}

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

	var sourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth = SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth = &sourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth
		u.Type = SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateAuthenticateViaMicrosoftOAuth
		return nil
	}

	var sourceMicrosoftSharepointUpdateServiceKeyAuthentication SourceMicrosoftSharepointUpdateServiceKeyAuthentication = SourceMicrosoftSharepointUpdateServiceKeyAuthentication{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateServiceKeyAuthentication, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateServiceKeyAuthentication = &sourceMicrosoftSharepointUpdateServiceKeyAuthentication
		u.Type = SourceMicrosoftSharepointUpdateAuthenticationTypeSourceMicrosoftSharepointUpdateServiceKeyAuthentication
		return nil
	}

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

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

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

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

type SourceMicrosoftSharepointUpdateSchemasDeliveryType string

const (
	SourceMicrosoftSharepointUpdateSchemasDeliveryTypeUseFileTransfer SourceMicrosoftSharepointUpdateSchemasDeliveryType = "use_file_transfer"
)

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

// SourceMicrosoftSharepointUpdateCopyRawFiles - 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 SourceMicrosoftSharepointUpdateCopyRawFiles struct {
	deliveryType *SourceMicrosoftSharepointUpdateSchemasDeliveryType `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 SourceMicrosoftSharepointUpdateCopyRawFiles) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

func (o *SourceMicrosoftSharepointUpdateCopyRawFiles) GetDeliveryType() *SourceMicrosoftSharepointUpdateSchemasDeliveryType {
	return SourceMicrosoftSharepointUpdateSchemasDeliveryTypeUseFileTransfer.ToPointer()
}

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

type SourceMicrosoftSharepointUpdateDeliveryType string

const (
	SourceMicrosoftSharepointUpdateDeliveryTypeUseRecordsTransfer SourceMicrosoftSharepointUpdateDeliveryType = "use_records_transfer"
)

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

// SourceMicrosoftSharepointUpdateReplicateRecords - 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 SourceMicrosoftSharepointUpdateReplicateRecords struct {
	deliveryType *SourceMicrosoftSharepointUpdateDeliveryType `const:"use_records_transfer" json:"delivery_type"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateReplicateRecords) GetDeliveryType() *SourceMicrosoftSharepointUpdateDeliveryType {
	return SourceMicrosoftSharepointUpdateDeliveryTypeUseRecordsTransfer.ToPointer()
}

type SourceMicrosoftSharepointUpdateDeliveryMethodType string

const (
	SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateReplicateRecords SourceMicrosoftSharepointUpdateDeliveryMethodType = "source-microsoft-sharepoint-update_Replicate Records"
	SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateCopyRawFiles     SourceMicrosoftSharepointUpdateDeliveryMethodType = "source-microsoft-sharepoint-update_Copy Raw Files"
)

type SourceMicrosoftSharepointUpdateDeliveryMethod struct {
	SourceMicrosoftSharepointUpdateReplicateRecords *SourceMicrosoftSharepointUpdateReplicateRecords `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateCopyRawFiles     *SourceMicrosoftSharepointUpdateCopyRawFiles     `queryParam:"inline"`

	Type SourceMicrosoftSharepointUpdateDeliveryMethodType
}

func CreateSourceMicrosoftSharepointUpdateDeliveryMethodSourceMicrosoftSharepointUpdateReplicateRecords(sourceMicrosoftSharepointUpdateReplicateRecords SourceMicrosoftSharepointUpdateReplicateRecords) SourceMicrosoftSharepointUpdateDeliveryMethod {
	typ := SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateReplicateRecords

	return SourceMicrosoftSharepointUpdateDeliveryMethod{
		SourceMicrosoftSharepointUpdateReplicateRecords: &sourceMicrosoftSharepointUpdateReplicateRecords,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateDeliveryMethodSourceMicrosoftSharepointUpdateCopyRawFiles(sourceMicrosoftSharepointUpdateCopyRawFiles SourceMicrosoftSharepointUpdateCopyRawFiles) SourceMicrosoftSharepointUpdateDeliveryMethod {
	typ := SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateCopyRawFiles

	return SourceMicrosoftSharepointUpdateDeliveryMethod{
		SourceMicrosoftSharepointUpdateCopyRawFiles: &sourceMicrosoftSharepointUpdateCopyRawFiles,
		Type: typ,
	}
}

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

	var sourceMicrosoftSharepointUpdateReplicateRecords SourceMicrosoftSharepointUpdateReplicateRecords = SourceMicrosoftSharepointUpdateReplicateRecords{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateReplicateRecords, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateReplicateRecords = &sourceMicrosoftSharepointUpdateReplicateRecords
		u.Type = SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateReplicateRecords
		return nil
	}

	var sourceMicrosoftSharepointUpdateCopyRawFiles SourceMicrosoftSharepointUpdateCopyRawFiles = SourceMicrosoftSharepointUpdateCopyRawFiles{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateCopyRawFiles, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateCopyRawFiles = &sourceMicrosoftSharepointUpdateCopyRawFiles
		u.Type = SourceMicrosoftSharepointUpdateDeliveryMethodTypeSourceMicrosoftSharepointUpdateCopyRawFiles
		return nil
	}

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

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

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

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

// SourceMicrosoftSharepointUpdateSearchScope - Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' for all SharePoint drives the user can access, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both.
type SourceMicrosoftSharepointUpdateSearchScope string

const (
	SourceMicrosoftSharepointUpdateSearchScopeAccessibleDrives SourceMicrosoftSharepointUpdateSearchScope = "ACCESSIBLE_DRIVES"
	SourceMicrosoftSharepointUpdateSearchScopeSharedItems      SourceMicrosoftSharepointUpdateSearchScope = "SHARED_ITEMS"
	SourceMicrosoftSharepointUpdateSearchScopeAll              SourceMicrosoftSharepointUpdateSearchScope = "ALL"
)

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

type SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6Filetype string

const (
	SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6FiletypeExcel SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6Filetype = "excel"
)

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

type SourceMicrosoftSharepointUpdateExcelFormat struct {
	filetype *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6Filetype `const:"excel" json:"filetype"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateExcelFormat) GetFiletype() *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6Filetype {
	return SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormat6FiletypeExcel.ToPointer()
}

type SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletype string

const (
	SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletypeUnstructured SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletype = "unstructured"
)

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

type SourceMicrosoftSharepointUpdateMode string

const (
	SourceMicrosoftSharepointUpdateModeLocal SourceMicrosoftSharepointUpdateMode = "local"
)

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

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

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

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

func (o *SourceMicrosoftSharepointUpdateLocal) GetMode() *SourceMicrosoftSharepointUpdateMode {
	return SourceMicrosoftSharepointUpdateModeLocal.ToPointer()
}

type SourceMicrosoftSharepointUpdateProcessingType string

const (
	SourceMicrosoftSharepointUpdateProcessingTypeSourceMicrosoftSharepointUpdateLocal SourceMicrosoftSharepointUpdateProcessingType = "source-microsoft-sharepoint-update_Local"
)

// SourceMicrosoftSharepointUpdateProcessing - Processing configuration
type SourceMicrosoftSharepointUpdateProcessing struct {
	SourceMicrosoftSharepointUpdateLocal *SourceMicrosoftSharepointUpdateLocal `queryParam:"inline"`

	Type SourceMicrosoftSharepointUpdateProcessingType
}

func CreateSourceMicrosoftSharepointUpdateProcessingSourceMicrosoftSharepointUpdateLocal(sourceMicrosoftSharepointUpdateLocal SourceMicrosoftSharepointUpdateLocal) SourceMicrosoftSharepointUpdateProcessing {
	typ := SourceMicrosoftSharepointUpdateProcessingTypeSourceMicrosoftSharepointUpdateLocal

	return SourceMicrosoftSharepointUpdateProcessing{
		SourceMicrosoftSharepointUpdateLocal: &sourceMicrosoftSharepointUpdateLocal,
		Type:                                 typ,
	}
}

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

	var sourceMicrosoftSharepointUpdateLocal SourceMicrosoftSharepointUpdateLocal = SourceMicrosoftSharepointUpdateLocal{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateLocal, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateLocal = &sourceMicrosoftSharepointUpdateLocal
		u.Type = SourceMicrosoftSharepointUpdateProcessingTypeSourceMicrosoftSharepointUpdateLocal
		return nil
	}

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

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

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

// SourceMicrosoftSharepointUpdateParsingStrategy - 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 SourceMicrosoftSharepointUpdateParsingStrategy string

const (
	SourceMicrosoftSharepointUpdateParsingStrategyAuto    SourceMicrosoftSharepointUpdateParsingStrategy = "auto"
	SourceMicrosoftSharepointUpdateParsingStrategyFast    SourceMicrosoftSharepointUpdateParsingStrategy = "fast"
	SourceMicrosoftSharepointUpdateParsingStrategyOcrOnly SourceMicrosoftSharepointUpdateParsingStrategy = "ocr_only"
	SourceMicrosoftSharepointUpdateParsingStrategyHiRes   SourceMicrosoftSharepointUpdateParsingStrategy = "hi_res"
)

func (e SourceMicrosoftSharepointUpdateParsingStrategy) ToPointer() *SourceMicrosoftSharepointUpdateParsingStrategy {
	return &e
}
func (e *SourceMicrosoftSharepointUpdateParsingStrategy) 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 = SourceMicrosoftSharepointUpdateParsingStrategy(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceMicrosoftSharepointUpdateParsingStrategy: %v", v)
	}
}

// SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat - Extract text from document formats (.pdf, .docx, .md, .pptx) and emit as one record per file.
type SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat struct {
	filetype *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletype `const:"unstructured" json:"filetype"`
	// Processing configuration
	Processing *SourceMicrosoftSharepointUpdateProcessing `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 *SourceMicrosoftSharepointUpdateParsingStrategy `default:"auto" json:"strategy"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat) GetFiletype() *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletype {
	return SourceMicrosoftSharepointUpdateSchemasStreamsFormatFormatFiletypeUnstructured.ToPointer()
}

func (o *SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat) GetProcessing() *SourceMicrosoftSharepointUpdateProcessing {
	if o == nil {
		return nil
	}
	return o.Processing
}

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

func (o *SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat) GetStrategy() *SourceMicrosoftSharepointUpdateParsingStrategy {
	if o == nil {
		return nil
	}
	return o.Strategy
}

type SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletype string

const (
	SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletypeParquet SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletype = "parquet"
)

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

type SourceMicrosoftSharepointUpdateParquetFormat 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       *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletype `const:"parquet" json:"filetype"`
}

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

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

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

func (o *SourceMicrosoftSharepointUpdateParquetFormat) GetFiletype() *SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletype {
	return SourceMicrosoftSharepointUpdateSchemasStreamsFormatFiletypeParquet.ToPointer()
}

type SourceMicrosoftSharepointUpdateSchemasStreamsFiletype string

const (
	SourceMicrosoftSharepointUpdateSchemasStreamsFiletypeJsonl SourceMicrosoftSharepointUpdateSchemasStreamsFiletype = "jsonl"
)

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

type SourceMicrosoftSharepointUpdateJsonlFormat struct {
	filetype *SourceMicrosoftSharepointUpdateSchemasStreamsFiletype `const:"jsonl" json:"filetype"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateJsonlFormat) GetFiletype() *SourceMicrosoftSharepointUpdateSchemasStreamsFiletype {
	return SourceMicrosoftSharepointUpdateSchemasStreamsFiletypeJsonl.ToPointer()
}

type SourceMicrosoftSharepointUpdateSchemasFiletype string

const (
	SourceMicrosoftSharepointUpdateSchemasFiletypeCsv SourceMicrosoftSharepointUpdateSchemasFiletype = "csv"
)

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

type SourceMicrosoftSharepointUpdateSchemasStreamsHeaderDefinitionType string

const (
	SourceMicrosoftSharepointUpdateSchemasStreamsHeaderDefinitionTypeUserProvided SourceMicrosoftSharepointUpdateSchemasStreamsHeaderDefinitionType = "User Provided"
)

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

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

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

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

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

func (o *SourceMicrosoftSharepointUpdateUserProvided) GetHeaderDefinitionType() *SourceMicrosoftSharepointUpdateSchemasStreamsHeaderDefinitionType {
	return SourceMicrosoftSharepointUpdateSchemasStreamsHeaderDefinitionTypeUserProvided.ToPointer()
}

type SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionType string

const (
	SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionTypeAutogenerated SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionType = "Autogenerated"
)

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

type SourceMicrosoftSharepointUpdateAutogenerated struct {
	headerDefinitionType *SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionType `const:"Autogenerated" json:"header_definition_type"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateAutogenerated) GetHeaderDefinitionType() *SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionType {
	return SourceMicrosoftSharepointUpdateSchemasHeaderDefinitionTypeAutogenerated.ToPointer()
}

type SourceMicrosoftSharepointUpdateHeaderDefinitionType string

const (
	SourceMicrosoftSharepointUpdateHeaderDefinitionTypeFromCsv SourceMicrosoftSharepointUpdateHeaderDefinitionType = "From CSV"
)

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

type SourceMicrosoftSharepointUpdateFromCSV struct {
	headerDefinitionType *SourceMicrosoftSharepointUpdateHeaderDefinitionType `const:"From CSV" json:"header_definition_type"`
}

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

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

func (o *SourceMicrosoftSharepointUpdateFromCSV) GetHeaderDefinitionType() *SourceMicrosoftSharepointUpdateHeaderDefinitionType {
	return SourceMicrosoftSharepointUpdateHeaderDefinitionTypeFromCsv.ToPointer()
}

type SourceMicrosoftSharepointUpdateCSVHeaderDefinitionType string

const (
	SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateFromCSV       SourceMicrosoftSharepointUpdateCSVHeaderDefinitionType = "source-microsoft-sharepoint-update_From CSV"
	SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateAutogenerated SourceMicrosoftSharepointUpdateCSVHeaderDefinitionType = "source-microsoft-sharepoint-update_Autogenerated"
	SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateUserProvided  SourceMicrosoftSharepointUpdateCSVHeaderDefinitionType = "source-microsoft-sharepoint-update_User Provided"
)

// SourceMicrosoftSharepointUpdateCSVHeaderDefinition - 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 SourceMicrosoftSharepointUpdateCSVHeaderDefinition struct {
	SourceMicrosoftSharepointUpdateFromCSV       *SourceMicrosoftSharepointUpdateFromCSV       `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateAutogenerated *SourceMicrosoftSharepointUpdateAutogenerated `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateUserProvided  *SourceMicrosoftSharepointUpdateUserProvided  `queryParam:"inline"`

	Type SourceMicrosoftSharepointUpdateCSVHeaderDefinitionType
}

func CreateSourceMicrosoftSharepointUpdateCSVHeaderDefinitionSourceMicrosoftSharepointUpdateFromCSV(sourceMicrosoftSharepointUpdateFromCSV SourceMicrosoftSharepointUpdateFromCSV) SourceMicrosoftSharepointUpdateCSVHeaderDefinition {
	typ := SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateFromCSV

	return SourceMicrosoftSharepointUpdateCSVHeaderDefinition{
		SourceMicrosoftSharepointUpdateFromCSV: &sourceMicrosoftSharepointUpdateFromCSV,
		Type:                                   typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateCSVHeaderDefinitionSourceMicrosoftSharepointUpdateAutogenerated(sourceMicrosoftSharepointUpdateAutogenerated SourceMicrosoftSharepointUpdateAutogenerated) SourceMicrosoftSharepointUpdateCSVHeaderDefinition {
	typ := SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateAutogenerated

	return SourceMicrosoftSharepointUpdateCSVHeaderDefinition{
		SourceMicrosoftSharepointUpdateAutogenerated: &sourceMicrosoftSharepointUpdateAutogenerated,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateCSVHeaderDefinitionSourceMicrosoftSharepointUpdateUserProvided(sourceMicrosoftSharepointUpdateUserProvided SourceMicrosoftSharepointUpdateUserProvided) SourceMicrosoftSharepointUpdateCSVHeaderDefinition {
	typ := SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateUserProvided

	return SourceMicrosoftSharepointUpdateCSVHeaderDefinition{
		SourceMicrosoftSharepointUpdateUserProvided: &sourceMicrosoftSharepointUpdateUserProvided,
		Type: typ,
	}
}

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

	var sourceMicrosoftSharepointUpdateFromCSV SourceMicrosoftSharepointUpdateFromCSV = SourceMicrosoftSharepointUpdateFromCSV{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateFromCSV, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateFromCSV = &sourceMicrosoftSharepointUpdateFromCSV
		u.Type = SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateFromCSV
		return nil
	}

	var sourceMicrosoftSharepointUpdateAutogenerated SourceMicrosoftSharepointUpdateAutogenerated = SourceMicrosoftSharepointUpdateAutogenerated{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateAutogenerated, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateAutogenerated = &sourceMicrosoftSharepointUpdateAutogenerated
		u.Type = SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateAutogenerated
		return nil
	}

	var sourceMicrosoftSharepointUpdateUserProvided SourceMicrosoftSharepointUpdateUserProvided = SourceMicrosoftSharepointUpdateUserProvided{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateUserProvided, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateUserProvided = &sourceMicrosoftSharepointUpdateUserProvided
		u.Type = SourceMicrosoftSharepointUpdateCSVHeaderDefinitionTypeSourceMicrosoftSharepointUpdateUserProvided
		return nil
	}

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

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

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

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

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

type SourceMicrosoftSharepointUpdateCSVFormat 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    *SourceMicrosoftSharepointUpdateSchemasFiletype `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 *SourceMicrosoftSharepointUpdateCSVHeaderDefinition `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 SourceMicrosoftSharepointUpdateCSVFormat) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

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

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

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

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

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

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

func (o *SourceMicrosoftSharepointUpdateCSVFormat) GetFiletype() *SourceMicrosoftSharepointUpdateSchemasFiletype {
	return SourceMicrosoftSharepointUpdateSchemasFiletypeCsv.ToPointer()
}

func (o *SourceMicrosoftSharepointUpdateCSVFormat) GetHeaderDefinition() *SourceMicrosoftSharepointUpdateCSVHeaderDefinition {
	if o == nil {
		return nil
	}
	return o.HeaderDefinition
}

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

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

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

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

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

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

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

type SourceMicrosoftSharepointUpdateFiletype string

const (
	SourceMicrosoftSharepointUpdateFiletypeAvro SourceMicrosoftSharepointUpdateFiletype = "avro"
)

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

type SourceMicrosoftSharepointUpdateAvroFormat 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       *SourceMicrosoftSharepointUpdateFiletype `const:"avro" json:"filetype"`
}

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

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

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

func (o *SourceMicrosoftSharepointUpdateAvroFormat) GetFiletype() *SourceMicrosoftSharepointUpdateFiletype {
	return SourceMicrosoftSharepointUpdateFiletypeAvro.ToPointer()
}

type SourceMicrosoftSharepointUpdateFormatType string

const (
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateAvroFormat                 SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_Avro Format"
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateCSVFormat                  SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_CSV Format"
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateJsonlFormat                SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_Jsonl Format"
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateParquetFormat              SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_Parquet Format"
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateUnstructuredDocumentFormat SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_Unstructured Document Format"
	SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateExcelFormat                SourceMicrosoftSharepointUpdateFormatType = "source-microsoft-sharepoint-update_Excel Format"
)

// SourceMicrosoftSharepointUpdateFormat - The configuration options that are used to alter how to read incoming files that deviate from the standard formatting.
type SourceMicrosoftSharepointUpdateFormat struct {
	SourceMicrosoftSharepointUpdateAvroFormat                 *SourceMicrosoftSharepointUpdateAvroFormat                 `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateCSVFormat                  *SourceMicrosoftSharepointUpdateCSVFormat                  `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateJsonlFormat                *SourceMicrosoftSharepointUpdateJsonlFormat                `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateParquetFormat              *SourceMicrosoftSharepointUpdateParquetFormat              `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat *SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat `queryParam:"inline"`
	SourceMicrosoftSharepointUpdateExcelFormat                *SourceMicrosoftSharepointUpdateExcelFormat                `queryParam:"inline"`

	Type SourceMicrosoftSharepointUpdateFormatType
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateAvroFormat(sourceMicrosoftSharepointUpdateAvroFormat SourceMicrosoftSharepointUpdateAvroFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateAvroFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateAvroFormat: &sourceMicrosoftSharepointUpdateAvroFormat,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateCSVFormat(sourceMicrosoftSharepointUpdateCSVFormat SourceMicrosoftSharepointUpdateCSVFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateCSVFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateCSVFormat: &sourceMicrosoftSharepointUpdateCSVFormat,
		Type:                                     typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateJsonlFormat(sourceMicrosoftSharepointUpdateJsonlFormat SourceMicrosoftSharepointUpdateJsonlFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateJsonlFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateJsonlFormat: &sourceMicrosoftSharepointUpdateJsonlFormat,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateParquetFormat(sourceMicrosoftSharepointUpdateParquetFormat SourceMicrosoftSharepointUpdateParquetFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateParquetFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateParquetFormat: &sourceMicrosoftSharepointUpdateParquetFormat,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateUnstructuredDocumentFormat(sourceMicrosoftSharepointUpdateUnstructuredDocumentFormat SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateUnstructuredDocumentFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat: &sourceMicrosoftSharepointUpdateUnstructuredDocumentFormat,
		Type: typ,
	}
}

func CreateSourceMicrosoftSharepointUpdateFormatSourceMicrosoftSharepointUpdateExcelFormat(sourceMicrosoftSharepointUpdateExcelFormat SourceMicrosoftSharepointUpdateExcelFormat) SourceMicrosoftSharepointUpdateFormat {
	typ := SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateExcelFormat

	return SourceMicrosoftSharepointUpdateFormat{
		SourceMicrosoftSharepointUpdateExcelFormat: &sourceMicrosoftSharepointUpdateExcelFormat,
		Type: typ,
	}
}

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

	var sourceMicrosoftSharepointUpdateJsonlFormat SourceMicrosoftSharepointUpdateJsonlFormat = SourceMicrosoftSharepointUpdateJsonlFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateJsonlFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateJsonlFormat = &sourceMicrosoftSharepointUpdateJsonlFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateJsonlFormat
		return nil
	}

	var sourceMicrosoftSharepointUpdateExcelFormat SourceMicrosoftSharepointUpdateExcelFormat = SourceMicrosoftSharepointUpdateExcelFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateExcelFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateExcelFormat = &sourceMicrosoftSharepointUpdateExcelFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateExcelFormat
		return nil
	}

	var sourceMicrosoftSharepointUpdateAvroFormat SourceMicrosoftSharepointUpdateAvroFormat = SourceMicrosoftSharepointUpdateAvroFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateAvroFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateAvroFormat = &sourceMicrosoftSharepointUpdateAvroFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateAvroFormat
		return nil
	}

	var sourceMicrosoftSharepointUpdateParquetFormat SourceMicrosoftSharepointUpdateParquetFormat = SourceMicrosoftSharepointUpdateParquetFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateParquetFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateParquetFormat = &sourceMicrosoftSharepointUpdateParquetFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateParquetFormat
		return nil
	}

	var sourceMicrosoftSharepointUpdateUnstructuredDocumentFormat SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat = SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateUnstructuredDocumentFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateUnstructuredDocumentFormat = &sourceMicrosoftSharepointUpdateUnstructuredDocumentFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateUnstructuredDocumentFormat
		return nil
	}

	var sourceMicrosoftSharepointUpdateCSVFormat SourceMicrosoftSharepointUpdateCSVFormat = SourceMicrosoftSharepointUpdateCSVFormat{}
	if err := utils.UnmarshalJSON(data, &sourceMicrosoftSharepointUpdateCSVFormat, "", true, true); err == nil {
		u.SourceMicrosoftSharepointUpdateCSVFormat = &sourceMicrosoftSharepointUpdateCSVFormat
		u.Type = SourceMicrosoftSharepointUpdateFormatTypeSourceMicrosoftSharepointUpdateCSVFormat
		return nil
	}

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

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

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

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

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

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

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

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

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

const (
	SourceMicrosoftSharepointUpdateValidationPolicyEmitRecord      SourceMicrosoftSharepointUpdateValidationPolicy = "Emit Record"
	SourceMicrosoftSharepointUpdateValidationPolicySkipRecord      SourceMicrosoftSharepointUpdateValidationPolicy = "Skip Record"
	SourceMicrosoftSharepointUpdateValidationPolicyWaitForDiscover SourceMicrosoftSharepointUpdateValidationPolicy = "Wait for Discover"
)

func (e SourceMicrosoftSharepointUpdateValidationPolicy) ToPointer() *SourceMicrosoftSharepointUpdateValidationPolicy {
	return &e
}
func (e *SourceMicrosoftSharepointUpdateValidationPolicy) 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 = SourceMicrosoftSharepointUpdateValidationPolicy(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceMicrosoftSharepointUpdateValidationPolicy: %v", v)
	}
}

type SourceMicrosoftSharepointUpdateFileBasedStreamConfig 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 SourceMicrosoftSharepointUpdateFormat `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 *SourceMicrosoftSharepointUpdateValidationPolicy `default:"Emit Record" json:"validation_policy"`
}

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

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

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

func (o *SourceMicrosoftSharepointUpdateFileBasedStreamConfig) GetFormat() SourceMicrosoftSharepointUpdateFormat {
	if o == nil {
		return SourceMicrosoftSharepointUpdateFormat{}
	}
	return o.Format
}

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

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

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

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

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

func (o *SourceMicrosoftSharepointUpdateFileBasedStreamConfig) GetValidationPolicy() *SourceMicrosoftSharepointUpdateValidationPolicy {
	if o == nil {
		return nil
	}
	return o.ValidationPolicy
}

// SourceMicrosoftSharepointUpdate - SourceMicrosoftSharePointSpec class for Microsoft SharePoint Source Specification.
// This class combines the authentication details with additional configuration for the SharePoint API.
type SourceMicrosoftSharepointUpdate struct {
	// Credentials for connecting to the One Drive API
	Credentials    SourceMicrosoftSharepointUpdateAuthentication  `json:"credentials"`
	DeliveryMethod *SourceMicrosoftSharepointUpdateDeliveryMethod `json:"delivery_method,omitempty"`
	// Path to a specific folder within the drives to search for files. Leave empty to search all folders of the drives. This does not apply to shared items.
	FolderPath *string `default:"." json:"folder_path"`
	// Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' for all SharePoint drives the user can access, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both.
	SearchScope *SourceMicrosoftSharepointUpdateSearchScope `default:"ALL" json:"search_scope"`
	// Url of SharePoint site to search for files. Leave empty to search in the main site. Use 'https://<tenant_name>.sharepoint.com/sites/' to iterate over all sites.
	SiteURL *string `default:"" json:"site_url"`
	// 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 []SourceMicrosoftSharepointUpdateFileBasedStreamConfig `json:"streams"`
}

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

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

func (o *SourceMicrosoftSharepointUpdate) GetCredentials() SourceMicrosoftSharepointUpdateAuthentication {
	if o == nil {
		return SourceMicrosoftSharepointUpdateAuthentication{}
	}
	return o.Credentials
}

func (o *SourceMicrosoftSharepointUpdate) GetDeliveryMethod() *SourceMicrosoftSharepointUpdateDeliveryMethod {
	if o == nil {
		return nil
	}
	return o.DeliveryMethod
}

func (o *SourceMicrosoftSharepointUpdate) GetFolderPath() *string {
	if o == nil {
		return nil
	}
	return o.FolderPath
}

func (o *SourceMicrosoftSharepointUpdate) GetSearchScope() *SourceMicrosoftSharepointUpdateSearchScope {
	if o == nil {
		return nil
	}
	return o.SearchScope
}

func (o *SourceMicrosoftSharepointUpdate) GetSiteURL() *string {
	if o == nil {
		return nil
	}
	return o.SiteURL
}

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

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