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

package shared

import (
	"encoding/json"
	"fmt"
)

type SourceZohoCampaignUpdateDataCenter string

const (
	SourceZohoCampaignUpdateDataCenterCom      SourceZohoCampaignUpdateDataCenter = "com"
	SourceZohoCampaignUpdateDataCenterEu       SourceZohoCampaignUpdateDataCenter = "eu"
	SourceZohoCampaignUpdateDataCenterIn       SourceZohoCampaignUpdateDataCenter = "in"
	SourceZohoCampaignUpdateDataCenterComAu    SourceZohoCampaignUpdateDataCenter = "com.au"
	SourceZohoCampaignUpdateDataCenterDotJp    SourceZohoCampaignUpdateDataCenter = ".jp"
	SourceZohoCampaignUpdateDataCenterDotComCn SourceZohoCampaignUpdateDataCenter = ".com.cn"
)

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

type SourceZohoCampaignUpdate struct {
	ClientID2          string                             `json:"client_id_2"`
	ClientRefreshToken string                             `json:"client_refresh_token"`
	ClientSecret2      string                             `json:"client_secret_2"`
	DataCenter         SourceZohoCampaignUpdateDataCenter `json:"data_center"`
}

func (o *SourceZohoCampaignUpdate) GetClientID2() string {
	if o == nil {
		return ""
	}
	return o.ClientID2
}

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

func (o *SourceZohoCampaignUpdate) GetClientSecret2() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret2
}

func (o *SourceZohoCampaignUpdate) GetDataCenter() SourceZohoCampaignUpdateDataCenter {
	if o == nil {
		return SourceZohoCampaignUpdateDataCenter("")
	}
	return o.DataCenter
}
