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

package shared

import (
	"encoding/json"
	"fmt"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
)

type TyntecSms string

const (
	TyntecSmsTyntecSms TyntecSms = "tyntec-sms"
)

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

type SourceTyntecSms struct {
	// Your Tyntec API Key. See <a href="https://www.tyntec.com/docs/docs-center-sms-api-quick-start">here</a>
	APIKey string `json:"api_key"`
	// The phone number of the SMS message sender (international).
	From string `json:"from"`
	// The content of the SMS message to be sent.
	Message *string `json:"message,omitempty"`
	// The phone number of the SMS message recipient (international).
	To         string    `json:"to"`
	sourceType TyntecSms `const:"tyntec-sms" json:"sourceType"`
}

func (s SourceTyntecSms) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceTyntecSms) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
		return err
	}
	return nil
}

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

func (o *SourceTyntecSms) GetFrom() string {
	if o == nil {
		return ""
	}
	return o.From
}

func (o *SourceTyntecSms) GetMessage() *string {
	if o == nil {
		return nil
	}
	return o.Message
}

func (o *SourceTyntecSms) GetTo() string {
	if o == nil {
		return ""
	}
	return o.To
}

func (o *SourceTyntecSms) GetSourceType() TyntecSms {
	return TyntecSmsTyntecSms
}
