// 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"
	"time"
)

type Zapsign string

const (
	ZapsignZapsign Zapsign = "zapsign"
)

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

type SourceZapsign struct {
	// Your static API token for authentication. You can find it in your ZapSign account under the 'Settings' or 'API' section. For more details, refer to the [Getting Started](https://docs.zapsign.com.br/english/getting-started#how-do-i-get-my-api-token) guide.
	APIToken string `json:"api_token"`
	// The signer ids for signer stream
	SignerIds  []any     `json:"signer_ids,omitempty"`
	StartDate  time.Time `json:"start_date"`
	sourceType Zapsign   `const:"zapsign" json:"sourceType"`
}

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

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

func (o *SourceZapsign) GetAPIToken() string {
	if o == nil {
		return ""
	}
	return o.APIToken
}

func (o *SourceZapsign) GetSignerIds() []any {
	if o == nil {
		return nil
	}
	return o.SignerIds
}

func (o *SourceZapsign) GetStartDate() time.Time {
	if o == nil {
		return time.Time{}
	}
	return o.StartDate
}

func (o *SourceZapsign) GetSourceType() Zapsign {
	return ZapsignZapsign
}
