response

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSettingsResponse

type AccountSettingsResponse struct {
	Protected                                       bool             `json:"protected,omitempty"`
	ScreenName                                      string           `json:"screen_name,omitempty"`
	AlwaysUseHTTPS                                  bool             `json:"always_use_https,omitempty"`
	UseCookiePersonalization                        bool             `json:"use_cookie_personalization,omitempty"`
	SleepTime                                       SleepTime        `json:"sleep_time,omitempty"`
	GeoEnabled                                      bool             `json:"geo_enabled,omitempty"`
	Language                                        string           `json:"language,omitempty"`
	DiscoverableByEmail                             bool             `json:"discoverable_by_email,omitempty"`
	DiscoverableByMobilePhone                       bool             `json:"discoverable_by_mobile_phone,omitempty"`
	DisplaySensitiveMedia                           bool             `json:"display_sensitive_media,omitempty"`
	PersonalizedTrends                              bool             `json:"personalized_trends,omitempty"`
	AllowMediaTagging                               string           `json:"allow_media_tagging,omitempty"`
	AllowContributorRequest                         string           `json:"allow_contributor_request,omitempty"`
	AllowAdsPersonalization                         bool             `json:"allow_ads_personalization,omitempty"`
	AllowLoggedOutDevicePersonalization             bool             `json:"allow_logged_out_device_personalization,omitempty"`
	AllowLocationHistoryPersonalization             bool             `json:"allow_location_history_personalization,omitempty"`
	AllowSharingDataForThirdPartyPersonalization    bool             `json:"allow_sharing_data_for_third_party_personalization,omitempty"`
	AllowDmsFrom                                    string           `json:"allow_dms_from,omitempty"`
	AlwaysAllowDmsFromSubscribers                   any              `json:"always_allow_dms_from_subscribers,omitempty"`
	AllowDmGroupsFrom                               string           `json:"allow_dm_groups_from,omitempty"`
	TranslatorType                                  string           `json:"translator_type,omitempty"`
	CountryCode                                     string           `json:"country_code,omitempty"`
	NSFWUser                                        bool             `json:"nsfw_user,omitempty"`
	NSFWAdmin                                       bool             `json:"nsfw_admin,omitempty"`
	RankedTimelineSetting                           any              `json:"ranked_timeline_setting,omitempty"`
	RankedTimelineEligible                          any              `json:"ranked_timeline_eligible,omitempty"`
	AddressBookLiveSyncEnabled                      bool             `json:"address_book_live_sync_enabled,omitempty"`
	UniversalQualityFilteringEnabled                string           `json:"universal_quality_filtering_enabled,omitempty"`
	DMReceiptSetting                                string           `json:"dm_receipt_setting,omitempty"`
	AltTextComposeEnabled                           any              `json:"alt_text_compose_enabled,omitempty"`
	MentionFilter                                   string           `json:"mention_filter,omitempty"`
	AllowAuthenticatedPeriscopeRequests             bool             `json:"allow_authenticated_periscope_requests,omitempty"`
	ProtectPasswordReset                            bool             `json:"protect_password_reset,omitempty"`
	RequirePasswordLogin                            bool             `json:"require_password_login,omitempty"`
	RequiresLoginVerification                       bool             `json:"requires_login_verification,omitempty"`
	ExtSharingAudiospacesListeningDataWithFollowers bool             `json:"ext_sharing_audiospaces_listening_data_with_followers,omitempty"`
	Ext                                             Ext              `json:"ext,omitempty"`
	DmQualityFilter                                 string           `json:"dm_quality_filter,omitempty"`
	AutoplayDisabled                                bool             `json:"autoplay_disabled,omitempty"`
	SettingsMetadata                                SettingsMetadata `json:"settings_metadata,omitempty"`
}

type ConversationDMResponse

type ConversationDMResponse struct {
	ConversationTimeline XInboxData `json:"conversation_timeline"`
}

type DMMessageDeleteMutationResponse

type DMMessageDeleteMutationResponse struct {
	Data struct {
		DmMessageHideDelete string `json:"dm_message_hide_delete,omitempty"`
	} `json:"data,omitempty"`
}

type Ext

type Ext struct {
	SsoConnections SsoConnections `json:"ssoConnections,omitempty"`
}

type FinalizedUploadMediaResponse

type FinalizedUploadMediaResponse struct {
	MediaID          int64          `json:"media_id,omitempty"`
	MediaIDString    string         `json:"media_id_string,omitempty"`
	MediaKey         string         `json:"media_key,omitempty"`
	Size             int            `json:"size,omitempty"`
	ExpiresAfterSecs int            `json:"expires_after_secs,omitempty"`
	Image            Image          `json:"image,omitempty"`
	Video            Video          `json:"video,omitempty"`
	ProcessingInfo   ProcessingInfo `json:"processing_info,omitempty"`
}

