// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.6

package types

type AICompleteData struct {
	Text    string `json:"text"`
	KeyMode string `json:"key_mode"`
	Model   string `json:"model"`
}

type AICompleteReq struct {
	Prompt string `json:"prompt"`
	Model  string `json:"model,optional"`
	Meter  string `json:"meter,optional"` // default ai_copy
}

type AcceptOpportunityData struct {
	OpportunityId string `json:"opportunity_id"`
	ContactId     string `json:"contact_id,optional"`
	Status        string `json:"status"`
}

type AcceptOpportunityReq struct {
	Id string `path:"id"`
}

type AccountHealthListData struct {
	List []AccountHealthPublic `json:"list"`
}

type AccountHealthPublic struct {
	ThreadsAccountId string   `json:"threads_account_id"`
	Score            int      `json:"score"`
	Level            string   `json:"level"`
	Factors          []string `json:"factors"`
	Advice           string   `json:"advice"`
	ComputedAt       int64    `json:"computed_at"`
}

type AddWorkspaceMemberReq struct {
	WorkspaceId string `path:"id"`
	MemberUid   int64  `json:"member_uid,optional"`
	Email       string `json:"email,optional"`
	Role        string `json:"role,optional"` // editor | reviewer | owner
}

type AdminCreateMemberData struct {
	User              MemberPublic `json:"user"`
	TemporaryPassword string       `json:"temporary_password"`
}

type AdminCreateMemberReq struct {
	DisplayName   string   `json:"display_name"`
	Email         string   `json:"email"`
	Phone         string   `json:"phone,optional"`
	Password      string   `json:"password,optional"`
	Roles         []string `json:"roles,optional"`
	EmailVerified bool     `json:"email_verified,optional"`
	Bio           string   `json:"bio,optional"`
	Nickname      string   `json:"nickname,optional"`
	FullName      string   `json:"full_name,optional"`
}

type AdminEmailVerifiedReq struct {
	Uid      string `path:"uid"`
	Verified bool   `json:"verified"`
}

type AdminListData struct {
	List       []MemberPublic `json:"list"`
	Pagination Pagination     `json:"pagination"`
}

type AdminListMembersReq struct {
	Page     int    `form:"page,optional"`
	PageSize int    `form:"pageSize,optional"`
	Query    string `form:"query,optional"`
	Status   string `form:"status,optional"`
}

type AdminMemberIdentitiesData struct {
	List []IdentityPublic `json:"list"`
}

type AdminResetPasswordReq struct {
	Uid         string `path:"uid"`
	NewPassword string `json:"new_password,optional"`
	Password    string `json:"password,optional"`
}

type AdminRolesReq struct {
	Uid   string   `path:"uid"`
	Roles []string `json:"roles"`
}

type AdminStatusReq struct {
	Uid    string `path:"uid"`
	Status string `json:"status"`
}

type AdminSuspendReq struct {
	Uid       string `path:"uid"`
	Suspended bool   `json:"suspended"`
}

type AdminUidPath struct {
	Uid string `path:"uid"`
}

type AiSettingsData struct {
	Provider                 string   `json:"provider"`
	Model                    string   `json:"model"`
	ResearchProvider         string   `json:"research_provider"`
	ResearchModel            string   `json:"research_model"`
	ApiKeyConfigured         bool     `json:"api_key_configured"`
	ResearchApiKeyConfigured bool     `json:"research_api_key_configured"`
	PlatformKeyAvailable     bool     `json:"platform_key_available"`
	Models                   []string `json:"models"`
	ModelsProvider           string   `json:"models_provider"`
	SelectedModel            string   `json:"selected_model"`
	ModelsFromCache          bool     `json:"models_from_cache,optional"`
	ModelsError              string   `json:"models_error,optional"`
}

type ApplyInviteCodeReq struct {
	Code string `json:"code"`
}

type AssignProductReq struct {
	Id        string `path:"id"`
	BrandId   string `json:"brand_id"`
	ProductId string `json:"product_id"`
}

type AuthBindReq struct {
	LoginId     string `json:"login_id"`
	Platform    string `json:"platform"`
	AccountType string `json:"account_type,optional"`
	Password    string `json:"password,optional"`
}

type AuthIdentitiesData struct {
	List []IdentityPublic `json:"list"`
}

type AuthLoginReq struct {
	Email    string `json:"email,optional"`
	LoginId  string `json:"login_id,optional"`
	Password string `json:"password"`
	Platform string `json:"platform,optional"` // platform|google|line (default platform)
}

type AuthLogoutAllData struct {
	Ok bool `json:"ok"`
}

type AuthLogoutReq struct {
	RefreshToken string `json:"refresh_token,optional"`
}

type AuthOAuthCallbackReq struct {
	Provider    string `path:"provider"`
	Code        string `json:"code,optional"`
	IdToken     string `json:"id_token,optional"`
	AccessToken string `json:"access_token,optional"`
	RedirectUri string `json:"redirect_uri,optional"`
}

type AuthOAuthProviderPath struct {
	Provider string `path:"provider"`
}

type AuthOAuthStartData struct {
	AuthorizeUrl string `json:"authorize_url"`
	Provider     string `json:"provider"`
	State        string `json:"state"`
}

type AuthProfilePatchReq struct {
	DisplayName       string  `json:"display_name,optional"`
	Nickname          string  `json:"nickname,optional"`
	FullName          string  `json:"full_name,optional"`
	Email             string  `json:"email,optional"`
	Phone             string  `json:"phone,optional"`
	Bio               string  `json:"bio,optional"`
	Timezone          string  `json:"timezone,optional"`
	NotifyEmail       *bool   `json:"notify_email,optional"`
	AvatarUrl         *string `json:"avatar_url,optional"`
	GenderCode        *int    `json:"gender_code,optional"`
	Birthdate         *int64  `json:"birthdate,optional"`
	National          string  `json:"national,optional"`
	Address           string  `json:"address,optional"`
	PostCode          string  `json:"post_code,optional"`
	PreferredLanguage string  `json:"preferred_language,optional"`
	Currency          string  `json:"currency,optional"`
	OnboardingStatus  string  `json:"onboarding_status,optional"`
	CurrentPassword   string  `json:"current_password,optional"`
	NewPassword       string  `json:"new_password,optional"`
}

type AuthRefreshReq struct {
	RefreshToken string `json:"refresh_token"`
}

type AuthRegisterReq struct {
	Email       string `json:"email"`
	Password    string `json:"password"`
	DisplayName string `json:"display_name,optional"`
	Phone       string `json:"phone,optional"`
}

type AuthRequestResetData struct {
	Ok            bool   `json:"ok"`
	Message       string `json:"message"`
	MockCode      string `json:"mock_code,optional"`
	MockResetPath string `json:"mock_reset_path,optional"`
}

type AuthRequestResetReq struct {
	Email    string `json:"email"`
	Language string `json:"language,optional"`
}

type AuthResetPasswordReq struct {
	Email       string `json:"email"`
	Token       string `json:"token,optional"`
	Code        string `json:"code,optional"`
	NewPassword string `json:"new_password"`
}

type AuthSendCodeData struct {
	Ok       bool   `json:"ok"`
	Message  string `json:"message"`
	MockCode string `json:"mock_code,optional"`
}

type AuthSessionData struct {
	Tokens TokenPair    `json:"tokens"`
	Member MemberPublic `json:"member"`
}

type AuthTokensOnly struct {
	Tokens TokenPair `json:"tokens"`
}

type AuthUnbindReq struct {
	LoginId  string `json:"login_id"`
	Platform string `json:"platform"`
}

type AuthVerifyEmailReq struct {
	Code string `json:"code"`
}

type BenchmarkData struct {
	Available      bool    `json:"available"`
	SampleSize     int     `json:"sample_size"`
	Niche          string  `json:"niche"`
	MedianEngRate  float64 `json:"median_eng_rate"`
	MedianViews    float64 `json:"median_views"`
	YourEngRate    float64 `json:"your_eng_rate,optional"`
	YourViews      float64 `json:"your_views,optional"`
	PercentileHint string  `json:"percentile_hint,optional"`
	Message        string  `json:"message,optional"`
}

type BenchmarkReq struct {
	Niche     string `form:"niche,optional"`
	AccountId string `form:"account_id,optional"`
}

type BillingCheckoutCreateReq struct {
	PlanId    string `json:"plan_id"`
	RequestId string `json:"request_id"`
}

type BillingCheckoutData struct {
	Id                string `json:"id"`
	SessionId         string `json:"session_id"`
	Url               string `json:"url"`
	ExpiresAt         int64  `json:"expires_at"`
	Status            string `json:"status,optional"`
	PaymentStatus     string `json:"payment_status,optional"`
	FulfillmentStatus string `json:"fulfillment_status,optional"`
	PlanId            string `json:"plan_id,optional"`
}

type BillingCheckoutGetReq struct {
	Id string `path:"id"`
}

type BillingPortalData struct {
	Url string `json:"url"`
}

type BillingSubscriptionData struct {
	PlanId             string `json:"plan_id"`
	PaidPlanId         string `json:"paid_plan_id,optional"`
	Status             string `json:"status"`
	CustomerId         string `json:"customer_id,optional"`
	SubscriptionId     string `json:"subscription_id,optional"`
	CurrentPeriodStart int64  `json:"current_period_start,optional"`
	CurrentPeriodEnd   int64  `json:"current_period_end,optional"`
	CancelAtPeriodEnd  bool   `json:"cancel_at_period_end"`
	AdminOverride      bool   `json:"admin_override"`
}

type BrandActiveData struct {
	Id string `json:"id"`
}

type BrandIdPath struct {
	Id string `path:"id"`
}

type BrandListData struct {
	List []BrandPublic `json:"list"`
}

type BrandPublic struct {
	Id                    string `json:"id"`
	DisplayName           string `json:"display_name"`
	Brief                 string `json:"brief"`
	TargetAudience        string `json:"target_audience,optional"`
	Goals                 string `json:"goals,optional"`
	LearningSummary       string `json:"learning_summary,optional"`
	LearningVersion       int    `json:"learning_version,optional"`
	LearnedFromPostsCount int    `json:"learned_from_posts_count,optional"`
	LastLearnedAt         int64  `json:"last_learned_at,optional"`
}

type BrandSaveReq struct {
	Id             string `json:"id,optional"`
	DisplayName    string `json:"display_name"`
	Brief          string `json:"brief,optional"`
	TargetAudience string `json:"target_audience,optional"`
	Goals          string `json:"goals,optional"`
}

type BrandSetActiveReq struct {
	Id string `json:"id"`
}

type CheckupActionPublic struct {
	Title    string `json:"title"`
	Reason   string `json:"reason"`
	Deeplink string `json:"deeplink"`
}

type CheckupFindingPublic struct {
	Claim    string   `json:"claim"`
	Evidence []string `json:"evidence"`
}

type CheckupListData struct {
	List       []WeeklyCheckupPublic `json:"list"`
	Pagination Pagination            `json:"pagination"`
}

type ComposeMimicData struct {
	Text  string `json:"text,optional"`
	JobId string `json:"job_id,optional"`
	Async bool   `json:"async,optional"`
}

type ComposeMimicReq struct {
	SourceText     string `json:"source_text"`
	PersonaId      string `json:"persona_id,optional"`
	Direction      string `json:"direction,optional"`
	StructureNotes string `json:"structure_notes,optional"`
}

type ComposePersonaPreviewData struct {
	Topic       string `json:"topic"`
	TopicSource string `json:"topic_source"` // news | manual | fallback
	PostText    string `json:"post_text"`
	ReplyText   string `json:"reply_text"`
	Notes       string `json:"notes,optional"`
}

