// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package shared

import (
	"encoding/json"
	"errors"
	"fmt"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
	"time"
)

// ValidAdStatuses - An enumeration.
type ValidAdStatuses string

const (
	ValidAdStatusesActive             ValidAdStatuses = "ACTIVE"
	ValidAdStatusesAdsetPaused        ValidAdStatuses = "ADSET_PAUSED"
	ValidAdStatusesArchived           ValidAdStatuses = "ARCHIVED"
	ValidAdStatusesCampaignPaused     ValidAdStatuses = "CAMPAIGN_PAUSED"
	ValidAdStatusesDeleted            ValidAdStatuses = "DELETED"
	ValidAdStatusesDisapproved        ValidAdStatuses = "DISAPPROVED"
	ValidAdStatusesInProcess          ValidAdStatuses = "IN_PROCESS"
	ValidAdStatusesPaused             ValidAdStatuses = "PAUSED"
	ValidAdStatusesPendingBillingInfo ValidAdStatuses = "PENDING_BILLING_INFO"
	ValidAdStatusesPendingReview      ValidAdStatuses = "PENDING_REVIEW"
	ValidAdStatusesPreapproved        ValidAdStatuses = "PREAPPROVED"
	ValidAdStatusesWithIssues         ValidAdStatuses = "WITH_ISSUES"
)

func (e ValidAdStatuses) ToPointer() *ValidAdStatuses {
	return &e
}
func (e *ValidAdStatuses) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "ACTIVE":
		fallthrough
	case "ADSET_PAUSED":
		fallthrough
	case "ARCHIVED":
		fallthrough
	case "CAMPAIGN_PAUSED":
		fallthrough
	case "DELETED":
		fallthrough
	case "DISAPPROVED":
		fallthrough
	case "IN_PROCESS":
		fallthrough
	case "PAUSED":
		fallthrough
	case "PENDING_BILLING_INFO":
		fallthrough
	case "PENDING_REVIEW":
		fallthrough
	case "PREAPPROVED":
		fallthrough
	case "WITH_ISSUES":
		*e = ValidAdStatuses(v)
		return nil
	default:
		return fmt.Errorf("invalid value for ValidAdStatuses: %v", v)
	}
}

// ValidAdSetStatuses - An enumeration.
type ValidAdSetStatuses string

const (
	ValidAdSetStatusesActive         ValidAdSetStatuses = "ACTIVE"
	ValidAdSetStatusesArchived       ValidAdSetStatuses = "ARCHIVED"
	ValidAdSetStatusesCampaignPaused ValidAdSetStatuses = "CAMPAIGN_PAUSED"
	ValidAdSetStatusesDeleted        ValidAdSetStatuses = "DELETED"
	ValidAdSetStatusesInProcess      ValidAdSetStatuses = "IN_PROCESS"
	ValidAdSetStatusesPaused         ValidAdSetStatuses = "PAUSED"
	ValidAdSetStatusesWithIssues     ValidAdSetStatuses = "WITH_ISSUES"
)

func (e ValidAdSetStatuses) ToPointer() *ValidAdSetStatuses {
	return &e
}
func (e *ValidAdSetStatuses) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "ACTIVE":
		fallthrough
	case "ARCHIVED":
		fallthrough
	case "CAMPAIGN_PAUSED":
		fallthrough
	case "DELETED":
		fallthrough
	case "IN_PROCESS":
		fallthrough
	case "PAUSED":
		fallthrough
	case "WITH_ISSUES":
		*e = ValidAdSetStatuses(v)
		return nil
	default:
		return fmt.Errorf("invalid value for ValidAdSetStatuses: %v", v)
	}
}

// ValidCampaignStatuses - An enumeration.
type ValidCampaignStatuses string

const (
	ValidCampaignStatusesActive     ValidCampaignStatuses = "ACTIVE"
	ValidCampaignStatusesArchived   ValidCampaignStatuses = "ARCHIVED"
	ValidCampaignStatusesDeleted    ValidCampaignStatuses = "DELETED"
	ValidCampaignStatusesInProcess  ValidCampaignStatuses = "IN_PROCESS"
	ValidCampaignStatusesPaused     ValidCampaignStatuses = "PAUSED"
	ValidCampaignStatusesWithIssues ValidCampaignStatuses = "WITH_ISSUES"
)

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

type SourceFacebookMarketingSchemasAuthType string

const (
	SourceFacebookMarketingSchemasAuthTypeService SourceFacebookMarketingSchemasAuthType = "Service"
)

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

type ServiceAccountKeyAuthentication struct {
	// The value of the generated access token. From your App’s Dashboard, click on "Marketing API" then "Tools". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on "Get token". See the <a href="https://docs.airbyte.com/integrations/sources/facebook-marketing">docs</a> for more information.
	AccessToken string                                  `json:"access_token"`
	authType    *SourceFacebookMarketingSchemasAuthType `const:"Service" json:"auth_type"`
}

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

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

func (o *ServiceAccountKeyAuthentication) GetAccessToken() string {
	if o == nil {
		return ""
	}
	return o.AccessToken
}

func (o *ServiceAccountKeyAuthentication) GetAuthType() *SourceFacebookMarketingSchemasAuthType {
	return SourceFacebookMarketingSchemasAuthTypeService.ToPointer()
}

type SourceFacebookMarketingAuthType string

const (
	SourceFacebookMarketingAuthTypeClient SourceFacebookMarketingAuthType = "Client"
)

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

type AuthenticateViaFacebookMarketingOauth struct {
	// The value of the generated access token. From your App’s Dashboard, click on "Marketing API" then "Tools". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on "Get token". See the <a href="https://docs.airbyte.com/integrations/sources/facebook-marketing">docs</a> for more information.
	AccessToken *string                          `json:"access_token,omitempty"`
	authType    *SourceFacebookMarketingAuthType `const:"Client" json:"auth_type"`
	// Client ID for the Facebook Marketing API
	ClientID string `json:"client_id"`
	// Client Secret for the Facebook Marketing API
	ClientSecret string `json:"client_secret"`
}

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

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

func (o *AuthenticateViaFacebookMarketingOauth) GetAccessToken() *string {
	if o == nil {
		return nil
	}
	return o.AccessToken
}

func (o *AuthenticateViaFacebookMarketingOauth) GetAuthType() *SourceFacebookMarketingAuthType {
	return SourceFacebookMarketingAuthTypeClient.ToPointer()
}

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

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

type SourceFacebookMarketingAuthenticationType string

const (
	SourceFacebookMarketingAuthenticationTypeAuthenticateViaFacebookMarketingOauth SourceFacebookMarketingAuthenticationType = "Authenticate via Facebook Marketing (Oauth)"
	SourceFacebookMarketingAuthenticationTypeServiceAccountKeyAuthentication       SourceFacebookMarketingAuthenticationType = "Service Account Key Authentication"
)

// SourceFacebookMarketingAuthentication - Credentials for connecting to the Facebook Marketing API
type SourceFacebookMarketingAuthentication struct {
	AuthenticateViaFacebookMarketingOauth *AuthenticateViaFacebookMarketingOauth `queryParam:"inline"`
	ServiceAccountKeyAuthentication       *ServiceAccountKeyAuthentication       `queryParam:"inline"`

	Type SourceFacebookMarketingAuthenticationType
}

