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

package shared

import (
	"encoding/json"
	"fmt"
)

type SourceZohoBillingUpdateRegion string

const (
	SourceZohoBillingUpdateRegionCom   SourceZohoBillingUpdateRegion = "com"
	SourceZohoBillingUpdateRegionEu    SourceZohoBillingUpdateRegion = "eu"
	SourceZohoBillingUpdateRegionIn    SourceZohoBillingUpdateRegion = "in"
	SourceZohoBillingUpdateRegionComCn SourceZohoBillingUpdateRegion = "com.cn"
	SourceZohoBillingUpdateRegionComAu SourceZohoBillingUpdateRegion = "com.au"
	SourceZohoBillingUpdateRegionJp    SourceZohoBillingUpdateRegion = "jp"
	SourceZohoBillingUpdateRegionSa    SourceZohoBillingUpdateRegion = "sa"
	SourceZohoBillingUpdateRegionCa    SourceZohoBillingUpdateRegion = "ca"
)

func (e SourceZohoBillingUpdateRegion) ToPointer() *SourceZohoBillingUpdateRegion {
	return &e
}
func (e *SourceZohoBillingUpdateRegion) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "com":
		fallthrough
	case "eu":
		fallthrough
	case "in":
		fallthrough
	case "com.cn":
		fallthrough
	case "com.au":
		fallthrough
	case "jp":
		fallthrough
	case "sa":
		fallthrough
	case "ca":
		*e = SourceZohoBillingUpdateRegion(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceZohoBillingUpdateRegion: %v", v)
	}
}

type SourceZohoBillingUpdate struct {
	ClientID     string                        `json:"client_id"`
	ClientSecret string                        `json:"client_secret"`
	RefreshToken string                        `json:"refresh_token"`
	Region       SourceZohoBillingUpdateRegion `json:"region"`
}

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

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

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

func (o *SourceZohoBillingUpdate) GetRegion() SourceZohoBillingUpdateRegion {
	if o == nil {
		return SourceZohoBillingUpdateRegion("")
	}
	return o.Region
}
