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

package shared

import (
	"encoding/json"
	"fmt"
)

// SourceVitallyUpdateStatus - Status of the Vitally accounts. One of the following values; active, churned, activeOrChurned.
type SourceVitallyUpdateStatus string

const (
	SourceVitallyUpdateStatusActive          SourceVitallyUpdateStatus = "active"
	SourceVitallyUpdateStatusChurned         SourceVitallyUpdateStatus = "churned"
	SourceVitallyUpdateStatusActiveOrChurned SourceVitallyUpdateStatus = "activeOrChurned"
)

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

type SourceVitallyUpdate struct {
	// Basic Auth Header
	BasicAuthHeader *string `json:"basic_auth_header,omitempty"`
	// Provide only the subdomain part, like https://{your-custom-subdomain}.rest.vitally.io/.  Keep empty if you don't have a subdomain.
	Domain string `json:"domain"`
	// sk_live_secret_token
	SecretToken string `json:"secret_token"`
	// Status of the Vitally accounts. One of the following values; active, churned, activeOrChurned.
	Status SourceVitallyUpdateStatus `json:"status"`
}

func (o *SourceVitallyUpdate) GetBasicAuthHeader() *string {
	if o == nil {
		return nil
	}
	return o.BasicAuthHeader
}

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

func (o *SourceVitallyUpdate) GetSecretToken() string {
	if o == nil {
		return ""
	}
	return o.SecretToken
}

func (o *SourceVitallyUpdate) GetStatus() SourceVitallyUpdateStatus {
	if o == nil {
		return SourceVitallyUpdateStatus("")
	}
	return o.Status
}