func CreateSourceFacebookMarketingAuthenticationAuthenticateViaFacebookMarketingOauth(authenticateViaFacebookMarketingOauth AuthenticateViaFacebookMarketingOauth) SourceFacebookMarketingAuthentication {
	typ := SourceFacebookMarketingAuthenticationTypeAuthenticateViaFacebookMarketingOauth

	return SourceFacebookMarketingAuthentication{
		AuthenticateViaFacebookMarketingOauth: &authenticateViaFacebookMarketingOauth,
		Type:                                  typ,
	}
}

func CreateSourceFacebookMarketingAuthenticationServiceAccountKeyAuthentication(serviceAccountKeyAuthentication ServiceAccountKeyAuthentication) SourceFacebookMarketingAuthentication {
	typ := SourceFacebookMarketingAuthenticationTypeServiceAccountKeyAuthentication

	return SourceFacebookMarketingAuthentication{
		ServiceAccountKeyAuthentication: &serviceAccountKeyAuthentication,
		Type:                            typ,
	}
}

func (u *SourceFacebookMarketingAuthentication) UnmarshalJSON(data []byte) error {

	var serviceAccountKeyAuthentication ServiceAccountKeyAuthentication = ServiceAccountKeyAuthentication{}
	if err := utils.UnmarshalJSON(data, &serviceAccountKeyAuthentication, "", true, true); err == nil {
		u.ServiceAccountKeyAuthentication = &serviceAccountKeyAuthentication
		u.Type = SourceFacebookMarketingAuthenticationTypeServiceAccountKeyAuthentication
		return nil
	}

	var authenticateViaFacebookMarketingOauth AuthenticateViaFacebookMarketingOauth = AuthenticateViaFacebookMarketingOauth{}
	if err := utils.UnmarshalJSON(data, &authenticateViaFacebookMarketingOauth, "", true, true); err == nil {
		u.AuthenticateViaFacebookMarketingOauth = &authenticateViaFacebookMarketingOauth
		u.Type = SourceFacebookMarketingAuthenticationTypeAuthenticateViaFacebookMarketingOauth
		return nil
	}

	return fmt.Errorf("could not unmarshal `%s` into any supported union types for SourceFacebookMarketingAuthentication", string(data))
}

func (u SourceFacebookMarketingAuthentication) MarshalJSON() ([]byte, error) {
	if u.AuthenticateViaFacebookMarketingOauth != nil {
		return utils.MarshalJSON(u.AuthenticateViaFacebookMarketingOauth, "", true)
	}

	if u.ServiceAccountKeyAuthentication != nil {
		return utils.MarshalJSON(u.ServiceAccountKeyAuthentication, "", true)
	}

	return nil, errors.New("could not marshal union type SourceFacebookMarketingAuthentication: all fields are null")
}

// ValidActionBreakdowns - An enumeration.
type ValidActionBreakdowns string

const (
	ValidActionBreakdownsActionCanvasComponentName ValidActionBreakdowns = "action_canvas_component_name"
	ValidActionBreakdownsActionCarouselCardID      ValidActionBreakdowns = "action_carousel_card_id"
	ValidActionBreakdownsActionCarouselCardName    ValidActionBreakdowns = "action_carousel_card_name"
	ValidActionBreakdownsActionDestination         ValidActionBreakdowns = "action_destination"
	ValidActionBreakdownsActionDevice              ValidActionBreakdowns = "action_device"
	ValidActionBreakdownsActionReaction            ValidActionBreakdowns = "action_reaction"
	ValidActionBreakdownsActionTargetID            ValidActionBreakdowns = "action_target_id"
	ValidActionBreakdownsActionType                ValidActionBreakdowns = "action_type"
	ValidActionBreakdownsActionVideoSound          ValidActionBreakdowns = "action_video_sound"
	ValidActionBreakdownsActionVideoType           ValidActionBreakdowns = "action_video_type"
	ValidActionBreakdownsConversionDestination     ValidActionBreakdowns = "conversion_destination"
	ValidActionBreakdownsMatchedPersonaID          ValidActionBreakdowns = "matched_persona_id"
	ValidActionBreakdownsMatchedPersonaName        ValidActionBreakdowns = "matched_persona_name"
	ValidActionBreakdownsSignalSourceBucket        ValidActionBreakdowns = "signal_source_bucket"
	ValidActionBreakdownsStandardEventContentType  ValidActionBreakdowns = "standard_event_content_type"
)

func (e ValidActionBreakdowns) ToPointer() *ValidActionBreakdowns {
	return &e
}
func (e *ValidActionBreakdowns) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "action_canvas_component_name":
		fallthrough
	case "action_carousel_card_id":
		fallthrough
	case "action_carousel_card_name":
		fallthrough
	case "action_destination":
		fallthrough
	case "action_device":
		fallthrough
	case "action_reaction":
		fallthrough
	case "action_target_id":
		fallthrough
	case "action_type":
		fallthrough
	case "action_video_sound":
		fallthrough
	case "action_video_type":
		fallthrough
	case "conversion_destination":
		fallthrough
	case "matched_persona_id":
		fallthrough
	case "matched_persona_name":
		fallthrough
	case "signal_source_bucket":
		fallthrough
	case "standard_event_content_type":
		*e = ValidActionBreakdowns(v)
		return nil
	default:
		return fmt.Errorf("invalid value for ValidActionBreakdowns: %v", v)
	}
}

// ValidBreakdowns - An enumeration.
type ValidBreakdowns string

