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

type SigmaComputing string

const (
	SigmaComputingSigmaComputing SigmaComputing = "sigma-computing"
)

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

type SourceSigmaComputing struct {
	// The base url of your sigma organization
	BaseURL            string `json:"base_url"`
	ClientID           string `json:"client_id"`
	ClientRefreshToken string `json:"client_refresh_token"`
	ClientSecret       string `json:"client_secret"`
	// The current access token. This field might be overridden by the connector based on the token refresh endpoint response.
	OauthAccessToken *string `json:"oauth_access_token,omitempty"`
	// The date the current access token expires in. This field might be overridden by the connector based on the token refresh endpoint response.
	OauthTokenExpiryDate *time.Time     `json:"oauth_token_expiry_date,omitempty"`
	sourceType           SigmaComputing `const:"sigma-computing" json:"sourceType"`
}

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

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

func (o *SourceSigmaComputing) GetBaseURL() string {
	if o == nil {
		return ""
	}
	return o.BaseURL
}

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

func (o *SourceSigmaComputing) GetClientRefreshToken() string {
	if o == nil {
		return ""
	}
	return o.ClientRefreshToken
}

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

func (o *SourceSigmaComputing) GetOauthAccessToken() *string {
	if o == nil {
		return nil
	}
	return o.OauthAccessToken
}

func (o *SourceSigmaComputing) GetOauthTokenExpiryDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.OauthTokenExpiryDate
}

func (o *SourceSigmaComputing) GetSourceType() SigmaComputing {
	return SigmaComputingSigmaComputing
}