type ComposePersonaPreviewReq struct {
	PersonaId string `json:"persona_id"`
	Topic     string `json:"topic,optional"`
	UseNews   bool   `json:"use_news,optional"`
}

type ComposePublishReq struct {
	AccountId       string   `json:"account_id"`
	Text            string   `json:"text"`
	Title           string   `json:"title,optional"`
	ImageUrls       []string `json:"image_urls,optional"`
	ScheduleStartAt int64    `json:"schedule_start_at,optional"`
	TopicTag        string   `json:"topic_tag,optional"`
	ReplyControl    string   `json:"reply_control,optional"`
}

type ComposeViralReq struct {
	Text string `json:"text"`
}

type ContactBrief struct {
	Id             string `json:"id"`
	SourcePlatform string `json:"source_platform"`
	AuthorHandle   string `json:"author_handle"`
	DisplayName    string `json:"display_name,optional"`
	Stage          string `json:"stage"`
}

type ContactDetailData struct {
	Contact       ContactPublic             `json:"contact"`
	Touches       []ContactTouchPublic      `json:"touches"`
	Pagination    Pagination                `json:"pagination"`
	Opportunities []ContactOpportunityBrief `json:"opportunities"`
}

type ContactIdReq struct {
	Id string `path:"id"`
}

type ContactListData struct {
	List        []ContactPublic `json:"list"`
	Pagination  Pagination      `json:"pagination"`
	StageCounts []StageCount    `json:"stage_counts"`
}

type ContactOpportunityBrief struct {
	Id          string `json:"id"`
	Permalink   string `json:"permalink"`
	Text        string `json:"text"`
	IntentScore int    `json:"intent_score"`
	IntentBand  string `json:"intent_band"`
	CreatedAt   int64  `json:"created_at"`
}

type ContactPublic struct {
	Id               string   `json:"id"`
	SourcePlatform   string   `json:"source_platform"`
	AuthorHandle     string   `json:"author_handle"`
	DisplayName      string   `json:"display_name,optional"`
	Stage            string   `json:"stage"` // new_found | engaged | dm_sent | replied | quoted | won | lost
	NeedsFollowUp    bool     `json:"needs_follow_up"`
	FollowUpDays     int      `json:"follow_up_days"`
	LastTouchAt      int64    `json:"last_touch_at,optional"`
	OpportunityIds   []string `json:"opportunity_ids"`
	OpportunityCount int      `json:"opportunity_count"`
	MergedFrom       []string `json:"merged_from,optional"`
	TopIntentBand    string   `json:"top_intent_band,optional"`
	TopIntentScore   int      `json:"top_intent_score,optional"`
	CreatedAt        int64    `json:"created_at"`
	UpdatedAt        int64    `json:"updated_at"`
}

type ContactTouchPublic struct {
	Id        string `json:"id"`
	ContactId string `json:"contact_id"`
	Type      string `json:"type"` // stage | reply | note | conversion
	FromStage string `json:"from_stage,optional"`
	ToStage   string `json:"to_stage,optional"`
	Body      string `json:"body,optional"`
	ActorUid  int64  `json:"actor_uid"`
	CreatedAt int64  `json:"created_at"`
}

type CostPreviewPublic struct {
	PreviewId        string `json:"preview_id"`
	Action           string `json:"action"`
	KeyMode          string `json:"key_mode"` // platform | byok
	FixedCredits     int    `json:"fixed_credits"`
	MinCredits       int    `json:"min_credits"`
	MaxCredits       int    `json:"max_credits"`
	SearchCalls      int    `json:"search_calls"`
	MaxAiCandidates  int    `json:"max_ai_candidates"`
	RemainingCredits int    `json:"remaining_credits"`
	EstimateBasis    string `json:"estimate_basis"`
	ExpiresAt        int64  `json:"expires_at"`
}

type CostPreviewReq struct {
	Action         string `form:"action"` // sweep | explore | demand_map_enrich | reply
	WatchId        string `form:"watch_id,optional"`
	ProductId      string `form:"product_id,optional"`
	CandidateLimit int    `form:"candidate_limit,optional"`
}

type CreateContactNoteReq struct {
	Id   string `path:"id"`
	Body string `json:"body"`
}

type CreateCrmConversionReq struct {
	Id       string  `path:"id"`
	Amount   float64 `json:"amount,optional"`
	Currency string  `json:"currency,optional"`
	Note     string  `json:"note,optional"`
}

type CreateReplyReq struct {
	Id      string `path:"id"`
	Variant string `json:"variant"`
}

type CreateUtmLinkReq struct {
	DestinationUrl string `json:"destination_url"`
	OutcomeId      string `json:"outcome_id,optional"`
	Label          string `json:"label,optional"`
}

type CreateWatchReq struct {
	Terms        []string `json:"terms"`
	ExcludeTerms []string `json:"exclude_terms,optional"`
	Regions      []string `json:"regions,optional"`
	Enabled      bool     `json:"enabled,optional"`
	BrandId      string   `json:"brand_id,optional"`
	ProductId    string   `json:"product_id,optional"`
}

type CreateWorkspaceReq struct {
	Name string `json:"name"`
}

type CrmConversionData struct {
	ContactId string  `json:"contact_id"`
	OutcomeId string  `json:"outcome_id,optional"`
	Stage     string  `json:"stage"`
	Amount    float64 `json:"amount,optional"`
	Currency  string  `json:"currency,optional"`
	Note      string  `json:"note,optional"`
	UpdatedAt int64   `json:"updated_at"`
}

type CrmStatsData struct {
	Terms                 []TermConversionStat    `json:"terms"`
	Variants              []VariantConversionStat `json:"variants"`
	Sources               []SourceConversionStat  `json:"sources"`
	UnavailableDimensions []string                `json:"unavailable_dimensions"`
}

type CrmStatsReq struct {
	From int64 `form:"from,optional"`
	To   int64 `form:"to,optional"`
}

type DeleteConversionReq struct {
	Id string `path:"id"`
}

type DeleteCrmConversionReq struct {
	Id string `path:"id"`
}

type DemandMapPhrase struct {
	Text      string `json:"text"`
	Kind      string `json:"kind"`
	BasisKind string `json:"basis_kind,optional"`
	BasisText string `json:"basis_text,optional"`
	Origin    string `json:"origin"` // product | user | ai
	Enabled   bool   `json:"enabled"`
}

type DemandMapProductReq struct {
	ProductId string `path:"productId"`
}

type DemandMapPublic struct {
	ProductId          string            `json:"product_id"`
	DemandInputVersion string            `json:"demand_input_version"`
	MapVersion         int64             `json:"map_version"`
	State              string            `json:"state"` // ready | incomplete | stale
	PainPhrases        []DemandMapPhrase `json:"pain_phrases"`
	ScenarioPhrases    []DemandMapPhrase `json:"scenario_phrases"`
	DesiredOutcomes    []DemandMapPhrase `json:"desired_outcomes"`
	SolutionSignals    []DemandMapPhrase `json:"solution_signals"`
	ExclusionSignals   []DemandMapPhrase `json:"exclusion_signals"`
	SourceBasis        []string          `json:"source_basis"`
	CustomPhrases      []DemandMapPhrase `json:"custom_phrases"`
	AiEnrichedAt       int64             `json:"ai_enriched_at,optional"`
	UpdatedAt          int64             `json:"updated_at"`
}

type DismissOpportunityReq struct {
	Id     string `path:"id"`
	Reason string `json:"reason,optional"`
}

type DraftReviewListData struct {
	List       []DraftReviewPublic `json:"list"`
	Pagination Pagination          `json:"pagination"`
}