const (
	ValidBreakdownsAdFormatAsset                             ValidBreakdowns = "ad_format_asset"
	ValidBreakdownsAge                                       ValidBreakdowns = "age"
	ValidBreakdownsAppID                                     ValidBreakdowns = "app_id"
	ValidBreakdownsBodyAsset                                 ValidBreakdowns = "body_asset"
	ValidBreakdownsBreakdownReportingAdID                    ValidBreakdowns = "breakdown_reporting_ad_id"
	ValidBreakdownsCallToActionAsset                         ValidBreakdowns = "call_to_action_asset"
	ValidBreakdownsCoarseConversionValue                     ValidBreakdowns = "coarse_conversion_value"
	ValidBreakdownsConversionDestination                     ValidBreakdowns = "conversion_destination"
	ValidBreakdownsCountry                                   ValidBreakdowns = "country"
	ValidBreakdownsDescriptionAsset                          ValidBreakdowns = "description_asset"
	ValidBreakdownsDevicePlatform                            ValidBreakdowns = "device_platform"
	ValidBreakdownsDma                                       ValidBreakdowns = "dma"
	ValidBreakdownsFidelityType                              ValidBreakdowns = "fidelity_type"
	ValidBreakdownsFrequencyValue                            ValidBreakdowns = "frequency_value"
	ValidBreakdownsGender                                    ValidBreakdowns = "gender"
	ValidBreakdownsHourlyStatsAggregatedByAdvertiserTimeZone ValidBreakdowns = "hourly_stats_aggregated_by_advertiser_time_zone"
	ValidBreakdownsHourlyStatsAggregatedByAudienceTimeZone   ValidBreakdowns = "hourly_stats_aggregated_by_audience_time_zone"
	ValidBreakdownsHsid                                      ValidBreakdowns = "hsid"
	ValidBreakdownsImageAsset                                ValidBreakdowns = "image_asset"
	ValidBreakdownsImpressionDevice                          ValidBreakdowns = "impression_device"
	ValidBreakdownsIsConversionIDModeled                     ValidBreakdowns = "is_conversion_id_modeled"
	ValidBreakdownsIsRenderedAsDelayedSkipAd                 ValidBreakdowns = "is_rendered_as_delayed_skip_ad"
	ValidBreakdownsLandingDestination                        ValidBreakdowns = "landing_destination"
	ValidBreakdownsLinkURLAsset                              ValidBreakdowns = "link_url_asset"
	ValidBreakdownsMarketingMessagesBtnName                  ValidBreakdowns = "marketing_messages_btn_name"
	ValidBreakdownsMdsaLandingDestination                    ValidBreakdowns = "mdsa_landing_destination"
	ValidBreakdownsMediaAssetURL                             ValidBreakdowns = "media_asset_url"
	ValidBreakdownsMediaCreator                              ValidBreakdowns = "media_creator"
	ValidBreakdownsMediaDestinationURL                       ValidBreakdowns = "media_destination_url"
	ValidBreakdownsMediaFormat                               ValidBreakdowns = "media_format"
	ValidBreakdownsMediaOriginURL                            ValidBreakdowns = "media_origin_url"
	ValidBreakdownsMediaTextContent                          ValidBreakdowns = "media_text_content"
	ValidBreakdownsMediaType                                 ValidBreakdowns = "media_type"
	ValidBreakdownsMmm                                       ValidBreakdowns = "mmm"
	ValidBreakdownsPlacePageID                               ValidBreakdowns = "place_page_id"
	ValidBreakdownsPlatformPosition                          ValidBreakdowns = "platform_position"
	ValidBreakdownsPostbackSequenceIndex                     ValidBreakdowns = "postback_sequence_index"
	ValidBreakdownsProductID                                 ValidBreakdowns = "product_id"
	ValidBreakdownsPublisherPlatform                         ValidBreakdowns = "publisher_platform"
	ValidBreakdownsRedownload                                ValidBreakdowns = "redownload"
	ValidBreakdownsRegion                                    ValidBreakdowns = "region"
	ValidBreakdownsSignalSourceBucket                        ValidBreakdowns = "signal_source_bucket"
	ValidBreakdownsSkanCampaignID                            ValidBreakdowns = "skan_campaign_id"
	ValidBreakdownsSkanConversionID                          ValidBreakdowns = "skan_conversion_id"
	ValidBreakdownsSkanVersion                               ValidBreakdowns = "skan_version"
	ValidBreakdownsSotAttributionModelType                   ValidBreakdowns = "sot_attribution_model_type"
	ValidBreakdownsSotAttributionWindow                      ValidBreakdowns = "sot_attribution_window"
	ValidBreakdownsSotChannel                                ValidBreakdowns = "sot_channel"
	ValidBreakdownsSotEventType                              ValidBreakdowns = "sot_event_type"
	ValidBreakdownsSotSource                                 ValidBreakdowns = "sot_source"
	ValidBreakdownsStandardEventContentType                  ValidBreakdowns = "standard_event_content_type"
	ValidBreakdownsTitleAsset                                ValidBreakdowns = "title_asset"
	ValidBreakdownsUserPersonaID                             ValidBreakdowns = "user_persona_id"
	ValidBreakdownsUserPersonaName                           ValidBreakdowns = "user_persona_name"
	ValidBreakdownsVideoAsset                                ValidBreakdowns = "video_asset"
)

func (e ValidBreakdowns) ToPointer() *ValidBreakdowns {
	return &e
}
func (e *ValidBreakdowns) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "ad_format_asset":
		fallthrough
	case "age":
		fallthrough
	case "app_id":
		fallthrough
	case "body_asset":
		fallthrough
	case "breakdown_reporting_ad_id":
		fallthrough
	case "call_to_action_asset":
		fallthrough
	case "coarse_conversion_value":
		fallthrough
	case "conversion_destination":
		fallthrough
	case "country":
		fallthrough
	case "description_asset":
		fallthrough
	case "device_platform":
		fallthrough
	case "dma":
		fallthrough
	case "fidelity_type":
		fallthrough
	case "frequency_value":
		fallthrough
	case "gender":
		fallthrough
	case "hourly_stats_aggregated_by_advertiser_time_zone":
		fallthrough
	case "hourly_stats_aggregated_by_audience_time_zone":
		fallthrough
	case "hsid":
		fallthrough
	case "image_asset":
		fallthrough
	case "impression_device":
		fallthrough
	case "is_conversion_id_modeled":
		fallthrough
	case "is_rendered_as_delayed_skip_ad":
		fallthrough
	case "landing_destination":
		fallthrough
	case "link_url_asset":
		fallthrough
	case "marketing_messages_btn_name":
		fallthrough
	case "mdsa_landing_destination":
		fallthrough
	case "media_asset_url":
		fallthrough
	case "media_creator":
		fallthrough
	case "media_destination_url":
		fallthrough
	case "media_format":
		fallthrough
	case "media_origin_url":
		fallthrough
	case "media_text_content":
		fallthrough
	case "media_type":
		fallthrough
	case "mmm":
		fallthrough
	case "place_page_id":
		fallthrough
	case "platform_position":
		fallthrough
	case "postback_sequence_index":
		fallthrough
	case "product_id":
		fallthrough
	case "publisher_platform":
		fallthrough
	case "redownload":
		fallthrough
	case "region":
		fallthrough
	case "signal_source_bucket":
		fallthrough
	case "skan_campaign_id":
		fallthrough
	case "skan_conversion_id":
		fallthrough
	case "skan_version":
		fallthrough
	case "sot_attribution_model_type":
		fallthrough
	case "sot_attribution_window":
		fallthrough
	case "sot_channel":
		fallthrough
	case "sot_event_type":
		fallthrough
	case "sot_source":
		fallthrough
	case "standard_event_content_type":
		fallthrough
	case "title_asset":
		fallthrough
	case "user_persona_id":
		fallthrough
	case "user_persona_name":
		fallthrough
	case "video_asset":
		*e = ValidBreakdowns(v)
		return nil
	default:
		return fmt.Errorf("invalid value for ValidBreakdowns: %v", v)
	}
}

// SourceFacebookMarketingValidEnums - An enumeration.
type SourceFacebookMarketingValidEnums string