type GetDMPermissionsResponse

type GetDMPermissionsResponse struct {
	Permissions Permissions           `json:"permissions,omitempty"`
	Users       map[string]types.User `json:"users,omitempty"`
}

type GetDMUserUpdatesResponse

type GetDMUserUpdatesResponse struct {
	InboxInitialState XInboxData `json:"inbox_initial_state,omitempty"`
	UserEvents        XInboxData `json:"user_events,omitempty"`
}

type Image

type Image struct {
	ImageType string `json:"image_type,omitempty"`
	W         int    `json:"w,omitempty"`
	H         int    `json:"h,omitempty"`
}

type InboxInitialState

type InboxInitialState struct {
	LastSeenEventID          string                             `json:"last_seen_event_id,omitempty"`
	TrustedLastSeenEventID   string                             `json:"trusted_last_seen_event_id,omitempty"`
	UntrustedLastSeenEventID string                             `json:"untrusted_last_seen_event_id,omitempty"`
	Cursor                   string                             `json:"cursor,omitempty"`
	InboxTimelines           InboxTimelines                     `json:"inbox_timelines,omitempty"`
	Entries                  []map[event.XEventType]interface{} `json:"entries,omitempty"`
	Users                    map[string]types.User              `json:"users,omitempty"`
	Conversations            map[string]types.Conversation      `json:"conversations,omitempty"`
	KeyRegistryState         KeyRegistryState                   `json:"key_registry_state,omitempty"`
}

type InboxInitialStateResponse

type InboxInitialStateResponse struct {
	InboxInitialState XInboxData `json:"inbox_initial_state,omitempty"`
}

type InboxTimelineResponse

type InboxTimelineResponse struct {
	InboxTimeline XInboxData `json:"inbox_timeline"`
}

type InboxTimelines

type InboxTimelines struct {
	Trusted   Trusted   `json:"trusted,omitempty"`
	Untrusted Untrusted `json:"untrusted,omitempty"`
}

type InitUploadMediaResponse

type InitUploadMediaResponse struct {
	MediaID          int64  `json:"media_id,omitempty"`
	MediaIDString    string `json:"media_id_string,omitempty"`
	ExpiresAfterSecs int    `json:"expires_after_secs,omitempty"`
	MediaKey         string `json:"media_key,omitempty"`
}

type KeyRegistryState

type KeyRegistryState struct {
	Status types.PaginationStatus `json:"status,omitempty"`
}

type Ok

type Ok struct {
	SSOIDHash   string `json:"ssoIdHash,omitempty"`
	SSOProvider string `json:"ssoProvider,omitempty"`
}

type PermissionDetails

type PermissionDetails struct {
	CanDM     bool `json:"can_dm,omitempty"`
	ErrorCode int  `json:"error_code,omitempty"`
}

type Permissions

type Permissions struct {
	IDKeys map[string]PermissionDetails `json:"id_keys,omitempty"`
}

func (Permissions) GetPermissionsForUser

func (perms Permissions) GetPermissionsForUser(userID string) *PermissionDetails

type PinConversationResponse

type PinConversationResponse struct {
	Data struct {
		AddDmConversationLabelV3 struct {
			Typename  string `json:"__typename,omitempty"`
			LabelType string `json:"label_type,omitempty"`
			Timestamp int64  `json:"timestamp,omitempty"`
		} `json:"add_dm_conversation_label_v3,omitempty"`
	}
}

type PrettifiedMessage

type PrettifiedMessage struct {
	EventID        string
	ConversationID string
	MessageID      string
	Recipient      types.User
	Sender         types.User
	SentAt         time.Time
	AffectsSort    bool
	Text           string
	Attachment     *types.Attachment
	Entities       types.Entities
	Reactions      []types.MessageReaction
}

type ProcessingInfo

type ProcessingInfo struct {
	State           ProcessingState `json:"state,omitempty"`
	CheckAfterSecs  int             `json:"check_after_secs,omitempty"`
	ProgressPercent int             `json:"progress_percent,omitempty"`
}

type ProcessingState

type ProcessingState string
const (
	PROCESSING_STATE_PENDING     ProcessingState = "pending"
	PROCESSING_STATE_IN_PROGRESS ProcessingState = "in_progress"
	PROCESSING_STATE_SUCCEEDED   ProcessingState = "succeeded"
)

type R

type R struct {
	Ok []Ok `json:"ok,omitempty"`
}

type ReactionResponse

type ReactionResponse struct {
	Data struct {
		DeleteDmReaction struct {
			Typename string `json:"__typename,omitempty"`
		} `json:"delete_dm_reaction,omitempty"`
		CreateDmReaction struct {
			Typename string `json:"__typename,omitempty"`
		} `json:"create_dm_reaction,omitempty"`
	} `json:"data,omitempty"`
}