type DraftReviewPublic struct {
	Id          string `json:"id"`
	RefType     string `json:"ref_type"`
	RefId       string `json:"ref_id"`
	WorkspaceId string `json:"workspace_id"`
	Status      string `json:"status"`
	Reason      string `json:"reason,optional"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
}

type Empty struct {
}

type EnrichDemandMapReq struct {
	ProductId          string `path:"productId"`
	PreviewId          string `json:"preview_id"`
	CreditCeiling      int    `json:"credit_ceiling"`
	ExpectedMapVersion int64  `json:"expected_map_version"`
}

type ExploreOpportunitiesData struct {
	SweepId                string `json:"sweep_id"`
	HitCount               int    `json:"hit_count"`
	JudgedCount            int    `json:"judged_count"`
	CreatedCount           int    `json:"created_count"`
	MatchedCount           int    `json:"matched_count"`
	MergedCount            int    `json:"merged_count"`
	TruncatedCount         int    `json:"truncated_count"`
	CreditsUsed            int    `json:"credits_used"`
	DedupedCount           int    `json:"deduped_count"`
	PrefilterPassCount     int    `json:"prefilter_pass_count"`
	PrefilterReviewCount   int    `json:"prefilter_review_count"`
	PrefilterRejectedCount int    `json:"prefilter_rejected_count"`
	CachedJudgmentCount    int    `json:"cached_judgment_count"`
	TombstoneMatchedCount  int    `json:"tombstone_matched_count"`
	BudgetDeferredCount    int    `json:"budget_deferred_count"`
	SweepStatus            string `json:"status"`
}

type ExploreOpportunitiesReq struct {
	Terms              []string `json:"terms"`
	BrandId            string   `json:"brand_id,optional"`
	ProductId          string   `json:"product_id,optional"`
	PreviewId          string   `json:"preview_id,optional"`
	CreditCeiling      int      `json:"credit_ceiling,optional"`
	DemandInputVersion string   `json:"demand_input_version,optional"`
	DemandMapVersion   int64    `json:"demand_map_version,optional"`
}

type ExportReportData struct {
	Url         string `json:"url"`
	ExpiresAt   int64  `json:"expires_at,optional"`
	Filename    string `json:"filename"`
	ContentType string `json:"content_type,optional"`
	Format      string `json:"format,optional"`
}

type ExportReportReq struct {
	WorkspaceId string `form:"workspace_id"`
	YearMonth   string `form:"year_month"`      // YYYY-MM
	Format      string `form:"format,optional"` // md | pdf
}

type ExternalTargetPublic struct {
	Url            string `json:"url"`
	RawUrl         string `json:"raw_url,optional"`
	Shortcode      string `json:"shortcode,optional"`
	AuthorUsername string `json:"author_username,optional"`
	TextPreview    string `json:"text_preview,optional"`
	MediaId        string `json:"media_id,optional"`
	ResolvedAt     int64  `json:"resolved_at,optional"`
}

type FaqItem struct {
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type FollowUpIdReq struct {
	Id string `path:"id"`
}

type FollowUpListData struct {
	List       []FollowUpPublic `json:"list"`
	Pagination Pagination       `json:"pagination"`
}

type FollowUpPublic struct {
	Id            string       `json:"id"`
	ContactId     string       `json:"contact_id"`
	DueAt         int64        `json:"due_at"`
	Status        string       `json:"status"` // scheduled | notified | done | snoozed | escalated
	NotifiedCount int          `json:"notified_count"`
	Contact       ContactBrief `json:"contact"`
	CreatedAt     int64        `json:"created_at"`
}

type GenerateFollowUpMessageData struct {
	Text string `json:"text"`
}

type GenerateFollowUpMessageReq struct {
	Id string `path:"id"`
}

type GenerateImageData struct {
	Id     string `json:"id"`
	Url    string `json:"url"`
	Prompt string `json:"prompt"`
}

type GenerateImageReq struct {
	Prompt string `json:"prompt"`
}

type GetAccountHealthReq struct {
	AccountId string `path:"accountId"`
}

type GetAiReq struct {
	Provider string `form:"provider,optional"`
}

type GetCheckupReq struct {
	Id string `path:"id"`
}

type GetContactReq struct {
	Id       string `path:"id"`
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
}

type GetOutcomeReq struct {
	Id string `path:"id"`
}

type HealthData struct {
	Status  string `json:"status"`
	Service string `json:"service"`
}

type IdentityPublic struct {
	LoginId     string `json:"login_id"`
	Platform    string `json:"platform"`
	AccountType string `json:"account_type"`
	CreatedAt   int64  `json:"created_at,optional"`
}

type ImportOpportunitiesData struct {
	Results []ImportedOpportunityResult `json:"results"`
}

type ImportOpportunitiesReq struct {
	Items     []ImportOpportunityItem `json:"items"`
	BrandId   string                  `json:"brand_id,optional"`
	ProductId string                  `json:"product_id,optional"`
}

type ImportOpportunityItem struct {
	Url      string `json:"url"`
	Text     string `json:"text"`
	Author   string `json:"author,optional"`
	PostedAt int64  `json:"posted_at,optional"`
}

type ImportPlaybookData struct {
	Id      string `json:"id"`
	Copied  bool   `json:"copied"`
	Message string `json:"message"`
}

type ImportProductData struct {
	Label          string   `json:"label"`
	ProductContext string   `json:"product_context"`
	PainPoints     []string `json:"pain_points"`
	MatchTags      []string `json:"match_tags"`
	PlacementUrl   string   `json:"placement_url"`
	SourceNote     string   `json:"source_note"`
}

type ImportProductReq struct {
	Url string `json:"url"`
}

type ImportThreadsAccountSessionData struct {
	Success   bool   `json:"success"`
	Valid     bool   `json:"valid"`
	Synced    bool   `json:"synced"`
	AccountId string `json:"account_id"`
	Username  string `json:"username,optional"`
	Message   string `json:"message"`
	UpdateAt  int64  `json:"update_at,optional"`
}

type ImportThreadsAccountSessionReq struct {
	Id           string `path:"id"`
	StorageState string `json:"storageState"`
}

type ImportedOpportunityResult struct {
	Url           string `json:"url"`
	OpportunityId string `json:"opportunity_id,optional"`
	Status        string `json:"status"` // qualified | rejected | skipped | failed
	IntentBand    string `json:"intent_band,optional"`
	IntentScore   int    `json:"intent_score,optional"`
	Error         string `json:"error,optional"`
}

type InsightsMonthBucket struct {
	MonthKey   string  `json:"month_key"`
	Posts      int     `json:"posts"`
	Views      int     `json:"views"`
	Likes      int     `json:"likes"`
	Replies    int     `json:"replies"`
	AvgEngRate float64 `json:"avg_eng_rate"`
}

type InsightsPostPublic struct {
	Id          string  `json:"id"`
	TextPreview string  `json:"text_preview"`
	PublishedAt int64   `json:"published_at"`
	ViewCount   int     `json:"view_count"`
	LikeCount   int     `json:"like_count"`
	ReplyCount  int     `json:"reply_count"`
	EngRate     float64 `json:"eng_rate"`
}

type InsightsSummaryData struct {
	AccountId    string                `json:"account_id,optional"`
	PostCount    int                   `json:"post_count"`
	TotalViews   int                   `json:"total_views"`
	TotalLikes   int                   `json:"total_likes"`
	TotalReplies int                   `json:"total_replies"`
	AvgEngRate   float64               `json:"avg_eng_rate"`
	TopPosts     []InsightsPostPublic  `json:"top_posts"`
	MonthBuckets []InsightsMonthBucket `json:"month_buckets"`
	Conclusion   string                `json:"conclusion"`
	Suggestions  []string              `json:"suggestions"`
}

type InsightsSummaryReq struct {
	AccountId string `form:"account_id,optional"`
	Months    int    `form:"months,default=3"`
}

type InspireChatData struct {
	Session  InspireSessionPublic   `json:"session"`
	Messages []InspireMessagePublic `json:"messages"`
}

type InspireChatReq struct {
	Message   string   `json:"message"`
	PinnedIds []string `json:"pinned_ids,optional"`
	Mode      string   `json:"mode,optional"` // chat|generate
	PersonaId string   `json:"persona_id,optional"`
	SessionId string   `json:"session_id,optional"` // 空 = active
	UseWeb    bool     `json:"use_web,optional"`
	Material  string   `json:"material,optional"`
}

type InspireDraftPublic struct {
	Title string `json:"title,optional"`
	Body  string `json:"body"`
}

type InspireElementIdPath struct {
	Id string `path:"id"`
}

type InspireElementListData struct {
	List []InspireElementPublic `json:"list"`
}

type InspireElementPublic struct {
	Id        string `json:"id"`
	Kind      string `json:"kind"`
	Title     string `json:"title"`
	Body      string `json:"body"`
	RefId     string `json:"ref_id,optional"`
	Reusable  bool   `json:"reusable"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type InspireElementSaveReq struct {
	Id       string `json:"id,optional"`
	Kind     string `json:"kind,optional"`
	Title    string `json:"title"`
	Body     string `json:"body"`
	RefId    string `json:"ref_id,optional"`
	Reusable bool   `json:"reusable,optional"`
}

type InspireMessagePublic struct {
	Id        string             `json:"id"`
	Role      string             `json:"role"`
	Text      string             `json:"text"`
	Draft     InspireDraftPublic `json:"draft,optional"`
	CreatedAt int64              `json:"created_at"`
}

type InspirePromptBlockPublic struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type InspirePromptPinnedPublic struct {
	Id    string `json:"id"`
	Kind  string `json:"kind"`
	Title string `json:"title"`
	Body  string `json:"body"`
}

type InspirePromptPreviewData struct {
	Prompt      string                      `json:"prompt"`
	Mode        string                      `json:"mode"`
	Sections    []string                    `json:"sections"`
	Blocks      []InspirePromptBlockPublic  `json:"blocks"`
	Fingerprint string                      `json:"fingerprint"`
	CharCount   int                         `json:"char_count"`
	RuneCount   int                         `json:"rune_count"`
	Pinned      []InspirePromptPinnedPublic `json:"pinned"`
	Note        string                      `json:"note,optional"`
}

type InspirePromptPreviewReq struct {
	Message   string   `json:"message,optional"`
	PinnedIds []string `json:"pinned_ids,optional"`
	Mode      string   `json:"mode,optional"` // chat|generate
	PersonaId string   `json:"persona_id,optional"`
	SessionId string   `json:"session_id,optional"`
	Material  string   `json:"material,optional"`
}

type InspireSessionCreateReq struct {
	Title string `json:"title,optional"`
}

type InspireSessionIdPath struct {
	Id string `path:"id"`
}

type InspireSessionListData struct {
	List []InspireSessionSummaryPublic `json:"list"`
}

type InspireSessionPublic struct {
	Id               string                 `json:"id"`
	Title            string                 `json:"title,optional"`
	Messages         []InspireMessagePublic `json:"messages"`
	PinnedElementIds []string               `json:"pinned_element_ids"`
	CreatedAt        int64                  `json:"created_at,optional"`
	UpdatedAt        int64                  `json:"updated_at"`
}

type InspireSessionSummaryPublic struct {
	Id           string `json:"id"`
	Title        string `json:"title"`
	Preview      string `json:"preview"`
	MessageCount int    `json:"message_count"`
	UpdatedAt    int64  `json:"updated_at"`
	CreatedAt    int64  `json:"created_at"`
	Active       bool   `json:"active"`
}

type InviteMemberBrief struct {
	Uid                int64    `json:"uid"`
	Email              string   `json:"email"`
	DisplayName        string   `json:"display_name"`
	InviteCode         string   `json:"invite_code"`
	ParentUid          int64    `json:"parent_uid,optional"` // 0 = 無上線
	Roles              []string `json:"roles"`
	Status             string   `json:"status"`
	DownlineCount      int      `json:"downline_count"`
	TotalDownlineCount int      `json:"total_downline_count"`
	Depth              int      `json:"depth"`
	JoinedAt           int64    `json:"joined_at"`
	AvatarUrl          string   `json:"avatar_url,optional"`
}

type InviteParentCandidatesData struct {
	List []InviteMemberBrief `json:"list"`
}

type InviteRewardPublic struct {
	Id         string `json:"id"`
	InviteeUid int64  `json:"invitee_uid"`
	PlanId     string `json:"plan_id"`
	Points     int    `json:"points"`
	Status     string `json:"status"`
	CreatedAt  int64  `json:"created_at"`
}

type InviteRewardsSummary struct {
	TotalPoints int                  `json:"total_points"`
	MonthPoints int                  `json:"month_points"`
	MonthCap    int                  `json:"month_cap"`
	Recent      []InviteRewardPublic `json:"recent"`
}

type InviteTreeData struct {
	List []InviteTreeNode `json:"list"`
}

type InviteTreeNode struct {
	Uid                int64            `json:"uid"`
	Email              string           `json:"email"`
	DisplayName        string           `json:"display_name"`
	InviteCode         string           `json:"invite_code"`
	ParentUid          int64            `json:"parent_uid,optional"`
	Roles              []string         `json:"roles"`
	Status             string           `json:"status"`
	DownlineCount      int              `json:"downline_count"`
	TotalDownlineCount int              `json:"total_downline_count"`
	Depth              int              `json:"depth"`
	JoinedAt           int64            `json:"joined_at"`
	AvatarUrl          string           `json:"avatar_url,optional"`
	Children           []InviteTreeNode `json:"children"`
}

type JobIdPath struct {
	Id string `path:"id"`
}

type JobListData struct {
	List       []JobPublic `json:"list"`
	Pagination Pagination  `json:"pagination"`
}

type JobListReq struct {
	Tab      string `form:"tab,optional"`
	Page     int    `form:"page,optional"`
	PageSize int    `form:"pageSize,optional"`
}

type JobPublic struct {
	Id              string `json:"id"`
	TemplateType    string `json:"template_type"`
	Status          string `json:"status"`
	ProgressSummary string `json:"progress_summary"`
	ProgressPercent int    `json:"progress_percent"`
	Error           string `json:"error,optional"`
	RefId           string `json:"ref_id,optional"`
	Payload         string `json:"payload,optional"`
	RunAfter        int64  `json:"run_after,optional"`
	CreatedAt       int64  `json:"created_at"`
	UpdatedAt       int64  `json:"updated_at"`
	CompletedAt     int64  `json:"completed_at,optional"`
}

type ListCheckupsReq struct {
	Page     int `form:"page,default=1"`
	PageSize int `form:"pageSize,default=20"`
}

type ListContactsReq struct {
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
	Query    string `form:"query,optional"`
	Stage    string `form:"stage,optional"`
	FollowUp string `form:"follow_up,optional"`
	Band     string `form:"band,optional"`
	Sort     string `form:"sort,optional"`
}

type ListDraftReviewsReq struct {
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
	Status   string `form:"status,optional"`
}

type ListFollowUpsReq struct {
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
	Status   string `form:"status,optional"`
}

type ListModelsData struct {
	List          []string `json:"list"`
	Provider      string   `json:"provider"`
	SelectedModel string   `json:"selected_model,optional"`
	FromCache     bool     `json:"from_cache,optional"`
	ModelsError   string   `json:"models_error,optional"`
}

type ListModelsReq struct {
	Provider string `form:"provider,optional"`
}

type ListOpportunitiesReq struct {
	Page         int    `form:"page,default=1"`
	PageSize     int    `form:"pageSize,default=20"`
	Band         string `form:"band,optional"`
	Status       string `form:"status,optional"`
	WatchId      string `form:"watch_id,optional"`
	BrandId      string `form:"brand_id,optional"`
	ProductId    string `form:"product_id,optional"`
	FitBand      string `form:"fit_band,optional"`
	MatchState   string `form:"match_state,optional"`
	ReviewState  string `form:"review_state,optional"`
	TimeScope    string `form:"time_scope,optional"`    // today | 7d | all
	PriorityBand string `form:"priority_band,optional"` // high | review | low
	Sort         string `form:"sort,optional"`
	From         int64  `form:"from,optional"`
	To           int64  `form:"to,optional"`
}

type ListOutcomesReq struct {
	Page       int    `form:"page,default=1"`
	PageSize   int    `form:"pageSize,default=20"`
	Kind       string `form:"kind,optional"`
	Confidence string `form:"confidence,optional"`
	SourceType string `form:"source_type,optional"`
	From       int64  `form:"from,optional"`
	To         int64  `form:"to,optional"`
}

type ListParentCandidatesReq struct {
	ExcludeSubtreeRootUid int64 `form:"exclude_subtree_root_uid,optional"`
}

type ListPlaybooksReq struct {
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
	Kind     string `form:"kind,optional"`
	Niche    string `form:"niche,optional"`
	Mine     bool   `form:"mine,optional"`
}

type ListRepliesReq struct {
	Id string `path:"id"`
}

type ListSweepsReq struct {
	Page     int    `form:"page,default=1"`
	PageSize int    `form:"pageSize,default=20"`
	WatchId  string `form:"watch_id,optional"`
	From     int64  `form:"from,optional"`
	To       int64  `form:"to,optional"`
}

type ListWatchesReq struct {
	Page        int    `form:"page,default=1"`
	PageSize    int    `form:"pageSize,default=20"`
	Status      string `form:"status,optional"`
	ContextMode string `form:"context_mode,optional"`
	BrandId     string `form:"brand_id,optional"`
	ProductId   string `form:"product_id,optional"`
}

type ListWorkspaceMembersReq struct {
	Id string `path:"id"`
}

type MarkReplyUsedData struct {
	Reply        ReplyVariantPublic `json:"reply"`
	HealthAdvice string             `json:"health_advice,optional"`
}

type MarkReplyUsedReq struct {
	Id        string `path:"id"`
	ReplyId   string `path:"replyId"`
	Channel   string `json:"channel"` // outbox | manual_copy
	AccountId string `json:"account_id,optional"`
}

type MediaUploadData struct {
	Url string `json:"url"`
	Key string `json:"key,optional"`
}

type MediaUploadReq struct {
	Content string `json:"content"`
	Kind    string `json:"kind,optional"`
}

type MemberPublic struct {
	TenantId          string           `json:"tenant_id"`
	Uid               int64            `json:"uid"`
	Email             string           `json:"email"`
	Phone             string           `json:"phone,optional"`
	DisplayName       string           `json:"display_name"`
	Nickname          string           `json:"nickname,optional"`
	FullName          string           `json:"full_name,optional"`
	Roles             []string         `json:"roles"`
	Status            string           `json:"status"`
	EmailVerified     bool             `json:"email_verified"`
	EmailVerifiedAt   int64            `json:"email_verified_at,optional"`
	PhoneVerified     bool             `json:"phone_verified,optional"`
	PhoneVerifiedAt   int64            `json:"phone_verified_at,optional"`
	InviteCode        string           `json:"invite_code,optional"`
	ParentUid         int64            `json:"parent_uid,optional"`
	Bio               string           `json:"bio,optional"`
	Timezone          string           `json:"timezone,optional"`
	AvatarUrl         string           `json:"avatar_url,optional"`
	NotifyEmail       bool             `json:"notify_email,optional"`
	GenderCode        int              `json:"gender_code,optional"`
	Birthdate         int64            `json:"birthdate,optional"`
	National          string           `json:"national,optional"`
	Address           string           `json:"address,optional"`
	PostCode          string           `json:"post_code,optional"`
	PreferredLanguage string           `json:"preferred_language,optional"`
	Currency          string           `json:"currency,optional"`
	OnboardingStatus  string           `json:"onboarding_status,optional"`
	OnboardingDoneAt  int64            `json:"onboarding_done_at,optional"`
	Identities        []IdentityPublic `json:"identities,optional"`
	JoinedAt          int64            `json:"joined_at,optional"`
	CreatedAt         int64            `json:"created_at,optional"`
	UpdatedAt         int64            `json:"updated_at,optional"`
}

type MentionGenerateReq struct {
	Id        string `path:"id"`
	PersonaId string `json:"persona_id,optional"`
}

type MentionIdPath struct {
	Id string `path:"id"`
}

type MentionListData struct {
	List []MentionPublic `json:"list"`
}

type MentionListReq struct {
	AccountId string `form:"account_id,optional"`
}

type MentionMarkRepliedReq struct {
	Id        string   `path:"id"`
	Text      string   `json:"text,optional"`
	ImageUrls []string `json:"image_urls,optional"`
}

type MentionPublic struct {
	Id             string `json:"id"`
	AccountId      string `json:"account_id"`
	MediaId        string `json:"media_id,optional"`
	FromUsername   string `json:"from_username"`
	Text           string `json:"text"`
	ContextSnippet string `json:"context_snippet"`
	Permalink      string `json:"permalink,optional"`
	Status         string `json:"status"`
	DraftText      string `json:"draft_text,optional"`
	CreatedAt      int64  `json:"created_at"`
}

type MentionSyncReq struct {
	AccountId string `json:"account_id"`
}

type MergeContactReq struct {
	Id              string `path:"id"`
	SourceContactId string `json:"source_contact_id"`
}

type MoveInviteMemberReq struct {
	Uid       int64 `json:"uid"`
	ParentUid int64 `json:"parent_uid,optional"` // 0 = 獨立根
}

type MyInviteNetworkData struct {
	Me                 InviteMemberBrief     `json:"me"`
	Upline             *InviteMemberBrief    `json:"upline,optional"`
	Downlines          []InviteMemberBrief   `json:"downlines"`
	TotalDownlineCount int                   `json:"total_downline_count"`
	Rewards            *InviteRewardsSummary `json:"rewards,optional"`
}

type NotificationIdPath struct {
	Id string `path:"id"`
}

type NotificationListData struct {
	List []NotificationPublic `json:"list"`
}

type NotificationPublic struct {
	Id        string `json:"id"`
	Title     string `json:"title"`
	Body      string `json:"body"`
	Kind      string `json:"kind"` // job|system
	RefType   string `json:"ref_type"`
	RefId     string `json:"ref_id,optional"`
	ReadAt    int64  `json:"read_at,optional"`
	CreatedAt int64  `json:"created_at"`
}

type OkData struct {
	Ok      bool   `json:"ok"`
	Message string `json:"message,optional"`
}

type OpportunityIdReq struct {
	Id string `path:"id"`
}

type OpportunityListData struct {
	List       []OpportunityPublic `json:"list"`
	Pagination Pagination          `json:"pagination"`
}

type OpportunityOverride struct {
	FromBand   string `json:"from_band,optional"`
	ToBand     string `json:"to_band,optional"`
	FromStatus string `json:"from_status,optional"`
	ToStatus   string `json:"to_status,optional"`
	ActorUid   int64  `json:"actor_uid"`
	At         int64  `json:"at"`
}

type OpportunityPublic struct {
	Id                       string               `json:"id"`
	WatchId                  string               `json:"watch_id,optional"`
	Source                   string               `json:"source"` // threads | manual | scout_promote
	SourceScoutPostId        string               `json:"source_scout_post_id,optional"`
	ExternalId               string               `json:"external_id"`
	Permalink                string               `json:"permalink"`
	AuthorHandle             string               `json:"author_handle"`
	Text                     string               `json:"text"`
	PostedAt                 int64                `json:"posted_at"`
	Status                   string               `json:"status"` // judging | qualified | rejected | accepted | dismissed
	IntentScore              int                  `json:"intent_score"`
	IntentBand               string               `json:"intent_band"` // high | mid | low
	Reasons                  []OpportunityReason  `json:"reasons"`
	RegionDetected           string               `json:"region_detected,optional"`
	RegionMatch              string               `json:"region_match"` // match | mismatch | unknown
	FreshnessHours           int                  `json:"freshness_hours"`
	MatchedService           string               `json:"matched_service,optional"`
	MatchedTerms             []string             `json:"matched_terms"`
	RejectReason             string               `json:"reject_reason,optional"`
	Override                 *OpportunityOverride `json:"override,optional"`
	ContactId                string               `json:"contact_id,optional"`
	DefaultReply             *ReplyVariantPublic  `json:"default_reply,optional"`
	PrimaryBrandId           string               `json:"primary_brand_id,optional"`
	PrimaryProductId         string               `json:"primary_product_id,optional"`
	PrimaryBrandName         string               `json:"primary_brand_name,optional"`
	PrimaryProductLabel      string               `json:"primary_product_label,optional"`
	PrimaryProductFitScore   int                  `json:"primary_product_fit_score,optional"`
	PrimaryProductFitBand    string               `json:"primary_product_fit_band,optional"`
	PrimaryProductOverridden bool                 `json:"primary_product_overridden,optional"`
	ProductMatches           []ProductMatchPublic `json:"product_matches"`
	ReviewState              string               `json:"review_state"` // pending | completed | removed
	PreviousReviewState      string               `json:"previous_review_state,optional"`
	RemovalReason            string               `json:"removal_reason,optional"`
	RemovalNote              string               `json:"removal_note,optional"`
	RemovedAt                int64                `json:"removed_at,optional"`
	RemovedBy                int64                `json:"removed_by,optional"`
	LastMatchedAt            int64                `json:"last_matched_at,optional"`
	PriorityScore            int                  `json:"priority_score"`
	PriorityBand             string               `json:"priority_band"` // high | review | low
	PainFitScore             int                  `json:"pain_fit_score,optional"`
	DemandIntentScore        int                  `json:"demand_intent_score,optional"`
	EvidenceQualityScore     int                  `json:"evidence_quality_score,optional"`
	FreshnessScore           int                  `json:"freshness_score,optional"`
	DemandEvidence           []string             `json:"demand_evidence,optional"`
	DemandInputVersion       string               `json:"demand_input_version,optional"`
	DemandMapVersion         int64                `json:"demand_map_version,optional"`
	CreatedAt                int64                `json:"created_at"`
}

type OpportunityReason struct {
	Dimension string `json:"dimension"` // authenticity | intent | region | freshness | fit
	Score     int    `json:"score"`
	Reason    string `json:"reason"`
}

type OutboxIdPath struct {
	Id string `path:"id"`
}

type OutboxListData struct {
	List []OutboxPublic `json:"list"`
}

type OutboxPublic struct {
	Id        string             `json:"id"`
	PlayId    string             `json:"play_id"`
	Title     string             `json:"title"`
	Status    string             `json:"status"`
	Steps     []OutboxStepPublic `json:"steps"`
	CreatedAt int64              `json:"created_at"`
	UpdatedAt int64              `json:"updated_at"`
}

type OutboxRetryPath struct {
	Id     string `path:"id"`
	StepId string `path:"stepId"`
}

type OutboxStepPublic struct {
	Id          string `json:"id"`
	StepId      string `json:"step_id"`
	SortOrder   int    `json:"sort_order"`
	Kind        string `json:"kind"`
	AccountId   string `json:"account_id"`
	Text        string `json:"text"`
	Status      string `json:"status"`
	Error       string `json:"error,optional"`
	ScheduledAt int64  `json:"scheduled_at,optional"`
	PublishedAt int64  `json:"published_at,optional"`
}

type OutcomeEventPublic struct {
	Id                 string  `json:"id"`
	SourceType         string  `json:"source_type"`
	SourceId           string  `json:"source_id"`
	ThreadsAccountId   string  `json:"threads_account_id,optional"`
	Kind               string  `json:"kind"`
	Confidence         string  `json:"confidence"`
	Status             string  `json:"status"`
	ReplyCountDelta    int     `json:"reply_count_delta,optional"`
	LikeCountDelta     int     `json:"like_count_delta,optional"`
	FollowersDelta     int     `json:"followers_delta,optional"`
	ConversionAmount   float64 `json:"conversion_amount,optional"`
	ConversionNote     string  `json:"conversion_note,optional"`
	ConversionCurrency string  `json:"conversion_currency,optional"`
	WindowEndsAt       int64   `json:"window_ends_at"`
	SentAt             int64   `json:"sent_at"`
	CreatedAt          int64   `json:"created_at"`
	UpdatedAt          int64   `json:"updated_at"`
}

type OutcomeListData struct {
	List       []OutcomeEventPublic `json:"list"`
	Pagination Pagination           `json:"pagination"`
}

type OutcomeSummaryData struct {
	From             int64   `json:"from"`
	To               int64   `json:"to"`
	Reach            int     `json:"reach"`
	Conversations    int     `json:"conversations"`
	FollowsPossible  int     `json:"follows_possible"`
	FollowsConfirmed int     `json:"follows_confirmed"`
	Conversions      int     `json:"conversions"`
	ConversionAmount float64 `json:"conversion_amount"`
}

type OutcomeSummaryReq struct {
	Range string `form:"range,default=week"` // week | month
	From  int64  `form:"from,optional"`
	To    int64  `form:"to,optional"`
}

type OverrideOpportunityReq struct {
	Id     string `path:"id"`
	Band   string `json:"band,optional"`
	Status string `json:"status,optional"`
	Note   string `json:"note,optional"`
}

type OwnPostAnalyzeReq struct {
	PostId string `json:"post_id"`
}

type OwnPostGenerateReplyData struct {
	Text string `json:"text"`
}

type OwnPostGenerateReplyReq struct {
	PostId    string `json:"post_id"`
	ReplyId   string `json:"reply_id,optional"`
	PersonaId string `json:"persona_id,optional"`
}

type OwnPostLastSyncedData struct {
	LastSyncedAt int64 `json:"last_synced_at"`
}

type OwnPostListData struct {
	List []OwnPostPublic `json:"list"`
}

type OwnPostListReq struct {
	AccountId string `form:"account_id,optional"`
}

type OwnPostLoadRepliesReq struct {
	PostId string `json:"post_id"`
}

type OwnPostManageReplyReq struct {
	PostId  string `json:"post_id"`
	ReplyId string `json:"reply_id"`
	Hide    bool   `json:"hide"`
}

type OwnPostPublic struct {
	Id             string               `json:"id"`
	AccountId      string               `json:"account_id"`
	MediaId        string               `json:"media_id,optional"`
	Text           string               `json:"text"`
	MediaType      string               `json:"media_type"`
	MediaUrl       string               `json:"media_url,optional"`
	ThumbnailUrl   string               `json:"thumbnail_url,optional"`
	Permalink      string               `json:"permalink,optional"`
	Shortcode      string               `json:"shortcode,optional"`
	TopicTag       string               `json:"topic_tag,optional"`
	LikeCount      int                  `json:"like_count"`
	ReplyCount     int                  `json:"reply_count"`
	RepostCount    int                  `json:"repost_count"`
	QuoteCount     int                  `json:"quote_count"`
	ViewCount      int                  `json:"view_count"`
	ShareCount     int                  `json:"share_count"`
	InsightsStatus string               `json:"insights_status,optional"`
	FormulaSummary string               `json:"formula_summary,optional"`
	Insight        string               `json:"insight,optional"`
	FormulaDetail  string               `json:"formula_detail,optional"`
	Replies        []OwnPostReplyPublic `json:"replies"`
	PublishedAt    int64                `json:"published_at"`
	ReplyControl   string               `json:"reply_control,optional"`
}

type OwnPostReplyPublic struct {
	Id            string `json:"id"`
	Username      string `json:"username"`
	Text          string `json:"text"`
	CreatedAt     int64  `json:"created_at"`
	LikeCount     int    `json:"like_count,optional"`
	ReplyStatus   string `json:"reply_status,optional"`
	RepliedBy     string `json:"replied_by,optional"`
	RepliedAt     int64  `json:"replied_at,optional"`
	ParentReplyId string `json:"parent_reply_id,optional"`
	IsMine        bool   `json:"is_mine,optional"`
	HideStatus    string `json:"hide_status,optional"`
}

type OwnPostSendReplyReq struct {
	PostId    string   `json:"post_id"`
	ReplyId   string   `json:"reply_id,optional"`
	Text      string   `json:"text"`
	AccountId string   `json:"account_id,optional"`
	ImageUrls []string `json:"image_urls,optional"`
}

type OwnPostSetReplyControlReq struct {
	PostId       string `json:"post_id"`
	ReplyControl string `json:"reply_control"`
}

type OwnPostSyncReq struct {
	AccountId string `json:"account_id"`
}

type Pagination struct {
	Page       int   `json:"page"`
	PageSize   int   `json:"pageSize"`
	Total      int64 `json:"total"`
	TotalPages int   `json:"totalPages"`
}

type PainKeywordsData struct {
	Keywords   []string `json:"keywords"`
	Pains      []string `json:"pains"`
	ScanTerms  []string `json:"scan_terms"`
	Summary    string   `json:"summary"`
	SignupHint string   `json:"signup_hint"`
}

type PainKeywordsReq struct {
	ProductBrief string `json:"product_brief"`
	Audience     string `json:"audience,optional"`
}

type PersonaActiveData struct {
	Id string `json:"id"`
}

type PersonaAnalyzeAccountReq struct {
	Id       string `path:"id"`
	Username string `json:"username"`
}

type PersonaAnalyzeTextReq struct {
	Id          string `path:"id"`
	RawText     string `json:"raw_text"`
	SourceLabel string `json:"source_label,optional"`
}

type PersonaDraftPublic struct {
	Identity             string `json:"identity"`
	Tone                 string `json:"tone"`
	Audience             string `json:"audience"`
	Hooks                string `json:"hooks"`
	LanguageFingerprint  string `json:"language_fingerprint"`
	Rhythm               string `json:"rhythm"`
	Punctuation          string `json:"punctuation"`
	ContentPatterns      string `json:"content_patterns"`
	KnowledgeTranslation string `json:"knowledge_translation"`
	CtaStyle             string `json:"cta_style"`
	Examples             string `json:"examples"`
	Avoid                string `json:"avoid"`
}

type PersonaGuardPublic struct {
	Avoid     []string `json:"avoid"`
	MaxChars  int      `json:"max_chars"`
	BanAiTone bool     `json:"ban_ai_tone"`
}

type PersonaIdPath struct {
	Id string `path:"id"`
}

type PersonaListData struct {
	List []PersonaPublic `json:"list"`
}

type PersonaPublic struct {
	Id                    string             `json:"id"`
	Name                  string             `json:"name"`
	Brief                 string             `json:"brief"`
	Status                string             `json:"status"`
	Style                 PersonaStylePublic `json:"style"`
	Guard                 PersonaGuardPublic `json:"guard"`
	Voice                 string             `json:"voice,optional"`
	Notes                 string             `json:"notes,optional"`
	LearningSummary       string             `json:"learning_summary,optional"`
	LearningVersion       int                `json:"learning_version,optional"`
	LearnedFromPostsCount int                `json:"learned_from_posts_count,optional"`
	LastLearnedAt         int64              `json:"last_learned_at,optional"`
	CreatedAt             int64              `json:"created_at"`
	UpdatedAt             int64              `json:"updated_at"`
}

type PersonaSaveReq struct {
	Id     string             `json:"id,optional"`
	Name   string             `json:"name"`
	Brief  string             `json:"brief,optional"`
	Status string             `json:"status,optional"`
	Style  PersonaStylePublic `json:"style,optional"`
	Guard  PersonaGuardPublic `json:"guard,optional"`
	Voice  string             `json:"voice,optional"`
	Notes  string             `json:"notes,optional"`
}

type PersonaSetActiveReq struct {
	Id string `json:"id"`
}

type PersonaStylePublic struct {
	Draft             PersonaDraftPublic              `json:"draft"`
	DraftText         string                          `json:"draft_text"`
	Source            string                          `json:"source"`
	BenchmarkUsername string                          `json:"benchmark_username,optional"`
	SourceLabel       string                          `json:"source_label,optional"`
	SampleCount       int                             `json:"sample_count"`
	AnalyzedAt        int64                           `json:"analyzed_at,optional"`
	SamplePreviews    []string                        `json:"sample_previews,optional"`
	Dimensions        map[string]StyleDimensionPublic `json:"dimensions,optional"`
}

type PlacementSettingsData struct {
	WebSearchProvider     string `json:"web_search_provider"`
	ExpandStrategy        string `json:"expand_strategy"`
	BraveApiKeyConfigured bool   `json:"brave_api_key_configured"`
	ExaApiKeyConfigured   bool   `json:"exa_api_key_configured"`
	DevModeEnabled        bool   `json:"dev_mode_enabled"`
	PlatformKeyAvailable  bool   `json:"platform_key_available"`
}

type PlayByExternalReq struct {
	Url string `form:"url"`
}

type PlayByPostReq struct {
	OwnPostId string `form:"own_post_id"`
}

type PlayGenerateScriptData struct {
	JobId string `json:"job_id"`
	Async bool   `json:"async"`
}

type PlayGenerateStepData struct {
	Text string `json:"text"`
}

type PlayGenerateStepReq struct {
	PersonaId    string `json:"persona_id,optional"`
	Context      string `json:"context"` // 主貼／上一則／目標文
	Topic        string `json:"topic,optional"`
	SpeakerLabel string `json:"speaker_label,optional"`
	IsLead       bool   `json:"is_lead,optional"`
	Mode         string `json:"mode,optional"`
}

type PlayIdPath struct {
	Id string `path:"id"`
}

type PlayListData struct {
	List []PlayPublic `json:"list"`
}

type PlayPublic struct {
	Id              string               `json:"id"`
	Title           string               `json:"title"`
	Topic           string               `json:"topic"`
	Status          string               `json:"status"`
	LeadAccountId   string               `json:"lead_account_id"`
	CastAccountIds  []string             `json:"cast_account_ids"`
	TargetOwnPostId string               `json:"target_own_post_id,optional"`
	TargetExternal  ExternalTargetPublic `json:"target_external,optional"`
	Steps           []PlayStepPublic     `json:"steps"`
	ScheduleStartAt int64                `json:"schedule_start_at"`
	IntervalMinutes int                  `json:"interval_minutes,optional"`
	CreatedAt       int64                `json:"created_at"`
	UpdatedAt       int64                `json:"updated_at"`
}

type PlayResolveReq struct {
	Url string `json:"url"`
}

type PlaySaveReq struct {
	Id              string               `json:"id,optional"`
	Title           string               `json:"title"`
	Topic           string               `json:"topic,optional"`
	Status          string               `json:"status,optional"`
	LeadAccountId   string               `json:"lead_account_id"`
	CastAccountIds  []string             `json:"cast_account_ids,optional"`
	TargetOwnPostId string               `json:"target_own_post_id,optional"`
	TargetExternal  ExternalTargetPublic `json:"target_external,optional"`
	Steps           []PlayStepPublic     `json:"steps"`
	ScheduleStartAt int64                `json:"schedule_start_at,optional"`
	IntervalMinutes int                  `json:"interval_minutes,optional"`
}

type PlayStepPublic struct {
	Id                   string   `json:"id"`
	SortOrder            int      `json:"sort_order"`
	Kind                 string   `json:"kind"`
	AccountId            string   `json:"account_id"`
	Text                 string   `json:"text"`
	DelayFromPreviousSec int      `json:"delay_from_previous_sec"`
	PersonaId            string   `json:"persona_id,optional"`
	BrandId              string   `json:"brand_id,optional"`
	ImageUrls            []string `json:"image_urls,optional"`
}

type PlaybookIdPath struct {
	Id string `path:"id"`
}

type PlaybookListData struct {
	List       []PlaybookPublic `json:"list"`
	Pagination Pagination       `json:"pagination"`
}

type PlaybookPublic struct {
	Id          string `json:"id"`
	Kind        string `json:"kind"` // brief | persona | play
	Title       string `json:"title"`
	Niche       string `json:"niche"`
	Body        string `json:"body"`
	Anonymous   bool   `json:"anonymous"`
	AuthorLabel string `json:"author_label"`
	ImportCount int    `json:"import_count"`
	CreatedAt   int64  `json:"created_at"`
	Mine        bool   `json:"mine,optional"`
}

type ProductFitReasonPublic struct {
	Dimension        string `json:"dimension"` // pain | scenario | audience | capability
	Score            int    `json:"score"`
	Reason           string `json:"reason"`
	CandidateExcerpt string `json:"candidate_excerpt,optional"`
	ProductBasis     string `json:"product_basis,optional"`
}

type ProductIdPath struct {
	Id string `path:"id"`
}

type ProductListData struct {
	List []ProductPublic `json:"list"`
}

type ProductListReq struct {
	BrandId string `form:"brand_id,optional"`
}

type ProductMatchPublic struct {
	BrandId              string                   `json:"brand_id"`
	ProductId            string                   `json:"product_id"`
	BrandNameSnapshot    string                   `json:"brand_name_snapshot"`
	ProductLabelSnapshot string                   `json:"product_label_snapshot"`
	BrandUpdatedAt       int64                    `json:"brand_updated_at"`
	ProductUpdatedAt     int64                    `json:"product_updated_at"`
	ProductFitScore      int                      `json:"product_fit_score"`
	ProductFitBand       string                   `json:"product_fit_band"` // strong | possible | weak
	Eligible             bool                     `json:"eligible"`
	Excluded             bool                     `json:"excluded"`
	ExcludeReason        string                   `json:"exclude_reason,optional"`
	Reasons              []ProductFitReasonPublic `json:"reasons"`
	Risks                []string                 `json:"risks"`
	WatchIds             []string                 `json:"watch_ids"`
	MatchedTerms         []string                 `json:"matched_terms"`
	MatchedAt            int64                    `json:"matched_at"`
}

type ProductPublic struct {
	Id                      string   `json:"id"`
	BrandId                 string   `json:"brand_id"`
	Label                   string   `json:"label"`
	ProductContext          string   `json:"product_context"`
	MatchTags               []string `json:"match_tags"`
	PainPoints              []string `json:"pain_points"`
	ProviderCapabilityTerms []string `json:"provider_capability_terms"`
	ProviderExcludeTerms    []string `json:"provider_exclude_terms"`
	PlacementUrl            string   `json:"placement_url,optional"`
	CreatedAt               int64    `json:"created_at"`
	UpdatedAt               int64    `json:"updated_at"`
}

type ProductSaveReq struct {
	Id                      string   `json:"id,optional"`
	BrandId                 string   `json:"brand_id"`
	Label                   string   `json:"label"`
	ProductContext          string   `json:"product_context,optional"`
	MatchTags               []string `json:"match_tags,optional"`
	PainPoints              []string `json:"pain_points,optional"`
	ProviderCapabilityTerms []string `json:"provider_capability_terms,optional"`
	ProviderExcludeTerms    []string `json:"provider_exclude_terms,optional"`
	PlacementUrl            string   `json:"placement_url,optional"`
}

type PromoteScoutPostData struct {
	OpportunityId string `json:"opportunity_id"`
	Status        string `json:"status"`
	IntentBand    string `json:"intent_band,optional"`
	IntentScore   int    `json:"intent_score,optional"`
}

type PublishPlaybookReq struct {
	Kind      string `json:"kind"`
	Title     string `json:"title"`
	Niche     string `json:"niche,optional"`
	Body      string `json:"body"`
	Anonymous bool   `json:"anonymous,optional"`
}

type RadarSweepPublic struct {
	Id                     string `json:"id"`
	WatchId                string `json:"watch_id"`
	JobId                  string `json:"job_id,optional"`
	Path                   string `json:"path"` // api | crawler
	HitCount               int    `json:"hit_count"`
	JudgedCount            int    `json:"judged_count"`
	CreatedCount           int    `json:"created_count"`
	TruncatedCount         int    `json:"truncated_count"`
	MatchEvaluatedCount    int    `json:"match_evaluated_count"`
	MatchMergedCount       int    `json:"match_merged_count"`
	FitRejectedCount       int    `json:"fit_rejected_count"`
	FailedReason           string `json:"failed_reason,optional"`
	CreditsUsed            int    `json:"credits_used"`
	StartedAt              int64  `json:"started_at"`
	EndedAt                int64  `json:"ended_at,optional"`
	DemandInputVersion     string `json:"demand_input_version,optional"`
	DemandMapVersion       int64  `json:"demand_map_version,optional"`
	DedupedCount           int    `json:"deduped_count"`
	PrefilterPassCount     int    `json:"prefilter_pass_count"`
	PrefilterReviewCount   int    `json:"prefilter_review_count"`
	PrefilterRejectedCount int    `json:"prefilter_rejected_count"`
	CachedJudgmentCount    int    `json:"cached_judgment_count"`
	TombstoneMatchedCount  int    `json:"tombstone_matched_count"`
	BudgetDeferredCount    int    `json:"budget_deferred_count"`
	SweepStatus            string `json:"status"` // complete | partial_budget | blocked_budget | failed
	CreditSearch           int    `json:"credit_search"`
	CreditDemandMap        int    `json:"credit_demand_map"`
	CreditJudge            int    `json:"credit_judge"`
	CreditReply            int    `json:"credit_reply"`
}

type RadarTodayData struct {
	Stats          RadarTodayStats     `json:"stats"`
	High           []OpportunityPublic `json:"high"`
	Mid            []OpportunityPublic `json:"mid"`
	Low            []OpportunityPublic `json:"low"`
	TruncatedCount int                 `json:"truncated_count"`
	LastSweptAt    int64               `json:"last_swept_at,optional"`
	EmptyReason    string              `json:"empty_reason,optional"`
	EmptyHint      string              `json:"empty_hint,optional"`
}

type RadarTodayReq struct {
	BrandId   string `form:"brand_id,optional"`
	ProductId string `form:"product_id,optional"`
	FitBand   string `form:"fit_band,optional"`
}

type RadarTodayStats struct {
	Total int `json:"total"`
	High  int `json:"high"`
	Mid   int `json:"mid"`
	Low   int `json:"low"`
}

type RadarWatchPublic struct {
	Id                   string   `json:"id"`
	Terms                []string `json:"terms"`
	ExcludeTerms         []string `json:"exclude_terms"`
	Regions              []string `json:"regions"`
	Status               string   `json:"status"`       // active | paused | archived
	ContextMode          string   `json:"context_mode"` // generic | product
	BrandId              string   `json:"brand_id,optional"`
	ProductId            string   `json:"product_id,optional"`
	BrandNameSnapshot    string   `json:"brand_name_snapshot,optional"`
	ProductLabelSnapshot string   `json:"product_label_snapshot,optional"`
	ContextBoundAt       int64    `json:"context_bound_at,optional"`
	PauseReason          string   `json:"pause_reason,optional"`
	LastSweptAt          int64    `json:"last_swept_at,optional"`
	CreatedAt            int64    `json:"created_at"`
	UpdatedAt            int64    `json:"updated_at"`
	FirstSweepTriggered  bool     `json:"first_sweep_triggered,optional"`
}

type RemoveWorkspaceMemberReq struct {
	Id  string `path:"id"`
	Uid int64  `path:"uid"`
}

type ReplyListData struct {
	List []ReplyVariantPublic `json:"list"`
}

type ReplyVariantPublic struct {
	Id            string `json:"id"`
	OpportunityId string `json:"opportunity_id"`
	Variant       string `json:"variant"` // public_comment | dm | no_sales | professional | humorous
	Text          string `json:"text"`
	UsedAt        int64  `json:"used_at,optional"`
	SentChannel   string `json:"sent_channel,optional"` // outbox | manual_copy
	OutboxId      string `json:"outbox_id,optional"`
	CreatedAt     int64  `json:"created_at"`
}

type ReportConversionReq struct {
	Id       string  `path:"id"`
	Amount   float64 `json:"amount,optional"`
	Note     string  `json:"note,optional"`
	Currency string  `json:"currency,optional"`
}

type ResearchHitPublic struct {
	Id          string   `json:"id"`
	Title       string   `json:"title"`
	Snippet     string   `json:"snippet"`
	Url         string   `json:"url"`
	Summary     string   `json:"summary,optional"`
	LearnPoints []string `json:"learn_points,optional"`
	ReplyHooks  []string `json:"reply_hooks,optional"`
	SourceLabel string   `json:"source_label,optional"`
}

type ResearchSearchData struct {
	List []ResearchHitPublic `json:"list"`
}

type ResearchSearchReq struct {
	Query string `json:"query"`
}

type ReviewDecisionReq struct {
	Id     string `path:"id"`
	Reason string `json:"reason,optional"`
}

type ReviewStateReq struct {
	Id                     string `path:"id"`
	State                  string `json:"state"` // pending | completed | removed
	RemovalReason          string `json:"removal_reason,optional"`
	RemovalNote            string `json:"removal_note,optional"`
	DuplicateOpportunityId string `json:"duplicate_of_opportunity_id,optional"`
}

type SaveAiReq struct {
	Provider                 string `json:"provider,optional"`
	Model                    string `json:"model,optional"`
	ResearchProvider         string `json:"research_provider,optional"`
	ResearchModel            string `json:"research_model,optional"`
	ApiKey                   string `json:"api_key,optional"`
	ResearchApiKey           string `json:"research_api_key,optional"`
	ApiKeyConfigured         *bool  `json:"api_key_configured,optional"`
	ResearchApiKeyConfigured *bool  `json:"research_api_key_configured,optional"`
}

type SavePlacementReq struct {
	ExpandStrategy      string `json:"expand_strategy,optional"`
	DevModeEnabled      *bool  `json:"dev_mode_enabled,optional"`
	ExaApiKey           string `json:"exa_api_key,optional"`
	ExaApiKeyConfigured *bool  `json:"exa_api_key_configured,optional"`
}

type ScoutBriefPublic struct {
	Intent         string   `json:"intent"`
	Mode           string   `json:"mode"`
	BrandId        string   `json:"brand_id,optional"`
	ProductId      string   `json:"product_id,optional"`
	ProductLabel   string   `json:"product_label,optional"`
	Pains          []string `json:"pains"`
	Tags           []string `json:"tags"`
	Periphery      []string `json:"periphery"`
	ScanTerms      []string `json:"scan_terms"`
	PlacementNote  string   `json:"placement_note,optional"`
	ResponseStance string   `json:"response_stance,optional"`
	ThemeKey       string   `json:"theme_key,optional"`
	ThemeLabel     string   `json:"theme_label,optional"`
	ProductContext string   `json:"product_context,optional"`
	TargetCount    int      `json:"target_count,optional"`
}

type ScoutBriefReq struct {
	Intent    string `json:"intent"`
	BrandId   string `json:"brand_id,optional"`
	ProductId string `json:"product_id,optional"`
	Purpose   string `json:"purpose,optional"`
	Deep      bool   `json:"deep,optional"`
}

type ScoutCrawlerSessionReq struct {
	Token string `json:"token"`
}

type ScoutDraftPathReq struct {
	Id        string `path:"id"`
	PersonaId string `json:"persona_id,optional"`
}

type ScoutHomeworkListData struct {
	List []ScoutHomeworkPublic `json:"list"`
}

type ScoutHomeworkPublic struct {
	ThemeKey   string           `json:"theme_key"`
	ThemeLabel string           `json:"theme_label"`
	Purpose    string           `json:"purpose"`
	Brief      ScoutBriefPublic `json:"brief"`
	CreatedAt  int64            `json:"created_at"`
}

type ScoutHomeworkSaveReq struct {
	ThemeKey   string           `json:"theme_key"`
	ThemeLabel string           `json:"theme_label"`
	Purpose    string           `json:"purpose,optional"`
	Brief      ScoutBriefPublic `json:"brief"`
}

type ScoutPostIdPath struct {
	Id string `path:"id"`
}

type ScoutPostListData struct {
	List []ScoutPostPublic `json:"list"`
}

type ScoutPostListReq struct {
	BrandId string `form:"brand_id,optional"`
}

type ScoutPostPublic struct {
	Id                  string `json:"id"`
	RunId               string `json:"run_id,optional"`
	BrandId             string `json:"brand_id,optional"`
	Author              string `json:"author"`
	Text                string `json:"text"`
	SearchTag           string `json:"search_tag"`
	Opportunity         string `json:"opportunity"`
	OutreachStatus      string `json:"outreach_status"`
	DraftText           string `json:"draft_text,optional"`
	Score               int    `json:"score"`
	MatchedProductId    string `json:"matched_product_id,optional"`
	MatchedProductLabel string `json:"matched_product_label,optional"`
	MatchReason         string `json:"match_reason,optional"`
	ScoutMode           string `json:"scout_mode,optional"`
	IntentSnippet       string `json:"intent_snippet,optional"`
	ThemeKey            string `json:"theme_key,optional"`
	ThemeLabel          string `json:"theme_label,optional"`
	ScanPath            string `json:"scan_path,optional"`
	Classification      string `json:"classification,optional"`
	Permalink           string `json:"permalink,optional"`
	PostedAt            int64  `json:"posted_at,optional"`
	CreatedAt           int64  `json:"created_at"`
}

type ScoutRunListData struct {
	List       []ScoutRunPublic `json:"list"`
	Pagination Pagination       `json:"pagination"`
}

type ScoutRunListReq struct {
	Page     int    `form:"page,optional"`
	PageSize int    `form:"pageSize,optional"`
	BrandId  string `form:"brand_id,optional"`
	Mode     string `form:"mode,optional"`
}

type ScoutRunPostsData struct {
	Run        ScoutRunPublic    `json:"run"`
	List       []ScoutPostPublic `json:"list"`
	Pagination Pagination        `json:"pagination"`
}

type ScoutRunPostsReq struct {
	RunId    string `path:"runId"`
	Page     int    `form:"page,optional"`
	PageSize int    `form:"pageSize,optional"`
}

type ScoutRunPublic struct {
	Id               string   `json:"id"`
	JobId            string   `json:"job_id"`
	ThemeKey         string   `json:"theme_key"`
	ThemeLabel       string   `json:"theme_label"`
	Intent           string   `json:"intent"`
	Mode             string   `json:"mode"`
	BrandId          string   `json:"brand_id,optional"`
	TargetCount      int      `json:"target_count"`
	Status           string   `json:"status"`
	SearchedCount    int      `json:"searched_count"`
	DuplicateCount   int      `json:"duplicate_count"`
	IrrelevantCount  int      `json:"irrelevant_count"`
	EligibleCount    int      `json:"eligible_count"`
	PendingCount     int      `json:"pending_count"`
	ShortfallCount   int      `json:"shortfall_count"`
	ShortfallReasons []string `json:"shortfall_reasons"`
	CreatedAt        int64    `json:"created_at"`
	StartedAt        int64    `json:"started_at,optional"`
	CompletedAt      int64    `json:"completed_at,optional"`
	Error            string   `json:"error,optional"`
}

type ScoutScanJobData struct {
	Job JobPublic      `json:"job"`
	Run ScoutRunPublic `json:"run"`
}

type ScoutScanReq struct {
	Brief ScoutBriefPublic `json:"brief"`
}

type ScoutSendPathReq struct {
	Id        string `path:"id"`
	Text      string `json:"text,optional"`
	AccountId string `json:"account_id,optional"`
}

type ScoutThemePath struct {
	ThemeKey string `path:"themeKey"`
}

type SearchData struct {
	List    []SearchHit `json:"list"`
	KeyMode string      `json:"key_mode"`
}

type SearchHit struct {
	Title   string `json:"title"`
	Url     string `json:"url"`
	Snippet string `json:"snippet"`
}

type SearchReq struct {
	Query string `json:"query"`
	Limit int    `json:"limit,optional"`
}

type ServiceCasePublic struct {
	Title   string `json:"title"`
	Summary string `json:"summary,optional"`
	Link    string `json:"link,optional"`
}

type ServiceItem struct {
	Name     string  `json:"name"`
	PriceMin float64 `json:"price_min,optional"`
	PriceMax float64 `json:"price_max,optional"`
	Currency string  `json:"currency,optional"`
}

type ServiceProfilePublic struct {
	Exists       bool                `json:"exists"`
	Services     []ServiceItem       `json:"services"`
	Cases        []ServiceCasePublic `json:"cases"`
	Forbidden    []string            `json:"forbidden"`
	Faq          []FaqItem           `json:"faq"`
	ServiceAreas []string            `json:"service_areas"`
	RemoteOk     bool                `json:"remote_ok"`
	Availability string              `json:"availability,optional"`
	ToneNote     string              `json:"tone_note,optional"`
	UpdatedAt    int64               `json:"updated_at,optional"`
}

type SetContactFollowUpReq struct {
	Id            string `path:"id"`
	NeedsFollowUp bool   `json:"needs_follow_up"`
	Days          int    `json:"days,optional"`
}

type SetPrimaryProductReq struct {
	Id        string `path:"id"`
	ProductId string `json:"product_id"`
	Reason    string `json:"reason"`
}

type SnoozeFollowUpReq struct {
	Id   string `path:"id"`
	Days int    `json:"days"`
}

type SourceConversionStat struct {
	Source             string `json:"source"` // radar | scout | manual_import
	Won                int    `json:"won"`
	InsufficientSample bool   `json:"insufficient_sample"`
}

type StageCount struct {
	Stage string `json:"stage"`
	Count int    `json:"count"`
}

type StyleDimensionPublic struct {
	Summary  string   `json:"summary"`
	Evidence []string `json:"evidence,optional"`
}

type StyleQuizData struct {
	Tone       string   `json:"tone"`
	Rhythm     string   `json:"rhythm"`
	Hooks      string   `json:"hooks"`
	Avoid      string   `json:"avoid"`
	Summary    string   `json:"summary"`
	Tags       []string `json:"tags"`
	SignupHint string   `json:"signup_hint"`
}

type StyleQuizReq struct {
	Samples string `json:"samples"`
}

type SubmitDraftReviewReq struct {
	RefType     string `json:"ref_type"`
	RefId       string `json:"ref_id"`
	WorkspaceId string `json:"workspace_id,optional"`
}

type SuggestWatchTermsReq struct {
	Limit     int    `json:"limit,optional"`
	BrandId   string `json:"brand_id,optional"`
	ProductId string `json:"product_id,optional"`
}

type SweepListData struct {
	List       []RadarSweepPublic `json:"list"`
	Pagination Pagination         `json:"pagination"`
}

type SwitchWorkspaceReq struct {
	Id string `path:"id"`
}

type TermConversionStat struct {
	Term               string  `json:"term"`
	Accepted           int     `json:"accepted"`
	Replied            int     `json:"replied"`
	Won                int     `json:"won"`
	ConversionRate     float64 `json:"conversion_rate,optional"`
	InsufficientSample bool    `json:"insufficient_sample"`
}

type ThreadsAccountIdPath struct {
	Id string `path:"id"`
}

type ThreadsAccountListData struct {
	List []ThreadsAccountPublic `json:"list"`
}

type ThreadsAccountPublic struct {
	Id                 string `json:"id"`
	Username           string `json:"username"`
	DisplayName        string `json:"display_name"`
	Connection         string `json:"connection"` // connected|error|disconnected
	IsUsable           bool   `json:"is_usable"`
	AvatarColor        string `json:"avatar_color,optional"`
	AvatarUrl          string `json:"avatar_url,optional"`
	ErrorMessage       string `json:"error_message,optional"`
	SessionExpiresAt   int64  `json:"session_expires_at,optional"`
	SessionRefreshedAt int64  `json:"session_refreshed_at,optional"`
}

type ThreadsOAuthCallbackData struct {
	Ok          bool   `json:"ok"`
	Message     string `json:"message,optional"`
	RedirectUrl string `json:"redirect_url,optional"`
}

type ThreadsOAuthCallbackReq struct {
	Code             string `form:"code,optional"`
	State            string `form:"state,optional"`
	Error            string `form:"error,optional"`
	ErrorReason      string `form:"error_reason,optional"`
	ErrorDescription string `form:"error_description,optional"`
}

type ThreadsOAuthStartData struct {
	AuthorizeUrl string `json:"authorize_url"`
	State        string `json:"state"`
}

type ThreadsSettingsData struct {
	Provider      string `json:"provider"` // fake | meta
	Configured    bool   `json:"configured"`
	OauthReady    bool   `json:"oauth_ready"`
	ConnectPath   string `json:"connect_path"` // 前端連帳入口
	CallbackUrl   string `json:"callback_url"`
	PublicWebBase string `json:"public_web_base"`
	AppIdMasked   string `json:"app_id_masked,optional"`
	Hint          string `json:"hint"`
}

type TokenPair struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
}

