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

package shared

import (
	"encoding/json"
	"fmt"
)

// SourceZonkaFeedbackUpdateDataCenterID - The identifier for the data center, such as 'us1' or 'e' for EU.
type SourceZonkaFeedbackUpdateDataCenterID string

const (
	SourceZonkaFeedbackUpdateDataCenterIDUs1 SourceZonkaFeedbackUpdateDataCenterID = "us1"
	SourceZonkaFeedbackUpdateDataCenterIDE   SourceZonkaFeedbackUpdateDataCenterID = "e"
)

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

type SourceZonkaFeedbackUpdate struct {
	// Auth token to use. Generate it by navigating to Company Settings > Developers > API in your Zonka Feedback account.
	AuthToken string `json:"auth_token"`
	// The identifier for the data center, such as 'us1' or 'e' for EU.
	Datacenter SourceZonkaFeedbackUpdateDataCenterID `json:"datacenter"`
}

func (o *SourceZonkaFeedbackUpdate) GetAuthToken() string {
	if o == nil {
		return ""
	}
	return o.AuthToken
}

func (o *SourceZonkaFeedbackUpdate) GetDatacenter() SourceZonkaFeedbackUpdateDataCenterID {
	if o == nil {
		return SourceZonkaFeedbackUpdateDataCenterID("")
	}
	return o.Datacenter
}
