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

package shared

import (
	"encoding/json"
	"fmt"
)

// SourceConcordUpdateEnvironment - The environment from where you want to access the API.
type SourceConcordUpdateEnvironment string

const (
	SourceConcordUpdateEnvironmentUat SourceConcordUpdateEnvironment = "uat"
	SourceConcordUpdateEnvironmentAPI SourceConcordUpdateEnvironment = "api"
)

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

type SourceConcordUpdate struct {
	APIKey string `json:"api_key"`
	// The environment from where you want to access the API.
	Env SourceConcordUpdateEnvironment `json:"env"`
}

func (o *SourceConcordUpdate) GetAPIKey() string {
	if o == nil {
		return ""
	}
	return o.APIKey
}

func (o *SourceConcordUpdate) GetEnv() SourceConcordUpdateEnvironment {
	if o == nil {
		return SourceConcordUpdateEnvironment("")
	}
	return o.Env
}
