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

const (
	GongGong Gong = "gong"
)

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

type SourceGong struct {
	// Gong Access Key
	AccessKey string `json:"access_key"`
	// Gong Access Key Secret
	AccessKeySecret string `json:"access_key_secret"`
	// The date from which to list calls, in the ISO-8601 format; if not specified, the calls start with the earliest recorded call. For web-conference calls recorded by Gong, the date denotes its scheduled time, otherwise, it denotes its actual start time.
	StartDate  *string `json:"start_date,omitempty"`
	sourceType Gong    `const:"gong" json:"sourceType"`
}

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

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

func (o *SourceGong) GetAccessKey() string {
	if o == nil {
		return ""
	}
	return o.AccessKey
}

func (o *SourceGong) GetAccessKeySecret() string {
	if o == nil {
		return ""
	}
	return o.AccessKeySecret
}

func (o *SourceGong) GetStartDate() *string {
	if o == nil {
		return nil
	}
	return o.StartDate
}

func (o *SourceGong) GetSourceType() Gong {
	return GongGong
}