type TrendListData struct {
	List []TrendPublic `json:"list"`
}

type TrendPublic struct {
	Id          string   `json:"id"`
	Kind        string   `json:"kind"`
	Label       string   `json:"label"`
	Summary     string   `json:"summary"`
	Heat        int      `json:"heat"`
	Keywords    []string `json:"keywords"`
	Samples     []string `json:"samples"`
	SourceLabel string   `json:"source_label"`
	ObservedAt  int64    `json:"observed_at"`
}

type TriggerSweepData struct {
	JobId   string `json:"job_id"`
	SweepId string `json:"sweep_id,optional"`
}

type UnmergeContactReq struct {
	Id              string `path:"id"`
	MergedContactId string `json:"merged_contact_id"`
}

type UnreadCountData struct {
	Count int64 `json:"count"`
}

type UpdateContactStageReq struct {
	Id    string `path:"id"`
	Stage string `json:"stage"`
	Note  string `json:"note,optional"`
}

type UpdateConversionReq struct {
	Id       string  `path:"id"`
	Amount   float64 `json:"amount,optional"`
	Note     string  `json:"note,optional"`
	Currency string  `json:"currency,optional"`
}

type UpdateCrmConversionReq struct {
	Id       string  `path:"id"`
	Amount   float64 `json:"amount,optional"`
	Currency string  `json:"currency,optional"`
	Note     string  `json:"note,optional"`
}

