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

package provider

import (
	tfTypes "github.com/airbytehq/terraform-provider-airbyte/internal/provider/types"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/models/shared"
	"github.com/hashicorp/terraform-plugin-framework/types"
	"time"
)

func (r *SourceFacebookMarketingResourceModel) ToSharedSourceFacebookMarketingCreateRequest() *shared.SourceFacebookMarketingCreateRequest {
	var name string
	name = r.Name.ValueString()

	definitionID := new(string)
	if !r.DefinitionID.IsUnknown() && !r.DefinitionID.IsNull() {
		*definitionID = r.DefinitionID.ValueString()
	} else {
		definitionID = nil
	}
	var workspaceID string
	workspaceID = r.WorkspaceID.ValueString()

	accessToken := new(string)
	if !r.Configuration.AccessToken.IsUnknown() && !r.Configuration.AccessToken.IsNull() {
		*accessToken = r.Configuration.AccessToken.ValueString()
	} else {
		accessToken = nil
	}
	var accountIds []string = []string{}
	for _, accountIdsItem := range r.Configuration.AccountIds {
		accountIds = append(accountIds, accountIdsItem.ValueString())
	}
	var adStatuses []shared.ValidAdStatuses = []shared.ValidAdStatuses{}
	for _, adStatusesItem := range r.Configuration.AdStatuses {
		adStatuses = append(adStatuses, shared.ValidAdStatuses(adStatusesItem.ValueString()))
	}
	var adsetStatuses []shared.ValidAdSetStatuses = []shared.ValidAdSetStatuses{}
	for _, adsetStatusesItem := range r.Configuration.AdsetStatuses {
		adsetStatuses = append(adsetStatuses, shared.ValidAdSetStatuses(adsetStatusesItem.ValueString()))
	}
	var campaignStatuses []shared.ValidCampaignStatuses = []shared.ValidCampaignStatuses{}
	for _, campaignStatusesItem := range r.Configuration.CampaignStatuses {
		campaignStatuses = append(campaignStatuses, shared.ValidCampaignStatuses(campaignStatusesItem.ValueString()))
	}
	var credentials shared.SourceFacebookMarketingAuthentication
	var authenticateViaFacebookMarketingOauth *shared.AuthenticateViaFacebookMarketingOauth
	if r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth != nil {
		accessToken1 := new(string)
		if !r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.IsUnknown() && !r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.IsNull() {
			*accessToken1 = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.ValueString()
		} else {
			accessToken1 = nil
		}
		var clientID string
		clientID = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.ClientID.ValueString()

		var clientSecret string
		clientSecret = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.ClientSecret.ValueString()

		authenticateViaFacebookMarketingOauth = &shared.AuthenticateViaFacebookMarketingOauth{
			AccessToken:  accessToken1,
			ClientID:     clientID,
			ClientSecret: clientSecret,
		}
	}
	if authenticateViaFacebookMarketingOauth != nil {
		credentials = shared.SourceFacebookMarketingAuthentication{
			AuthenticateViaFacebookMarketingOauth: authenticateViaFacebookMarketingOauth,
		}
	}
	var serviceAccountKeyAuthentication *shared.ServiceAccountKeyAuthentication
	if r.Configuration.Credentials.ServiceAccountKeyAuthentication != nil {
		var accessToken2 string
		accessToken2 = r.Configuration.Credentials.ServiceAccountKeyAuthentication.AccessToken.ValueString()

		serviceAccountKeyAuthentication = &shared.ServiceAccountKeyAuthentication{
			AccessToken: accessToken2,
		}
	}
	if serviceAccountKeyAuthentication != nil {
		credentials = shared.SourceFacebookMarketingAuthentication{
			ServiceAccountKeyAuthentication: serviceAccountKeyAuthentication,
		}
	}
	var customInsights []shared.InsightConfig = []shared.InsightConfig{}
	for _, customInsightsItem := range r.Configuration.CustomInsights {
		var actionBreakdowns []shared.ValidActionBreakdowns = []shared.ValidActionBreakdowns{}
		for _, actionBreakdownsItem := range customInsightsItem.ActionBreakdowns {
			actionBreakdowns = append(actionBreakdowns, shared.ValidActionBreakdowns(actionBreakdownsItem.ValueString()))
		}
		var breakdowns []shared.ValidBreakdowns = []shared.ValidBreakdowns{}
		for _, breakdownsItem := range customInsightsItem.Breakdowns {
			breakdowns = append(breakdowns, shared.ValidBreakdowns(breakdownsItem.ValueString()))
		}
		endDate := new(time.Time)
		if !customInsightsItem.EndDate.IsUnknown() && !customInsightsItem.EndDate.IsNull() {
			*endDate, _ = time.Parse(time.RFC3339Nano, customInsightsItem.EndDate.ValueString())
		} else {
			endDate = nil
		}
		var fields []shared.SourceFacebookMarketingValidEnums = []shared.SourceFacebookMarketingValidEnums{}
		for _, fieldsItem := range customInsightsItem.Fields {
			fields = append(fields, shared.SourceFacebookMarketingValidEnums(fieldsItem.ValueString()))
		}
		insightsJobTimeout := new(int64)
		if !customInsightsItem.InsightsJobTimeout.IsUnknown() && !customInsightsItem.InsightsJobTimeout.IsNull() {
			*insightsJobTimeout = customInsightsItem.InsightsJobTimeout.ValueInt64()
		} else {
			insightsJobTimeout = nil
		}
		insightsLookbackWindow := new(int64)
		if !customInsightsItem.InsightsLookbackWindow.IsUnknown() && !customInsightsItem.InsightsLookbackWindow.IsNull() {
			*insightsLookbackWindow = customInsightsItem.InsightsLookbackWindow.ValueInt64()
		} else {
			insightsLookbackWindow = nil
		}
		level := new(shared.Level)
		if !customInsightsItem.Level.IsUnknown() && !customInsightsItem.Level.IsNull() {
			*level = shared.Level(customInsightsItem.Level.ValueString())
		} else {
			level = nil
		}
		var name1 string
		name1 = customInsightsItem.Name.ValueString()

		startDate := new(time.Time)
		if !customInsightsItem.StartDate.IsUnknown() && !customInsightsItem.StartDate.IsNull() {
			*startDate, _ = time.Parse(time.RFC3339Nano, customInsightsItem.StartDate.ValueString())
		} else {
			startDate = nil
		}
		timeIncrement := new(int64)
		if !customInsightsItem.TimeIncrement.IsUnknown() && !customInsightsItem.TimeIncrement.IsNull() {
			*timeIncrement = customInsightsItem.TimeIncrement.ValueInt64()
		} else {
			timeIncrement = nil
		}
		customInsights = append(customInsights, shared.InsightConfig{
			ActionBreakdowns:       actionBreakdowns,
			Breakdowns:             breakdowns,
			EndDate:                endDate,
			Fields:                 fields,
			InsightsJobTimeout:     insightsJobTimeout,
			InsightsLookbackWindow: insightsLookbackWindow,
			Level:                  level,
			Name:                   name1,
			StartDate:              startDate,
			TimeIncrement:          timeIncrement,
		})
	}
	endDate1 := new(time.Time)
	if !r.Configuration.EndDate.IsUnknown() && !r.Configuration.EndDate.IsNull() {
		*endDate1, _ = time.Parse(time.RFC3339Nano, r.Configuration.EndDate.ValueString())
	} else {
		endDate1 = nil
	}
	fetchThumbnailImages := new(bool)
	if !r.Configuration.FetchThumbnailImages.IsUnknown() && !r.Configuration.FetchThumbnailImages.IsNull() {
		*fetchThumbnailImages = r.Configuration.FetchThumbnailImages.ValueBool()
	} else {
		fetchThumbnailImages = nil
	}
	insightsJobTimeout1 := new(int64)
	if !r.Configuration.InsightsJobTimeout.IsUnknown() && !r.Configuration.InsightsJobTimeout.IsNull() {
		*insightsJobTimeout1 = r.Configuration.InsightsJobTimeout.ValueInt64()
	} else {
		insightsJobTimeout1 = nil
	}
	insightsLookbackWindow1 := new(int64)
	if !r.Configuration.InsightsLookbackWindow.IsUnknown() && !r.Configuration.InsightsLookbackWindow.IsNull() {
		*insightsLookbackWindow1 = r.Configuration.InsightsLookbackWindow.ValueInt64()
	} else {
		insightsLookbackWindow1 = nil
	}
	pageSize := new(int64)
	if !r.Configuration.PageSize.IsUnknown() && !r.Configuration.PageSize.IsNull() {
		*pageSize = r.Configuration.PageSize.ValueInt64()
	} else {
		pageSize = nil
	}
	startDate1 := new(time.Time)
	if !r.Configuration.StartDate.IsUnknown() && !r.Configuration.StartDate.IsNull() {
		*startDate1, _ = time.Parse(time.RFC3339Nano, r.Configuration.StartDate.ValueString())
	} else {
		startDate1 = nil
	}
	configuration := shared.SourceFacebookMarketing{
		AccessToken:            accessToken,
		AccountIds:             accountIds,
		AdStatuses:             adStatuses,
		AdsetStatuses:          adsetStatuses,
		CampaignStatuses:       campaignStatuses,
		Credentials:            credentials,
		CustomInsights:         customInsights,
		EndDate:                endDate1,
		FetchThumbnailImages:   fetchThumbnailImages,
		InsightsJobTimeout:     insightsJobTimeout1,
		InsightsLookbackWindow: insightsLookbackWindow1,
		PageSize:               pageSize,
		StartDate:              startDate1,
	}
	secretID := new(string)
	if !r.SecretID.IsUnknown() && !r.SecretID.IsNull() {
		*secretID = r.SecretID.ValueString()
	} else {
		secretID = nil
	}
	out := shared.SourceFacebookMarketingCreateRequest{
		Name:          name,
		DefinitionID:  definitionID,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
		SecretID:      secretID,
	}
	return &out
}

