// 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 MailjetMail string

const (
	MailjetMailMailjetMail MailjetMail = "mailjet-mail"
)

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

type SourceMailjetMail struct {
	// Your API Key. See <a href="https://dev.mailjet.com/email/guides/#authentication">here</a>.
	APIKey string `json:"api_key"`
	// Your API Secret Key. See <a href="https://dev.mailjet.com/email/guides/#authentication">here</a>.
	APIKeySecret string      `json:"api_key_secret"`
	sourceType   MailjetMail `const:"mailjet-mail" json:"sourceType"`
}

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

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

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

func (o *SourceMailjetMail) GetAPIKeySecret() string {
	if o == nil {
		return ""
	}
	return o.APIKeySecret
}

func (o *SourceMailjetMail) GetSourceType() MailjetMail {
	return MailjetMailMailjetMail
}