const (
	SourceFacebookMarketingValidEnumsAccountCurrency                                  SourceFacebookMarketingValidEnums = "account_currency"
	SourceFacebookMarketingValidEnumsAccountID                                        SourceFacebookMarketingValidEnums = "account_id"
	SourceFacebookMarketingValidEnumsAccountName                                      SourceFacebookMarketingValidEnums = "account_name"
	SourceFacebookMarketingValidEnumsActionValues                                     SourceFacebookMarketingValidEnums = "action_values"
	SourceFacebookMarketingValidEnumsActions                                          SourceFacebookMarketingValidEnums = "actions"
	SourceFacebookMarketingValidEnumsAdClickActions                                   SourceFacebookMarketingValidEnums = "ad_click_actions"
	SourceFacebookMarketingValidEnumsAdID                                             SourceFacebookMarketingValidEnums = "ad_id"
	SourceFacebookMarketingValidEnumsAdImpressionActions                              SourceFacebookMarketingValidEnums = "ad_impression_actions"
	SourceFacebookMarketingValidEnumsAdName                                           SourceFacebookMarketingValidEnums = "ad_name"
	SourceFacebookMarketingValidEnumsAdsetEnd                                         SourceFacebookMarketingValidEnums = "adset_end"
	SourceFacebookMarketingValidEnumsAdsetID                                          SourceFacebookMarketingValidEnums = "adset_id"
	SourceFacebookMarketingValidEnumsAdsetName                                        SourceFacebookMarketingValidEnums = "adset_name"
	SourceFacebookMarketingValidEnumsAgeTargeting                                     SourceFacebookMarketingValidEnums = "age_targeting"
	SourceFacebookMarketingValidEnumsAttributionSetting                               SourceFacebookMarketingValidEnums = "attribution_setting"
	SourceFacebookMarketingValidEnumsAuctionBid                                       SourceFacebookMarketingValidEnums = "auction_bid"
	SourceFacebookMarketingValidEnumsAuctionCompetitiveness                           SourceFacebookMarketingValidEnums = "auction_competitiveness"
	SourceFacebookMarketingValidEnumsAuctionMaxCompetitorBid                          SourceFacebookMarketingValidEnums = "auction_max_competitor_bid"
	SourceFacebookMarketingValidEnumsAveragePurchasesConversionValue                  SourceFacebookMarketingValidEnums = "average_purchases_conversion_value"
	SourceFacebookMarketingValidEnumsBuyingType                                       SourceFacebookMarketingValidEnums = "buying_type"
	SourceFacebookMarketingValidEnumsCampaignID                                       SourceFacebookMarketingValidEnums = "campaign_id"
	SourceFacebookMarketingValidEnumsCampaignName                                     SourceFacebookMarketingValidEnums = "campaign_name"
	SourceFacebookMarketingValidEnumsCanvasAvgViewPercent                             SourceFacebookMarketingValidEnums = "canvas_avg_view_percent"
	SourceFacebookMarketingValidEnumsCanvasAvgViewTime                                SourceFacebookMarketingValidEnums = "canvas_avg_view_time"
	SourceFacebookMarketingValidEnumsCatalogSegmentActions                            SourceFacebookMarketingValidEnums = "catalog_segment_actions"
	SourceFacebookMarketingValidEnumsCatalogSegmentValue                              SourceFacebookMarketingValidEnums = "catalog_segment_value"
	SourceFacebookMarketingValidEnumsCatalogSegmentValueMobilePurchaseRoas            SourceFacebookMarketingValidEnums = "catalog_segment_value_mobile_purchase_roas"
	SourceFacebookMarketingValidEnumsCatalogSegmentValueOmniPurchaseRoas              SourceFacebookMarketingValidEnums = "catalog_segment_value_omni_purchase_roas"
	SourceFacebookMarketingValidEnumsCatalogSegmentValueWebsitePurchaseRoas           SourceFacebookMarketingValidEnums = "catalog_segment_value_website_purchase_roas"
	SourceFacebookMarketingValidEnumsClicks                                           SourceFacebookMarketingValidEnums = "clicks"
	SourceFacebookMarketingValidEnumsConversionRateRanking                            SourceFacebookMarketingValidEnums = "conversion_rate_ranking"
	SourceFacebookMarketingValidEnumsConversionValues                                 SourceFacebookMarketingValidEnums = "conversion_values"
	SourceFacebookMarketingValidEnumsConversions                                      SourceFacebookMarketingValidEnums = "conversions"
	SourceFacebookMarketingValidEnumsConvertedProductQuantity                         SourceFacebookMarketingValidEnums = "converted_product_quantity"
	SourceFacebookMarketingValidEnumsConvertedProductValue                            SourceFacebookMarketingValidEnums = "converted_product_value"
	SourceFacebookMarketingValidEnumsCostPer15SecVideoView                            SourceFacebookMarketingValidEnums = "cost_per_15_sec_video_view"
	SourceFacebookMarketingValidEnumsCostPer2SecContinuousVideoView                   SourceFacebookMarketingValidEnums = "cost_per_2_sec_continuous_video_view"
	SourceFacebookMarketingValidEnumsCostPerActionType                                SourceFacebookMarketingValidEnums = "cost_per_action_type"
	SourceFacebookMarketingValidEnumsCostPerAdClick                                   SourceFacebookMarketingValidEnums = "cost_per_ad_click"
	SourceFacebookMarketingValidEnumsCostPerConversion                                SourceFacebookMarketingValidEnums = "cost_per_conversion"
	SourceFacebookMarketingValidEnumsCostPerDdaCountbyConvs                           SourceFacebookMarketingValidEnums = "cost_per_dda_countby_convs"
	SourceFacebookMarketingValidEnumsCostPerEstimatedAdRecallers                      SourceFacebookMarketingValidEnums = "cost_per_estimated_ad_recallers"
	SourceFacebookMarketingValidEnumsCostPerInlineLinkClick                           SourceFacebookMarketingValidEnums = "cost_per_inline_link_click"
	SourceFacebookMarketingValidEnumsCostPerInlinePostEngagement                      SourceFacebookMarketingValidEnums = "cost_per_inline_post_engagement"
	SourceFacebookMarketingValidEnumsCostPerOneThousandAdImpression                   SourceFacebookMarketingValidEnums = "cost_per_one_thousand_ad_impression"
	SourceFacebookMarketingValidEnumsCostPerOutboundClick                             SourceFacebookMarketingValidEnums = "cost_per_outbound_click"
	SourceFacebookMarketingValidEnumsCostPerThruplay                                  SourceFacebookMarketingValidEnums = "cost_per_thruplay"
	SourceFacebookMarketingValidEnumsCostPerUniqueActionType                          SourceFacebookMarketingValidEnums = "cost_per_unique_action_type"
	SourceFacebookMarketingValidEnumsCostPerUniqueClick                               SourceFacebookMarketingValidEnums = "cost_per_unique_click"
	SourceFacebookMarketingValidEnumsCostPerUniqueConversion                          SourceFacebookMarketingValidEnums = "cost_per_unique_conversion"
	SourceFacebookMarketingValidEnumsCostPerUniqueInlineLinkClick                     SourceFacebookMarketingValidEnums = "cost_per_unique_inline_link_click"
	SourceFacebookMarketingValidEnumsCostPerUniqueOutboundClick                       SourceFacebookMarketingValidEnums = "cost_per_unique_outbound_click"
	SourceFacebookMarketingValidEnumsCpc                                              SourceFacebookMarketingValidEnums = "cpc"
	SourceFacebookMarketingValidEnumsCpm                                              SourceFacebookMarketingValidEnums = "cpm"
	SourceFacebookMarketingValidEnumsCpp                                              SourceFacebookMarketingValidEnums = "cpp"
	SourceFacebookMarketingValidEnumsCreatedTime                                      SourceFacebookMarketingValidEnums = "created_time"
	SourceFacebookMarketingValidEnumsCreativeMediaType                                SourceFacebookMarketingValidEnums = "creative_media_type"
	SourceFacebookMarketingValidEnumsCtr                                              SourceFacebookMarketingValidEnums = "ctr"
	SourceFacebookMarketingValidEnumsDateStart                                        SourceFacebookMarketingValidEnums = "date_start"
	SourceFacebookMarketingValidEnumsDateStop                                         SourceFacebookMarketingValidEnums = "date_stop"
	SourceFacebookMarketingValidEnumsDdaCountbyConvs                                  SourceFacebookMarketingValidEnums = "dda_countby_convs"
	SourceFacebookMarketingValidEnumsDdaResults                                       SourceFacebookMarketingValidEnums = "dda_results"
	SourceFacebookMarketingValidEnumsEngagementRateRanking                            SourceFacebookMarketingValidEnums = "engagement_rate_ranking"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallRate                            SourceFacebookMarketingValidEnums = "estimated_ad_recall_rate"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallRateLowerBound                  SourceFacebookMarketingValidEnums = "estimated_ad_recall_rate_lower_bound"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallRateUpperBound                  SourceFacebookMarketingValidEnums = "estimated_ad_recall_rate_upper_bound"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallers                             SourceFacebookMarketingValidEnums = "estimated_ad_recallers"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallersLowerBound                   SourceFacebookMarketingValidEnums = "estimated_ad_recallers_lower_bound"
	SourceFacebookMarketingValidEnumsEstimatedAdRecallersUpperBound                   SourceFacebookMarketingValidEnums = "estimated_ad_recallers_upper_bound"
	SourceFacebookMarketingValidEnumsFrequency                                        SourceFacebookMarketingValidEnums = "frequency"
	SourceFacebookMarketingValidEnumsFullViewImpressions                              SourceFacebookMarketingValidEnums = "full_view_impressions"
	SourceFacebookMarketingValidEnumsFullViewReach                                    SourceFacebookMarketingValidEnums = "full_view_reach"
	SourceFacebookMarketingValidEnumsGenderTargeting                                  SourceFacebookMarketingValidEnums = "gender_targeting"
	SourceFacebookMarketingValidEnumsImpressions                                      SourceFacebookMarketingValidEnums = "impressions"
	SourceFacebookMarketingValidEnumsInlineLinkClickCtr                               SourceFacebookMarketingValidEnums = "inline_link_click_ctr"
	SourceFacebookMarketingValidEnumsInlineLinkClicks                                 SourceFacebookMarketingValidEnums = "inline_link_clicks"
	SourceFacebookMarketingValidEnumsInlinePostEngagement                             SourceFacebookMarketingValidEnums = "inline_post_engagement"
	SourceFacebookMarketingValidEnumsInstagramUpcomingEventRemindersSet               SourceFacebookMarketingValidEnums = "instagram_upcoming_event_reminders_set"
	SourceFacebookMarketingValidEnumsInstantExperienceClicksToOpen                    SourceFacebookMarketingValidEnums = "instant_experience_clicks_to_open"
	SourceFacebookMarketingValidEnumsInstantExperienceClicksToStart                   SourceFacebookMarketingValidEnums = "instant_experience_clicks_to_start"
	SourceFacebookMarketingValidEnumsInstantExperienceOutboundClicks                  SourceFacebookMarketingValidEnums = "instant_experience_outbound_clicks"
	SourceFacebookMarketingValidEnumsInteractiveComponentTap                          SourceFacebookMarketingValidEnums = "interactive_component_tap"
	SourceFacebookMarketingValidEnumsLabels                                           SourceFacebookMarketingValidEnums = "labels"
	SourceFacebookMarketingValidEnumsLocation                                         SourceFacebookMarketingValidEnums = "location"
	SourceFacebookMarketingValidEnumsMarketingMessagesCostPerDelivered                SourceFacebookMarketingValidEnums = "marketing_messages_cost_per_delivered"
	SourceFacebookMarketingValidEnumsMarketingMessagesCostPerLinkBtnClick             SourceFacebookMarketingValidEnums = "marketing_messages_cost_per_link_btn_click"
	SourceFacebookMarketingValidEnumsMarketingMessagesDeliveryRate                    SourceFacebookMarketingValidEnums = "marketing_messages_delivery_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesLinkBtnClickRate                SourceFacebookMarketingValidEnums = "marketing_messages_link_btn_click_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesMediaViewRate                   SourceFacebookMarketingValidEnums = "marketing_messages_media_view_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesPhoneCallBtnClickRate           SourceFacebookMarketingValidEnums = "marketing_messages_phone_call_btn_click_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesQuickReplyBtnClickRate          SourceFacebookMarketingValidEnums = "marketing_messages_quick_reply_btn_click_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesReadRate                        SourceFacebookMarketingValidEnums = "marketing_messages_read_rate"
	SourceFacebookMarketingValidEnumsMarketingMessagesSpend                           SourceFacebookMarketingValidEnums = "marketing_messages_spend"
	SourceFacebookMarketingValidEnumsMarketingMessagesWebsitePurchaseValues           SourceFacebookMarketingValidEnums = "marketing_messages_website_purchase_values"
	SourceFacebookMarketingValidEnumsMobileAppPurchaseRoas                            SourceFacebookMarketingValidEnums = "mobile_app_purchase_roas"
	SourceFacebookMarketingValidEnumsObjective                                        SourceFacebookMarketingValidEnums = "objective"
	SourceFacebookMarketingValidEnumsOnsiteConversionMessagingDetectedPurchaseDeduped SourceFacebookMarketingValidEnums = "onsite_conversion_messaging_detected_purchase_deduped"
	SourceFacebookMarketingValidEnumsOptimizationGoal                                 SourceFacebookMarketingValidEnums = "optimization_goal"
	SourceFacebookMarketingValidEnumsOutboundClicks                                   SourceFacebookMarketingValidEnums = "outbound_clicks"
	SourceFacebookMarketingValidEnumsOutboundClicksCtr                                SourceFacebookMarketingValidEnums = "outbound_clicks_ctr"
	SourceFacebookMarketingValidEnumsPlacePageName                                    SourceFacebookMarketingValidEnums = "place_page_name"
	SourceFacebookMarketingValidEnumsPurchaseRoas                                     SourceFacebookMarketingValidEnums = "purchase_roas"
	SourceFacebookMarketingValidEnumsQualifyingQuestionQualifyAnswerRate              SourceFacebookMarketingValidEnums = "qualifying_question_qualify_answer_rate"
	SourceFacebookMarketingValidEnumsQualityRanking                                   SourceFacebookMarketingValidEnums = "quality_ranking"
	SourceFacebookMarketingValidEnumsReach                                            SourceFacebookMarketingValidEnums = "reach"
	SourceFacebookMarketingValidEnumsShopsAssistedPurchases                           SourceFacebookMarketingValidEnums = "shops_assisted_purchases"
	SourceFacebookMarketingValidEnumsSocialSpend                                      SourceFacebookMarketingValidEnums = "social_spend"
	SourceFacebookMarketingValidEnumsSpend                                            SourceFacebookMarketingValidEnums = "spend"
	SourceFacebookMarketingValidEnumsTotalPostbacks                                   SourceFacebookMarketingValidEnums = "total_postbacks"
	SourceFacebookMarketingValidEnumsTotalPostbacksDetailed                           SourceFacebookMarketingValidEnums = "total_postbacks_detailed"
	SourceFacebookMarketingValidEnumsTotalPostbacksDetailedV4                         SourceFacebookMarketingValidEnums = "total_postbacks_detailed_v4"
	SourceFacebookMarketingValidEnumsUniqueActions                                    SourceFacebookMarketingValidEnums = "unique_actions"
	SourceFacebookMarketingValidEnumsUniqueClicks                                     SourceFacebookMarketingValidEnums = "unique_clicks"
	SourceFacebookMarketingValidEnumsUniqueConversions                                SourceFacebookMarketingValidEnums = "unique_conversions"
	SourceFacebookMarketingValidEnumsUniqueCtr                                        SourceFacebookMarketingValidEnums = "unique_ctr"
	SourceFacebookMarketingValidEnumsUniqueInlineLinkClickCtr                         SourceFacebookMarketingValidEnums = "unique_inline_link_click_ctr"
	SourceFacebookMarketingValidEnumsUniqueInlineLinkClicks                           SourceFacebookMarketingValidEnums = "unique_inline_link_clicks"
	SourceFacebookMarketingValidEnumsUniqueLinkClicksCtr                              SourceFacebookMarketingValidEnums = "unique_link_clicks_ctr"
	SourceFacebookMarketingValidEnumsUniqueOutboundClicks                             SourceFacebookMarketingValidEnums = "unique_outbound_clicks"
	SourceFacebookMarketingValidEnumsUniqueOutboundClicksCtr                          SourceFacebookMarketingValidEnums = "unique_outbound_clicks_ctr"
	SourceFacebookMarketingValidEnumsUniqueVideoContinuous2SecWatchedActions          SourceFacebookMarketingValidEnums = "unique_video_continuous_2_sec_watched_actions"
	SourceFacebookMarketingValidEnumsUniqueVideoView15Sec                             SourceFacebookMarketingValidEnums = "unique_video_view_15_sec"
	SourceFacebookMarketingValidEnumsUpdatedTime                                      SourceFacebookMarketingValidEnums = "updated_time"
	SourceFacebookMarketingValidEnumsVideo15SecWatchedActions                         SourceFacebookMarketingValidEnums = "video_15_sec_watched_actions"
	SourceFacebookMarketingValidEnumsVideo30SecWatchedActions                         SourceFacebookMarketingValidEnums = "video_30_sec_watched_actions"
	SourceFacebookMarketingValidEnumsVideoAvgTimeWatchedActions                       SourceFacebookMarketingValidEnums = "video_avg_time_watched_actions"
	SourceFacebookMarketingValidEnumsVideoContinuous2SecWatchedActions                SourceFacebookMarketingValidEnums = "video_continuous_2_sec_watched_actions"
	SourceFacebookMarketingValidEnumsVideoP100WatchedActions                          SourceFacebookMarketingValidEnums = "video_p100_watched_actions"
	SourceFacebookMarketingValidEnumsVideoP25WatchedActions                           SourceFacebookMarketingValidEnums = "video_p25_watched_actions"
	SourceFacebookMarketingValidEnumsVideoP50WatchedActions                           SourceFacebookMarketingValidEnums = "video_p50_watched_actions"
	SourceFacebookMarketingValidEnumsVideoP75WatchedActions                           SourceFacebookMarketingValidEnums = "video_p75_watched_actions"
	SourceFacebookMarketingValidEnumsVideoP95WatchedActions                           SourceFacebookMarketingValidEnums = "video_p95_watched_actions"
	SourceFacebookMarketingValidEnumsVideoPlayActions                                 SourceFacebookMarketingValidEnums = "video_play_actions"
	SourceFacebookMarketingValidEnumsVideoPlayCurveActions                            SourceFacebookMarketingValidEnums = "video_play_curve_actions"
	SourceFacebookMarketingValidEnumsVideoPlayRetention0To15sActions                  SourceFacebookMarketingValidEnums = "video_play_retention_0_to_15s_actions"
	SourceFacebookMarketingValidEnumsVideoPlayRetention20To60sActions                 SourceFacebookMarketingValidEnums = "video_play_retention_20_to_60s_actions"
	SourceFacebookMarketingValidEnumsVideoPlayRetentionGraphActions                   SourceFacebookMarketingValidEnums = "video_play_retention_graph_actions"
	SourceFacebookMarketingValidEnumsVideoThruplayWatchedActions                      SourceFacebookMarketingValidEnums = "video_thruplay_watched_actions"
	SourceFacebookMarketingValidEnumsVideoTimeWatchedActions                          SourceFacebookMarketingValidEnums = "video_time_watched_actions"
	SourceFacebookMarketingValidEnumsWebsiteCtr                                       SourceFacebookMarketingValidEnums = "website_ctr"
	SourceFacebookMarketingValidEnumsWebsitePurchaseRoas                              SourceFacebookMarketingValidEnums = "website_purchase_roas"
	SourceFacebookMarketingValidEnumsWishBid                                          SourceFacebookMarketingValidEnums = "wish_bid"
)