type UpdateDemandMapReq struct {
	ProductId          string            `path:"productId"`
	ExpectedMapVersion int64             `json:"expected_map_version"`
	PainPhrases        []DemandMapPhrase `json:"pain_phrases,optional"`
	ScenarioPhrases    []DemandMapPhrase `json:"scenario_phrases,optional"`
	DesiredOutcomes    []DemandMapPhrase `json:"desired_outcomes,optional"`
	SolutionSignals    []DemandMapPhrase `json:"solution_signals,optional"`
	ExclusionSignals   []DemandMapPhrase `json:"exclusion_signals,optional"`
	CustomPhrases      []DemandMapPhrase `json:"custom_phrases,optional"`
}

type UpdateWatchReq struct {
	Id           string   `path:"id"`
	Terms        []string `json:"terms,optional"`
	ExcludeTerms []string `json:"exclude_terms,optional"`
	Regions      []string `json:"regions,optional"`
}

type UpdateWorkspaceReq struct {
	Id             string `path:"id"`
	Name           string `json:"name,optional"`
	ReviewRequired *bool  `json:"review_required,optional"`
}

type UpsertServiceProfileReq struct {
	Services     []ServiceItem       `json:"services"`
	Cases        []ServiceCasePublic `json:"cases,optional"`
	Forbidden    []string            `json:"forbidden,optional"`
	Faq          []FaqItem           `json:"faq,optional"`
	ServiceAreas []string            `json:"service_areas,optional"`
	RemoteOk     bool                `json:"remote_ok,optional"`
	Availability string              `json:"availability,optional"`
	ToneNote     string              `json:"tone_note,optional"`
}

