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

const (
	CiscoMerakiCiscoMeraki CiscoMeraki = "cisco-meraki"
)

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

type SourceCiscoMeraki struct {
	// Your Meraki API key. Obtain it by logging into your Meraki Dashboard at https://dashboard.meraki.com/, navigating to 'My Profile' via the avatar icon in the top right corner, and generating the API key. Save this key securely as it represents your admin credentials.
	APIKey     string      `json:"api_key"`
	StartDate  time.Time   `json:"start_date"`
	sourceType CiscoMeraki `const:"cisco-meraki" json:"sourceType"`
}

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

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

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

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

func (o *SourceCiscoMeraki) GetSourceType() CiscoMeraki {
	return CiscoMerakiCiscoMeraki
}