func (r *SourceFacebookMarketingResourceModel) RefreshFromSharedSourceResponse(resp *shared.SourceResponse) {
	if resp != nil {
		r.CreatedAt = types.Int64Value(resp.CreatedAt)
		r.DefinitionID = types.StringValue(resp.DefinitionID)
		r.Name = types.StringValue(resp.Name)
		if resp.ResourceAllocation == nil {
			r.ResourceAllocation = nil
		} else {
			r.ResourceAllocation = &tfTypes.ScopedResourceRequirements{}
			if resp.ResourceAllocation.Default == nil {
				r.ResourceAllocation.Default = nil
			} else {
				r.ResourceAllocation.Default = &tfTypes.ResourceRequirements{}
				r.ResourceAllocation.Default.CPULimit = types.StringPointerValue(resp.ResourceAllocation.Default.CPULimit)
				r.ResourceAllocation.Default.CPURequest = types.StringPointerValue(resp.ResourceAllocation.Default.CPURequest)
				r.ResourceAllocation.Default.EphemeralStorageLimit = types.StringPointerValue(resp.ResourceAllocation.Default.EphemeralStorageLimit)
				r.ResourceAllocation.Default.EphemeralStorageRequest = types.StringPointerValue(resp.ResourceAllocation.Default.EphemeralStorageRequest)
				r.ResourceAllocation.Default.MemoryLimit = types.StringPointerValue(resp.ResourceAllocation.Default.MemoryLimit)
				r.ResourceAllocation.Default.MemoryRequest = types.StringPointerValue(resp.ResourceAllocation.Default.MemoryRequest)
			}
			r.ResourceAllocation.JobSpecific = []tfTypes.JobTypeResourceLimit{}
			if len(r.ResourceAllocation.JobSpecific) > len(resp.ResourceAllocation.JobSpecific) {
				r.ResourceAllocation.JobSpecific = r.ResourceAllocation.JobSpecific[:len(resp.ResourceAllocation.JobSpecific)]
			}
			for jobSpecificCount, jobSpecificItem := range resp.ResourceAllocation.JobSpecific {
				var jobSpecific1 tfTypes.JobTypeResourceLimit
				jobSpecific1.JobType = types.StringValue(string(jobSpecificItem.JobType))
				jobSpecific1.ResourceRequirements.CPULimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.CPULimit)
				jobSpecific1.ResourceRequirements.CPURequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.CPURequest)
				jobSpecific1.ResourceRequirements.EphemeralStorageLimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.EphemeralStorageLimit)
				jobSpecific1.ResourceRequirements.EphemeralStorageRequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.EphemeralStorageRequest)
				jobSpecific1.ResourceRequirements.MemoryLimit = types.StringPointerValue(jobSpecificItem.ResourceRequirements.MemoryLimit)
				jobSpecific1.ResourceRequirements.MemoryRequest = types.StringPointerValue(jobSpecificItem.ResourceRequirements.MemoryRequest)
				if jobSpecificCount+1 > len(r.ResourceAllocation.JobSpecific) {
					r.ResourceAllocation.JobSpecific = append(r.ResourceAllocation.JobSpecific, jobSpecific1)
				} else {
					r.ResourceAllocation.JobSpecific[jobSpecificCount].JobType = jobSpecific1.JobType
					r.ResourceAllocation.JobSpecific[jobSpecificCount].ResourceRequirements = jobSpecific1.ResourceRequirements
				}
			}
		}
		r.SourceID = types.StringValue(resp.SourceID)
		r.SourceType = types.StringValue(resp.SourceType)
		r.WorkspaceID = types.StringValue(resp.WorkspaceID)
	}
}

func (r *SourceFacebookMarketingResourceModel) ToSharedSourceFacebookMarketingPutRequest() *shared.SourceFacebookMarketingPutRequest {
	var name string
	name = r.Name.ValueString()

	var workspaceID string
	workspaceID = r.WorkspaceID.ValueString()

	accessToken := new(string)
	if !r.Configuration.AccessToken.IsUnknown() && !r.Configuration.AccessToken.IsNull() {
		*accessToken = r.Configuration.AccessToken.ValueString()
	} else {
		accessToken = nil
	}
	var accountIds []string = []string{}
	for _, accountIdsItem := range r.Configuration.AccountIds {
		accountIds = append(accountIds, accountIdsItem.ValueString())
	}
	var adStatuses []shared.SourceFacebookMarketingUpdateValidAdStatuses = []shared.SourceFacebookMarketingUpdateValidAdStatuses{}
	for _, adStatusesItem := range r.Configuration.AdStatuses {
		adStatuses = append(adStatuses, shared.SourceFacebookMarketingUpdateValidAdStatuses(adStatusesItem.ValueString()))
	}
	var adsetStatuses []shared.SourceFacebookMarketingUpdateValidAdSetStatuses = []shared.SourceFacebookMarketingUpdateValidAdSetStatuses{}
	for _, adsetStatusesItem := range r.Configuration.AdsetStatuses {
		adsetStatuses = append(adsetStatuses, shared.SourceFacebookMarketingUpdateValidAdSetStatuses(adsetStatusesItem.ValueString()))
	}
	var campaignStatuses []shared.SourceFacebookMarketingUpdateValidCampaignStatuses = []shared.SourceFacebookMarketingUpdateValidCampaignStatuses{}
	for _, campaignStatusesItem := range r.Configuration.CampaignStatuses {
		campaignStatuses = append(campaignStatuses, shared.SourceFacebookMarketingUpdateValidCampaignStatuses(campaignStatusesItem.ValueString()))
	}
	var credentials shared.SourceFacebookMarketingUpdateAuthentication
	var sourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth *shared.SourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth
	if r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth != nil {
		accessToken1 := new(string)
		if !r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.IsUnknown() && !r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.IsNull() {
			*accessToken1 = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.AccessToken.ValueString()
		} else {
			accessToken1 = nil
		}
		var clientID string
		clientID = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.ClientID.ValueString()

		var clientSecret string
		clientSecret = r.Configuration.Credentials.AuthenticateViaFacebookMarketingOauth.ClientSecret.ValueString()

		sourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth = &shared.SourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth{
			AccessToken:  accessToken1,
			ClientID:     clientID,
			ClientSecret: clientSecret,
		}
	}
	if sourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth != nil {
		credentials = shared.SourceFacebookMarketingUpdateAuthentication{
			SourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth: sourceFacebookMarketingUpdateAuthenticateViaFacebookMarketingOauth,
		}
	}
	var sourceFacebookMarketingUpdateServiceAccountKeyAuthentication *shared.SourceFacebookMarketingUpdateServiceAccountKeyAuthentication
	if r.Configuration.Credentials.ServiceAccountKeyAuthentication != nil {
		var accessToken2 string
		accessToken2 = r.Configuration.Credentials.ServiceAccountKeyAuthentication.AccessToken.ValueString()

		sourceFacebookMarketingUpdateServiceAccountKeyAuthentication = &shared.SourceFacebookMarketingUpdateServiceAccountKeyAuthentication{
			AccessToken: accessToken2,
		}
	}
	if sourceFacebookMarketingUpdateServiceAccountKeyAuthentication != nil {
		credentials = shared.SourceFacebookMarketingUpdateAuthentication{
			SourceFacebookMarketingUpdateServiceAccountKeyAuthentication: sourceFacebookMarketingUpdateServiceAccountKeyAuthentication,
		}
	}
	var customInsights []shared.SourceFacebookMarketingUpdateInsightConfig = []shared.SourceFacebookMarketingUpdateInsightConfig{}
	for _, customInsightsItem := range r.Configuration.CustomInsights {
		var actionBreakdowns []shared.SourceFacebookMarketingUpdateValidActionBreakdowns = []shared.SourceFacebookMarketingUpdateValidActionBreakdowns{}
		for _, actionBreakdownsItem := range customInsightsItem.ActionBreakdowns {
			actionBreakdowns = append(actionBreakdowns, shared.SourceFacebookMarketingUpdateValidActionBreakdowns(actionBreakdownsItem.ValueString()))
		}
		var breakdowns []shared.SourceFacebookMarketingUpdateValidBreakdowns = []shared.SourceFacebookMarketingUpdateValidBreakdowns{}
		for _, breakdownsItem := range customInsightsItem.Breakdowns {
			breakdowns = append(breakdowns, shared.SourceFacebookMarketingUpdateValidBreakdowns(breakdownsItem.ValueString()))
		}
		endDate := new(time.Time)
		if !customInsightsItem.EndDate.IsUnknown() && !customInsightsItem.EndDate.IsNull() {
			*endDate, _ = time.Parse(time.RFC3339Nano, customInsightsItem.EndDate.ValueString())
		} else {
			endDate = nil
		}
		var fields []shared.SourceFacebookMarketingUpdateValidEnums = []shared.SourceFacebookMarketingUpdateValidEnums{}
		for _, fieldsItem := range customInsightsItem.Fields {
			fields = append(fields, shared.SourceFacebookMarketingUpdateValidEnums(fieldsItem.ValueString()))
		}
		insightsJobTimeout := new(int64)
		if !customInsightsItem.InsightsJobTimeout.IsUnknown() && !customInsightsItem.InsightsJobTimeout.IsNull() {
			*insightsJobTimeout = customInsightsItem.InsightsJobTimeout.ValueInt64()
		} else {
			insightsJobTimeout = nil
		}
		insightsLookbackWindow := new(int64)
		if !customInsightsItem.InsightsLookbackWindow.IsUnknown() && !customInsightsItem.InsightsLookbackWindow.IsNull() {
			*insightsLookbackWindow = customInsightsItem.InsightsLookbackWindow.ValueInt64()
		} else {
			insightsLookbackWindow = nil
		}
		level := new(shared.SourceFacebookMarketingUpdateLevel)
		if !customInsightsItem.Level.IsUnknown() && !customInsightsItem.Level.IsNull() {
			*level = shared.SourceFacebookMarketingUpdateLevel(customInsightsItem.Level.ValueString())
		} else {
			level = nil
		}
		var name1 string
		name1 = customInsightsItem.Name.ValueString()

		startDate := new(time.Time)
		if !customInsightsItem.StartDate.IsUnknown() && !customInsightsItem.StartDate.IsNull() {
			*startDate, _ = time.Parse(time.RFC3339Nano, customInsightsItem.StartDate.ValueString())
		} else {
			startDate = nil
		}
		timeIncrement := new(int64)
		if !customInsightsItem.TimeIncrement.IsUnknown() && !customInsightsItem.TimeIncrement.IsNull() {
			*timeIncrement = customInsightsItem.TimeIncrement.ValueInt64()
		} else {
			timeIncrement = nil
		}
		customInsights = append(customInsights, shared.SourceFacebookMarketingUpdateInsightConfig{
			ActionBreakdowns:       actionBreakdowns,
			Breakdowns:             breakdowns,
			EndDate:                endDate,
			Fields:                 fields,
			InsightsJobTimeout:     insightsJobTimeout,
			InsightsLookbackWindow: insightsLookbackWindow,
			Level:                  level,
			Name:                   name1,
			StartDate:              startDate,
			TimeIncrement:          timeIncrement,
		})
	}
	endDate1 := new(time.Time)
	if !r.Configuration.EndDate.IsUnknown() && !r.Configuration.EndDate.IsNull() {
		*endDate1, _ = time.Parse(time.RFC3339Nano, r.Configuration.EndDate.ValueString())
	} else {
		endDate1 = nil
	}
	fetchThumbnailImages := new(bool)
	if !r.Configuration.FetchThumbnailImages.IsUnknown() && !r.Configuration.FetchThumbnailImages.IsNull() {
		*fetchThumbnailImages = r.Configuration.FetchThumbnailImages.ValueBool()
	} else {
		fetchThumbnailImages = nil
	}
	insightsJobTimeout1 := new(int64)
	if !r.Configuration.InsightsJobTimeout.IsUnknown() && !r.Configuration.InsightsJobTimeout.IsNull() {
		*insightsJobTimeout1 = r.Configuration.InsightsJobTimeout.ValueInt64()
	} else {
		insightsJobTimeout1 = nil
	}
	insightsLookbackWindow1 := new(int64)
	if !r.Configuration.InsightsLookbackWindow.IsUnknown() && !r.Configuration.InsightsLookbackWindow.IsNull() {
		*insightsLookbackWindow1 = r.Configuration.InsightsLookbackWindow.ValueInt64()
	} else {
		insightsLookbackWindow1 = nil
	}
	pageSize := new(int64)
	if !r.Configuration.PageSize.IsUnknown() && !r.Configuration.PageSize.IsNull() {
		*pageSize = r.Configuration.PageSize.ValueInt64()
	} else {
		pageSize = nil
	}
	startDate1 := new(time.Time)
	if !r.Configuration.StartDate.IsUnknown() && !r.Configuration.StartDate.IsNull() {
		*startDate1, _ = time.Parse(time.RFC3339Nano, r.Configuration.StartDate.ValueString())
	} else {
		startDate1 = nil
	}
	configuration := shared.SourceFacebookMarketingUpdate{
		AccessToken:            accessToken,
		AccountIds:             accountIds,
		AdStatuses:             adStatuses,
		AdsetStatuses:          adsetStatuses,
		CampaignStatuses:       campaignStatuses,
		Credentials:            credentials,
		CustomInsights:         customInsights,
		EndDate:                endDate1,
		FetchThumbnailImages:   fetchThumbnailImages,
		InsightsJobTimeout:     insightsJobTimeout1,
		InsightsLookbackWindow: insightsLookbackWindow1,
		PageSize:               pageSize,
		StartDate:              startDate1,
	}
	out := shared.SourceFacebookMarketingPutRequest{
		Name:          name,
		WorkspaceID:   workspaceID,
		Configuration: configuration,
	}
	return &out
}