type UsageByokBlock struct {
	CallCount int                        `json:"call_count"`
	ByMeter   map[string]UsageMeterCount `json:"by_meter,optional"`
}

type UsageEventPublic struct {
	Id        string `json:"id"`
	Uid       int64  `json:"uid"`
	Meter     string `json:"meter"`
	Credits   int    `json:"credits"`
	KeyMode   string `json:"key_mode"`
	Label     string `json:"label"`
	Source    string `json:"source"`
	CreatedAt int64  `json:"created_at"`
}

type UsageEventsData struct {
	List []UsageEventPublic `json:"list"`
}

type UsageEventsReq struct {
	MonthKey string `form:"month_key,optional"`
	KeyMode  string `form:"key_mode,optional"` // platform|byok|all
	Limit    int    `form:"limit,optional"`
}

type UsageMeterCount struct {
	Count   int `json:"count"`
	Credits int `json:"credits"`
}

type UsagePlatformBlock struct {
	CreditsUsed      int                        `json:"credits_used"`
	CreditsRemaining int                        `json:"credits_remaining"`
	CreditsTotal     int                        `json:"credits_total"`
	CallCount        int                        `json:"call_count"`
	ByMeter          map[string]UsageMeterCount `json:"by_meter,optional"`
}

type UsagePrefsData struct {
	PlanId    string `json:"plan_id"`
	Unlimited bool   `json:"unlimited"`
}

