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

const (
	LookerLooker Looker = "looker"
)

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

type SourceLooker struct {
	// The Client ID is first part of an API3 key that is specific to each Looker user. See the <a href="https://docs.airbyte.com/integrations/sources/looker">docs</a> for more information on how to generate this key.
	ClientID string `json:"client_id"`
	// The Client Secret is second part of an API3 key.
	ClientSecret string `json:"client_secret"`
	// Domain for your Looker account, e.g. airbyte.cloud.looker.com,looker.[clientname].com,IP address
	Domain string `json:"domain"`
	// The IDs of any Looks to run
	RunLookIds []string `json:"run_look_ids,omitempty"`
	sourceType Looker   `const:"looker" json:"sourceType"`
}

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

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

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

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

func (o *SourceLooker) GetDomain() string {
	if o == nil {
		return ""
	}
	return o.Domain
}

func (o *SourceLooker) GetRunLookIds() []string {
	if o == nil {
		return nil
	}
	return o.RunLookIds
}

func (o *SourceLooker) GetSourceType() Looker {
	return LookerLooker
}
