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

const (
	AzureTableAzureTable AzureTable = "azure-table"
)

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

type SourceAzureTable struct {
	// Azure Table Storage Access Key. See the <a href="https://docs.airbyte.com/integrations/sources/azure-table">docs</a> for more information on how to obtain this key.
	StorageAccessKey string `json:"storage_access_key"`
	// The name of your storage account.
	StorageAccountName string `json:"storage_account_name"`
	// Azure Table Storage service account URL suffix. See the <a href="https://docs.airbyte.com/integrations/sources/azure-table">docs</a> for more information on how to obtain endpoint suffix
	StorageEndpointSuffix *string    `default:"core.windows.net" json:"storage_endpoint_suffix"`
	sourceType            AzureTable `const:"azure-table" json:"sourceType"`
}

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

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

func (o *SourceAzureTable) GetStorageAccessKey() string {
	if o == nil {
		return ""
	}
	return o.StorageAccessKey
}

func (o *SourceAzureTable) GetStorageAccountName() string {
	if o == nil {
		return ""
	}
	return o.StorageAccountName
}

func (o *SourceAzureTable) GetStorageEndpointSuffix() *string {
	if o == nil {
		return nil
	}
	return o.StorageEndpointSuffix
}

func (o *SourceAzureTable) GetSourceType() AzureTable {
	return AzureTableAzureTable
}