type SearchResponse

type SearchResponse struct {
	NumResults      int          `json:"num_results,omitempty"`
	Users           []types.User `json:"users,omitempty"`
	Topics          []any        `json:"topics,omitempty"`
	Events          []any        `json:"events,omitempty"`
	Lists           []any        `json:"lists,omitempty"`
	OrderedSections []any        `json:"ordered_sections,omitempty"`
	Oneclick        []any        `json:"oneclick,omitempty"`
	Hashtags        []any        `json:"hashtags,omitempty"`
	CompletedIn     float32      `json:"completed_in,omitempty"`
	Query           string       `json:"query,omitempty"`
}

type SettingsMetadata

type SettingsMetadata struct {
	IsEU string `json:"is_eu,omitempty"`
}

type SleepTime

type SleepTime struct {
	Enabled   bool `json:"enabled,omitempty"`
	EndTime   any  `json:"end_time,omitempty"`
	StartTime any  `json:"start_time,omitempty"`
}

type SsoConnections

type SsoConnections struct {
	R   R   `json:"r,omitempty"`
	TTL int `json:"ttl,omitempty"`
}

type Trusted

type Trusted struct {
	Status     types.PaginationStatus `json:"status,omitempty"`
	MinEntryID string                 `json:"min_entry_id,omitempty"`
}

type UnpinConversationResponse

type UnpinConversationResponse struct {
	Data struct {
		DmConversationLabelDelete string `json:"dm_conversation_label_delete,omitempty"`
	} `json:"data,omitempty"`
}

type Untrusted

type Untrusted struct {
	Status types.PaginationStatus `json:"status,omitempty"`
}

type UserEvents

type UserEvents struct {
	MinEntryID               string                             `json:"min_entry_id,omitempty"`
	MaxEntryID               string                             `json:"max_entry_id,omitempty"`
	Cursor                   string                             `json:"cursor,omitempty"`
	LastSeenEventID          string                             `json:"last_seen_event_id,omitempty"`
	TrustedLastSeenEventID   string                             `json:"trusted_last_seen_event_id,omitempty"`
	UntrustedLastSeenEventID string                             `json:"untrusted_last_seen_event_id,omitempty"`
	Entries                  []map[event.XEventType]interface{} `json:"entries,omitempty"`
	Users                    map[string]types.User              `json:"users,omitempty"`
	Conversations            map[string]types.Conversation      `json:"conversations,omitempty"`
}

type Video

type Video struct {
	VideoType string `json:"video_type,omitempty"`
}

type XInboxConversationFeedData

type XInboxConversationFeedData struct {
	Conversation types.Conversation
	Participants []types.User
	// sorted by timestamp, first index is the most recent message
	Messages []types.Message
}

type XInboxData

type XInboxData struct {
	Status                   types.PaginationStatus             `json:"status,omitempty"`
	MinEntryID               string                             `json:"min_entry_id,omitempty"`
	MaxEntryID               string                             `json:"max_entry_id,omitempty"`
	LastSeenEventID          string                             `json:"last_seen_event_id,omitempty"`
	TrustedLastSeenEventID   string                             `json:"trusted_last_seen_event_id,omitempty"`
	UntrustedLastSeenEventID string                             `json:"untrusted_last_seen_event_id,omitempty"`
	Cursor                   string                             `json:"cursor,omitempty"`
	InboxTimelines           InboxTimelines                     `json:"inbox_timelines,omitempty"`
	Entries                  []map[event.XEventType]interface{} `json:"entries,omitempty"`
	Users                    map[string]types.User              `json:"users,omitempty"`
	Conversations            map[string]types.Conversation      `json:"conversations,omitempty"`
	KeyRegistryState         KeyRegistryState                   `json:"key_registry_state,omitempty"`
}

func (*XInboxData) GetConversationByID

func (data *XInboxData) GetConversationByID(conversationID string) types.Conversation

func (*XInboxData) GetMessageEntriesByConversationID

func (data *XInboxData) GetMessageEntriesByConversationID(conversationID string, sortByTimestamp bool) ([]types.Message, error)

func (*XInboxData) GetParticipantUsers

func (data *XInboxData) GetParticipantUsers(participants []types.Participant) []types.User

func (*XInboxData) GetUserByID

func (data *XInboxData) GetUserByID(userID string) types.User

func (*XInboxData) Prettify

func (data *XInboxData) Prettify() ([]XInboxConversationFeedData, error)

func (*XInboxData) PrettifyMessages

func (data *XInboxData) PrettifyMessages(conversationID string) ([]PrettifiedMessage, error)

func (*XInboxData) ToEventEntries

func (data *XInboxData) ToEventEntries() ([]interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL