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

const (
	WorkrampWorkramp Workramp = "workramp"
)

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

type SourceWorkramp struct {
	// The id of the Academy
	AcademyID string `json:"academy_id"`
	// The API Token for Workramp
	APIKey     string   `json:"api_key"`
	sourceType Workramp `const:"workramp" json:"sourceType"`
}

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

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

func (o *SourceWorkramp) GetAcademyID() string {
	if o == nil {
		return ""
	}
	return o.AcademyID
}

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

func (o *SourceWorkramp) GetSourceType() Workramp {
	return WorkrampWorkramp
}