type UsagePrefsReq struct {
	Uid string `form:"uid,optional"`
}

type UsagePurchasePublic struct {
	Id        string `json:"id"`
	PlanId    string `json:"plan_id"`
	MockRef   string `json:"mock_ref,optional"`
	CreatedAt int64  `json:"created_at"`
}

type UsagePurchaseReq struct {
	PlanId  string `json:"plan_id"`
	MockRef string `json:"mock_ref,optional"`
}

type UsagePurchasesData struct {
	List []UsagePurchasePublic `json:"list"`
}

type UsageSetPrefsReq struct {
	Uid       string `json:"uid"`
	PlanId    string `json:"plan_id,optional"`
	Unlimited *bool  `json:"unlimited,optional"`
}

type UsageSummaryData struct {
	MonthKey         string             `json:"month_key"`
	Uid              int64              `json:"uid"`
	PlanId           string             `json:"plan_id"`
	Unlimited        bool               `json:"unlimited"`
	Platform         UsagePlatformBlock `json:"platform"`
	Byok             UsageByokBlock     `json:"byok"`
	TotalCredits     int                `json:"total_credits"`
	RemainingCredits int                `json:"remaining_credits"`
}

type UsageSummaryReq struct {
	MonthKey string `form:"month_key,optional"`
}