func (e SourceFacebookMarketingValidEnums) ToPointer() *SourceFacebookMarketingValidEnums {
	return &e
}
func (e *SourceFacebookMarketingValidEnums) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "account_currency":
		fallthrough
	case "account_id":
		fallthrough
	case "account_name":
		fallthrough
	case "action_values":
		fallthrough
	case "actions":
		fallthrough
	case "ad_click_actions":
		fallthrough
	case "ad_id":
		fallthrough
	case "ad_impression_actions":
		fallthrough
	case "ad_name":
		fallthrough
	case "adset_end":
		fallthrough
	case "adset_id":
		fallthrough
	case "adset_name":
		fallthrough
	case "age_targeting":
		fallthrough
	case "attribution_setting":
		fallthrough
	case "auction_bid":
		fallthrough
	case "auction_competitiveness":
		fallthrough
	case "auction_max_competitor_bid":
		fallthrough
	case "average_purchases_conversion_value":
		fallthrough
	case "buying_type":
		fallthrough
	case "campaign_id":
		fallthrough
	case "campaign_name":
		fallthrough
	case "canvas_avg_view_percent":
		fallthrough
	case "canvas_avg_view_time":
		fallthrough
	case "catalog_segment_actions":
		fallthrough
	case "catalog_segment_value":
		fallthrough
	case "catalog_segment_value_mobile_purchase_roas":
		fallthrough
	case "catalog_segment_value_omni_purchase_roas":
		fallthrough
	case "catalog_segment_value_website_purchase_roas":
		fallthrough
	case "clicks":
		fallthrough
	case "conversion_rate_ranking":
		fallthrough
	case "conversion_values":
		fallthrough
	case "conversions":
		fallthrough
	case "converted_product_quantity":
		fallthrough
	case "converted_product_value":
		fallthrough
	case "cost_per_15_sec_video_view":
		fallthrough
	case "cost_per_2_sec_continuous_video_view":
		fallthrough
	case "cost_per_action_type":
		fallthrough
	case "cost_per_ad_click":
		fallthrough
	case "cost_per_conversion":
		fallthrough
	case "cost_per_dda_countby_convs":
		fallthrough
	case "cost_per_estimated_ad_recallers":
		fallthrough
	case "cost_per_inline_link_click":
		fallthrough
	case "cost_per_inline_post_engagement":
		fallthrough
	case "cost_per_one_thousand_ad_impression":
		fallthrough
	case "cost_per_outbound_click":
		fallthrough
	case "cost_per_thruplay":
		fallthrough
	case "cost_per_unique_action_type":
		fallthrough
	case "cost_per_unique_click":
		fallthrough
	case "cost_per_unique_conversion":
		fallthrough
	case "cost_per_unique_inline_link_click":
		fallthrough
	case "cost_per_unique_outbound_click":
		fallthrough
	case "cpc":
		fallthrough
	case "cpm":
		fallthrough
	case "cpp":
		fallthrough
	case "created_time":
		fallthrough
	case "creative_media_type":
		fallthrough
	case "ctr":
		fallthrough
	case "date_start":
		fallthrough
	case "date_stop":
		fallthrough
	case "dda_countby_convs":
		fallthrough
	case "dda_results":
		fallthrough
	case "engagement_rate_ranking":
		fallthrough
	case "estimated_ad_recall_rate":
		fallthrough
	case "estimated_ad_recall_rate_lower_bound":
		fallthrough
	case "estimated_ad_recall_rate_upper_bound":
		fallthrough
	case "estimated_ad_recallers":
		fallthrough
	case "estimated_ad_recallers_lower_bound":
		fallthrough
	case "estimated_ad_recallers_upper_bound":
		fallthrough
	case "frequency":
		fallthrough
	case "full_view_impressions":
		fallthrough
	case "full_view_reach":
		fallthrough
	case "gender_targeting":
		fallthrough
	case "impressions":
		fallthrough
	case "inline_link_click_ctr":
		fallthrough
	case "inline_link_clicks":
		fallthrough
	case "inline_post_engagement":
		fallthrough
	case "instagram_upcoming_event_reminders_set":
		fallthrough
	case "instant_experience_clicks_to_open":
		fallthrough
	case "instant_experience_clicks_to_start":
		fallthrough
	case "instant_experience_outbound_clicks":
		fallthrough
	case "interactive_component_tap":
		fallthrough
	case "labels":
		fallthrough
	case "location":
		fallthrough
	case "marketing_messages_cost_per_delivered":
		fallthrough
	case "marketing_messages_cost_per_link_btn_click":
		fallthrough
	case "marketing_messages_delivery_rate":
		fallthrough
	case "marketing_messages_link_btn_click_rate":
		fallthrough
	case "marketing_messages_media_view_rate":
		fallthrough
	case "marketing_messages_phone_call_btn_click_rate":
		fallthrough
	case "marketing_messages_quick_reply_btn_click_rate":
		fallthrough
	case "marketing_messages_read_rate":
		fallthrough
	case "marketing_messages_spend":
		fallthrough
	case "marketing_messages_website_purchase_values":
		fallthrough
	case "mobile_app_purchase_roas":
		fallthrough
	case "objective":
		fallthrough
	case "onsite_conversion_messaging_detected_purchase_deduped":
		fallthrough
	case "optimization_goal":
		fallthrough
	case "outbound_clicks":
		fallthrough
	case "outbound_clicks_ctr":
		fallthrough
	case "place_page_name":
		fallthrough
	case "purchase_roas":
		fallthrough
	case "qualifying_question_qualify_answer_rate":
		fallthrough
	case "quality_ranking":
		fallthrough
	case "reach":
		fallthrough
	case "shops_assisted_purchases":
		fallthrough
	case "social_spend":
		fallthrough
	case "spend":
		fallthrough
	case "total_postbacks":
		fallthrough
	case "total_postbacks_detailed":
		fallthrough
	case "total_postbacks_detailed_v4":
		fallthrough
	case "unique_actions":
		fallthrough
	case "unique_clicks":
		fallthrough
	case "unique_conversions":
		fallthrough
	case "unique_ctr":
		fallthrough
	case "unique_inline_link_click_ctr":
		fallthrough
	case "unique_inline_link_clicks":
		fallthrough
	case "unique_link_clicks_ctr":
		fallthrough
	case "unique_outbound_clicks":
		fallthrough
	case "unique_outbound_clicks_ctr":
		fallthrough
	case "unique_video_continuous_2_sec_watched_actions":
		fallthrough
	case "unique_video_view_15_sec":
		fallthrough
	case "updated_time":
		fallthrough
	case "video_15_sec_watched_actions":
		fallthrough
	case "video_30_sec_watched_actions":
		fallthrough
	case "video_avg_time_watched_actions":
		fallthrough
	case "video_continuous_2_sec_watched_actions":
		fallthrough
	case "video_p100_watched_actions":
		fallthrough
	case "video_p25_watched_actions":
		fallthrough
	case "video_p50_watched_actions":
		fallthrough
	case "video_p75_watched_actions":
		fallthrough
	case "video_p95_watched_actions":
		fallthrough
	case "video_play_actions":
		fallthrough
	case "video_play_curve_actions":
		fallthrough
	case "video_play_retention_0_to_15s_actions":
		fallthrough
	case "video_play_retention_20_to_60s_actions":
		fallthrough
	case "video_play_retention_graph_actions":
		fallthrough
	case "video_thruplay_watched_actions":
		fallthrough
	case "video_time_watched_actions":
		fallthrough
	case "website_ctr":
		fallthrough
	case "website_purchase_roas":
		fallthrough
	case "wish_bid":
		*e = SourceFacebookMarketingValidEnums(v)
		return nil
	default:
		return fmt.Errorf("invalid value for SourceFacebookMarketingValidEnums: %v", v)
	}
}

