// 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 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 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"`
	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 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"`
}

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 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"`
	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"`
}

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

type Empty struct {
}

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 GenerateImageData struct {
	Id     string `json:"id"`
	Url    string `json:"url"`
	Prompt string `json:"prompt"`
}

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

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

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 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 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
	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 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 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 ListParentCandidatesReq struct {
	ExcludeSubtreeRootUid int64 `form:"exclude_subtree_root_uid,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"`
	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 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"`
}

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 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 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 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"`
}

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"`
}

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 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 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"`
	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 ProductIdPath struct {
	Id string `path:"id"`
}

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

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

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"`
	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"`
	PlacementUrl   string   `json:"placement_url,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 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"`
}

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"`
	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"`
	CreatedAt           int64  `json:"created_at"`
}

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

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 StyleDimensionPublic struct {
	Summary  string   `json:"summary"`
	Evidence []string `json:"evidence,optional"`
}

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 UnreadCountData struct {
	Count int64 `json:"count"`
}

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 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 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"`
}
