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

const (
	KekaKeka Keka = "keka"
)

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

type SourceKeka struct {
	APIKey string `json:"api_key"`
	// Your client identifier for authentication.
	ClientID string `json:"client_id"`
	// Your client secret for secure authentication.
	ClientSecret string `json:"client_secret"`
	GrantType    string `json:"grant_type"`
	Scope        string `json:"scope"`
	sourceType   Keka   `const:"keka" json:"sourceType"`
}

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

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

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

func (o *SourceKeka) GetClientID() string {
	if o == nil {
		return ""
	}
	return o.ClientID
}

func (o *SourceKeka) GetClientSecret() string {
	if o == nil {
		return ""
	}
	return o.ClientSecret
}

func (o *SourceKeka) GetGrantType() string {
	if o == nil {
		return ""
	}
	return o.GrantType
}

func (o *SourceKeka) GetScope() string {
	if o == nil {
		return ""
	}
	return o.Scope
}

func (o *SourceKeka) GetSourceType() Keka {
	return KekaKeka
}