// Level - Chosen level for API
type Level string

const (
	LevelAd       Level = "ad"
	LevelAdset    Level = "adset"
	LevelCampaign Level = "campaign"
	LevelAccount  Level = "account"
)

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

// InsightConfig - Config for custom insights
type InsightConfig struct {
	// A list of chosen action_breakdowns for action_breakdowns
	ActionBreakdowns []ValidActionBreakdowns `json:"action_breakdowns,omitempty"`
	// A list of chosen breakdowns for breakdowns
	Breakdowns []ValidBreakdowns `json:"breakdowns,omitempty"`
	// The date until which you'd like to replicate data for this stream, in the format YYYY-MM-DDT00:00:00Z. All data generated between the start date and this end date will be replicated. Not setting this option will result in always syncing the latest data.
	EndDate *time.Time `json:"end_date,omitempty"`
	// A list of chosen fields for fields parameter
	Fields []SourceFacebookMarketingValidEnums `json:"fields,omitempty"`
	// The insights job timeout
	InsightsJobTimeout *int64 `default:"60" json:"insights_job_timeout"`
	// The attribution window
	InsightsLookbackWindow *int64 `default:"28" json:"insights_lookback_window"`
	// Chosen level for API
	Level *Level `default:"ad" json:"level"`
	// The name value of insight
	Name string `json:"name"`
	// The date from which you'd like to replicate data for this stream, in the format YYYY-MM-DDT00:00:00Z.
	StartDate *time.Time `json:"start_date,omitempty"`
	// Time window in days by which to aggregate statistics. The sync will be chunked into N day intervals, where N is the number of days you specified. For example, if you set this value to 7, then all statistics will be reported as 7-day aggregates by starting from the start_date. If the start and end dates are October 1st and October 30th, then the connector will output 5 records: 01 - 06, 07 - 13, 14 - 20, 21 - 27, and 28 - 30 (3 days only). The minimum allowed value for this field is 1, and the maximum is 89.
	TimeIncrement *int64 `default:"1" json:"time_increment"`
}

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

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