type UsageTenantAnalyticsBucket struct {
	Key              string `json:"key"`
	Label            string `json:"label"`
	PurchasedCredits int    `json:"purchased_credits"`
	ConsumedCredits  int    `json:"consumed_credits"`
	AiCalls          int    `json:"ai_calls"`
	SearchCalls      int    `json:"search_calls"`
	ByokCallCount    int    `json:"byok_call_count"`
}

type UsageTenantAnalyticsData struct {
	Granularity      string                       `json:"granularity"`
	From             string                       `json:"from"`
	To               string                       `json:"to"`
	RangeLabel       string                       `json:"range_label"`
	PurchasedCredits int                          `json:"purchased_credits"`
	ConsumedCredits  int                          `json:"consumed_credits"`
	RemainingCredits int                          `json:"remaining_credits"`
	Pct              int                          `json:"pct"`
	AiCalls          int                          `json:"ai_calls"`
	SearchCalls      int                          `json:"search_calls"`
	ByMeter          map[string]UsageMeterCount   `json:"by_meter"`
	Byok             UsageByokBlock               `json:"byok"`
	Series           []UsageTenantAnalyticsBucket `json:"series"`
	Members          []UsageTenantAnalyticsMember `json:"members"`
}

type UsageTenantAnalyticsMember struct {
	Uid              int64  `json:"uid"`
	Email            string `json:"email"`
	DisplayName      string `json:"display_name"`
	Unlimited        bool   `json:"unlimited"`
	PlanId           string `json:"plan_id"`
	PurchasedCredits int    `json:"purchased_credits"`
	TotalCredits     int    `json:"total_credits"`
	AiCalls          int    `json:"ai_calls"`
	SearchCalls      int    `json:"search_calls"`
	ByokCallCount    int    `json:"byok_call_count"`
	RemainingCredits int    `json:"remaining_credits"`
	Pct              int    `json:"pct"`
}

type UsageTenantAnalyticsReq struct {
	Granularity string `form:"granularity"` // day|month|year
	From        string `form:"from"`        // inclusive YYYY-MM-DD UTC
	To          string `form:"to"`          // inclusive YYYY-MM-DD UTC
}

type UsageTenantRow struct {
	Uid                 int64  `json:"uid"`
	PlanId              string `json:"plan_id"`
	Unlimited           bool   `json:"unlimited"`
	PlatformCreditsUsed int    `json:"platform_credits_used"`
	ByokCallCount       int    `json:"byok_call_count"`
}

type UsageTenantSummaryData struct {
	MonthKey            string           `json:"month_key"`
	PlatformCreditsUsed int              `json:"platform_credits_used"`
	ByokCallCount       int              `json:"byok_call_count"`
	Members             []UsageTenantRow `json:"members"`
}

type UsageTenantSummaryReq struct {
	MonthKey string `form:"month_key,optional"`
}

type UtmLinkListData struct {
	List []UtmLinkPublic `json:"list"`
}

type UtmLinkPublic struct {
	Id             string `json:"id"`
	Code           string `json:"code"`
	TrackPath      string `json:"track_path"`
	TrackUrl       string `json:"track_url"`
	DestinationUrl string `json:"destination_url"`
	OutcomeId      string `json:"outcome_id,optional"`
	Label          string `json:"label,optional"`
	Clicks         int    `json:"clicks"`
	CreatedAt      int64  `json:"created_at"`
}

type UtmRedirectReq struct {
	Code string `path:"code"`
}

type VariantConversionStat struct {
	Variant            string  `json:"variant"`
	Used               int     `json:"used"`
	Replied            int     `json:"replied"`
	Won                int     `json:"won"`
	SuccessRate        float64 `json:"success_rate,optional"`
	InsufficientSample bool    `json:"insufficient_sample"`
}

type ViralAnalysisPublic struct {
	Hooks     string `json:"hooks"`
	Structure string `json:"structure"`
	Emotion   string `json:"emotion"`
	Summary   string `json:"summary"`
	Cta       string `json:"cta,optional"`
	Copyable  string `json:"copyable,optional"`
	Risks     string `json:"risks,optional"`
}

type WatchIdReq struct {
	Id string `path:"id"`
}

type WatchListData struct {
	List          []RadarWatchPublic `json:"list"`
	Pagination    Pagination         `json:"pagination"`
	ActiveCount   int                `json:"active_count"`
	MaxActive     int                `json:"max_active"`
	ProfileExists bool               `json:"profile_exists"`
}

type WatchSuggestData struct {
	List []WatchTermSuggestion `json:"list"`
}

type WatchTermSuggestion struct {
	Term      string `json:"term"`
	Reason    string `json:"reason"`
	Usage     string `json:"usage"` // include | exclude
	BasisKind string `json:"basis_kind,optional"`
	BasisText string `json:"basis_text,optional"`
}

type WeeklyCheckupPublic struct {
	Id        string                 `json:"id"`
	WeekKey   string                 `json:"week_key"`
	Status    string                 `json:"status"`
	Summary   string                 `json:"summary"`
	Findings  []CheckupFindingPublic `json:"findings"`
	Actions   []CheckupActionPublic  `json:"actions"`
	Error     string                 `json:"error,optional"`
	CreatedAt int64                  `json:"created_at"`
	UpdatedAt int64                  `json:"updated_at"`
}

type WorkspaceBrandingReq struct {
	Id            string `path:"id"`
	FooterText    string `json:"footer_text,optional"`
	HidePoweredBy bool   `json:"hide_powered_by,optional"`
	BrandName     string `json:"brand_name,optional"`
}

type WorkspaceIdReq struct {
	Id string `path:"id"`
}

type WorkspaceListData struct {
	List               []WorkspacePublic `json:"list"`
	CurrentWorkspaceId string            `json:"current_workspace_id"`
}

type WorkspaceMemberListData struct {
	List []WorkspaceMemberPublic `json:"list"`
}

type WorkspaceMemberPublic struct {
	Uid         int64  `json:"uid"`
	Email       string `json:"email"`
	DisplayName string `json:"display_name"`
	Role        string `json:"role"`
	JoinedAt    int64  `json:"joined_at"`
}

type WorkspacePublic struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	ReviewRequired bool   `json:"review_required"`
	IsDefault      bool   `json:"is_default"`
	Archived       bool   `json:"archived"`
	FooterText     string `json:"footer_text,optional"`
	HidePoweredBy  bool   `json:"hide_powered_by,optional"`
	BrandName      string `json:"brand_name,optional"`
	CreatedAt      int64  `json:"created_at"`
	UpdatedAt      int64  `json:"updated_at"`
}
