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

package shared

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

type MicrosoftLists string

const (
	MicrosoftListsMicrosoftLists MicrosoftLists = "microsoft-lists"
)

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

type SourceMicrosoftLists struct {
	ApplicationIDURI string         `json:"application_id_uri"`
	ClientID         string         `json:"client_id"`
	ClientSecret     string         `json:"client_secret"`
	Domain           string         `json:"domain"`
	SiteID           string         `json:"site_id"`
	TenantID         string         `json:"tenant_id"`
	sourceType       MicrosoftLists `const:"microsoft-lists" json:"sourceType"`
}

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

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

func (o *SourceMicrosoftLists) GetApplicationIDURI() string {
	if o == nil {
		return ""
	}
	return o.ApplicationIDURI
}

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

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

func (o *SourceMicrosoftLists) GetDomain() string {
	if o == nil {
		return ""
	}
	return o.Domain
}

func (o *SourceMicrosoftLists) GetSiteID() string {
	if o == nil {
		return ""
	}
	return o.SiteID
}

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

func (o *SourceMicrosoftLists) GetSourceType() MicrosoftLists {
	return MicrosoftListsMicrosoftLists
}