func (o *InsightConfig) GetActionBreakdowns() []ValidActionBreakdowns {
	if o == nil {
		return nil
	}
	return o.ActionBreakdowns
}

func (o *InsightConfig) GetBreakdowns() []ValidBreakdowns {
	if o == nil {
		return nil
	}
	return o.Breakdowns
}

func (o *InsightConfig) GetEndDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.EndDate
}

func (o *InsightConfig) GetFields() []SourceFacebookMarketingValidEnums {
	if o == nil {
		return nil
	}
	return o.Fields
}

func (o *InsightConfig) GetInsightsJobTimeout() *int64 {
	if o == nil {
		return nil
	}
	return o.InsightsJobTimeout
}

func (o *InsightConfig) GetInsightsLookbackWindow() *int64 {
	if o == nil {
		return nil
	}
	return o.InsightsLookbackWindow
}

func (o *InsightConfig) GetLevel() *Level {
	if o == nil {
		return nil
	}
	return o.Level
}

func (o *InsightConfig) GetName() string {
	if o == nil {
		return ""
	}
	return o.Name
}

func (o *InsightConfig) GetStartDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartDate
}

func (o *InsightConfig) GetTimeIncrement() *int64 {
	if o == nil {
		return nil
	}
	return o.TimeIncrement
}

type FacebookMarketing string

const (
	FacebookMarketingFacebookMarketing FacebookMarketing = "facebook-marketing"
)

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

type SourceFacebookMarketing struct {
	// The value of the generated access token. From your App’s Dashboard, click on "Marketing API" then "Tools". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on "Get token". See the <a href="https://docs.airbyte.com/integrations/sources/facebook-marketing">docs</a> for more information.
	AccessToken *string `json:"access_token,omitempty"`
	// The Facebook Ad account ID(s) to pull data from. The Ad account ID number is in the account dropdown menu or in your browser's address bar of your <a href="https://adsmanager.facebook.com/adsmanager/">Meta Ads Manager</a>. See the <a href="https://www.facebook.com/business/help/1492627900875762">docs</a> for more information.
	AccountIds []string `json:"account_ids"`
	// Select the statuses you want to be loaded in the stream. If no specific statuses are selected, the API's default behavior applies, and some statuses may be filtered out.
	AdStatuses []ValidAdStatuses `json:"ad_statuses,omitempty"`
	// Select the statuses you want to be loaded in the stream. If no specific statuses are selected, the API's default behavior applies, and some statuses may be filtered out.
	AdsetStatuses []ValidAdSetStatuses `json:"adset_statuses,omitempty"`
	// Select the statuses you want to be loaded in the stream. If no specific statuses are selected, the API's default behavior applies, and some statuses may be filtered out.
	CampaignStatuses []ValidCampaignStatuses `json:"campaign_statuses,omitempty"`
	// Credentials for connecting to the Facebook Marketing API
	Credentials SourceFacebookMarketingAuthentication `json:"credentials"`
	// A list which contains ad statistics entries, each entry must have a name and can contains fields, breakdowns or action_breakdowns. Click on "add" to fill this field.
	CustomInsights []InsightConfig `json:"custom_insights,omitempty"`
	// The date until which you'd like to replicate data for all incremental streams, in the format YYYY-MM-DDT00:00:00Z. All data generated between the start date and this end date will be replicated. Not setting this option will result in always syncing the latest data.
	EndDate *time.Time `json:"end_date,omitempty"`
	// Set to active if you want to fetch the thumbnail_url and store the result in thumbnail_data_url for each Ad Creative.
	FetchThumbnailImages *bool `default:"false" json:"fetch_thumbnail_images"`
	// Insights Job Timeout establishes the maximum amount of time (in minutes) of waiting for the report job to complete. When timeout is reached the job is considered failed and we are trying to request smaller amount of data by breaking the job to few smaller ones. If you definitely know that 60 minutes is not enough for your report to be processed then you can decrease the timeout value, so we start breaking job to smaller parts faster.
	InsightsJobTimeout *int64 `default:"60" json:"insights_job_timeout"`
	// The attribution window. Facebook freezes insight data 28 days after it was generated, which means that all data from the past 28 days may have changed since we last emitted it, so you can retrieve refreshed insights from the past by setting this parameter. If you set a custom lookback window value in Facebook account, please provide the same value here.
	InsightsLookbackWindow *int64 `default:"28" json:"insights_lookback_window"`
	// Page size used when sending requests to Facebook API to specify number of records per page when response has pagination. Most users do not need to set this field unless they specifically need to tune the connector to address specific issues or use cases.
	PageSize *int64 `default:"100" json:"page_size"`
	// The date from which you'd like to replicate data for all incremental streams, in the format YYYY-MM-DDT00:00:00Z. If not set then all data will be replicated for usual streams and only last 2 years for insight streams.
	StartDate  *time.Time        `json:"start_date,omitempty"`
	sourceType FacebookMarketing `const:"facebook-marketing" json:"sourceType"`
}

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

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

func (o *SourceFacebookMarketing) GetAccessToken() *string {
	if o == nil {
		return nil
	}
	return o.AccessToken
}

func (o *SourceFacebookMarketing) GetAccountIds() []string {
	if o == nil {
		return []string{}
	}
	return o.AccountIds
}

func (o *SourceFacebookMarketing) GetAdStatuses() []ValidAdStatuses {
	if o == nil {
		return nil
	}
	return o.AdStatuses
}

func (o *SourceFacebookMarketing) GetAdsetStatuses() []ValidAdSetStatuses {
	if o == nil {
		return nil
	}
	return o.AdsetStatuses
}

func (o *SourceFacebookMarketing) GetCampaignStatuses() []ValidCampaignStatuses {
	if o == nil {
		return nil
	}
	return o.CampaignStatuses
}

func (o *SourceFacebookMarketing) GetCredentials() SourceFacebookMarketingAuthentication {
	if o == nil {
		return SourceFacebookMarketingAuthentication{}
	}
	return o.Credentials
}

func (o *SourceFacebookMarketing) GetCustomInsights() []InsightConfig {
	if o == nil {
		return nil
	}
	return o.CustomInsights
}

func (o *SourceFacebookMarketing) GetEndDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.EndDate
}

func (o *SourceFacebookMarketing) GetFetchThumbnailImages() *bool {
	if o == nil {
		return nil
	}
	return o.FetchThumbnailImages
}

func (o *SourceFacebookMarketing) GetInsightsJobTimeout() *int64 {
	if o == nil {
		return nil
	}
	return o.InsightsJobTimeout
}

func (o *SourceFacebookMarketing) GetInsightsLookbackWindow() *int64 {
	if o == nil {
		return nil
	}
	return o.InsightsLookbackWindow
}

func (o *SourceFacebookMarketing) GetPageSize() *int64 {
	if o == nil {
		return nil
	}
	return o.PageSize
}

func (o *SourceFacebookMarketing) GetStartDate() *time.Time {
	if o == nil {
		return nil
	}
	return o.StartDate
}

func (o *SourceFacebookMarketing) GetSourceType() FacebookMarketing {
	return FacebookMarketingFacebookMarketing
}
