clubhouse

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 8 Imported by: 0

README

👋 clubhouse-go

A Go client for Clubhouse’s (the audio chat app) internal API.

Installation

go get github.com/ifvictr/clubhouse-go

License

MIT License

Documentation

Index

Constants

View Source
const (
	// BaseURL is the Clubhouse API's base endpoint.
	BaseURL = "https://www.clubhouseapi.com/api/"

	AppBuild   = 297
	AppVersion = "0.1.27"
	IOSVersion = "14.4.2"
)

Variables

This section is empty.

Functions

func Int

func Int(v int) *int

Int returns a pointer to the given int value.

func String

func String(v string) *string

String returns a pointer to the given string value.

Types

type APIError added in v0.3.0

type APIError struct {
	Response
	Detail       *string `json:"detail"`
	ErrorMessage *string `json:"error_message"`
}

func (APIError) Empty added in v0.3.0

func (e APIError) Empty() bool

func (APIError) Error added in v0.3.0

func (e APIError) Error() string

type AddEmailParams added in v0.3.0

type AddEmailParams struct {
	Email string `json:"email"`
}

type AddEmailResponse added in v0.3.0

type AddEmailResponse struct {
	Response
}

type AttributionSource

type AttributionSource string
const (
	AttributionSourceActivity AttributionSource = "activity"
	AttributionSourceFeed     AttributionSource = "feed"
)

type BaseClub

type BaseClub struct {
	ClubID      int     `json:"club_id"`
	Description *string `json:"description"`
	Name        string  `json:"name"`
	PhotoURL    *string `json:"photo_url"`
}

type BaseUserProfile

type BaseUserProfile struct {
	Name     *string `json:"name"`
	PhotoURL *string `json:"photo_url"`
	UserID   int     `json:"user_id"`
	Username *string `json:"username"`
}

type BlockFromChannelParams

type BlockFromChannelParams struct {
	Channel string `json:"channel"`
	UserID  int    `json:"user_id"`
}

type BlockFromChannelResponse

type BlockFromChannelResponse struct {
	Response
}

type BlockParams added in v0.3.0

type BlockParams struct {
	UserID   int    `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type BlockResponse added in v0.3.0

type BlockResponse struct {
	Response
}

type CallPhoneNumberAuthParams

type CallPhoneNumberAuthParams struct {
	PhoneNumber string `json:"phone_number"`
}

type CallPhoneNumberAuthResponse

type CallPhoneNumberAuthResponse struct {
	Response
	ErrorMessage *string `json:"error_message"`
}

type Channel

type Channel struct {
	Channel              string        `json:"channel"`
	ChannelID            int           `json:"channel_id"`
	Club                 *Club         `json:"club"`
	ClubID               *int          `json:"club_id"`
	ClubName             *string       `json:"club_name"`
	CreatorUserProfileID int           `json:"creator_user_profile_id"`
	FeatureFlags         []FeatureFlag `json:"feature_flags"`
	HasBlockedSpeakers   bool          `json:"has_blocked_speakers"`
	IsExploreChannel     bool          `json:"is_explore_channel"`
	IsPrivate            bool          `json:"is_private"`
	IsSocialMode         bool          `json:"is_social_mode"`
	NumAll               int           `json:"num_all"`
	NumOther             int           `json:"num_other"`
	NumSpeakers          int           `json:"num_speakers"`
	Topic                *string       `json:"topic"`
	URL                  string        `json:"url"`
	Users                []struct {
		IsModerator         bool       `json:"is_moderator"`
		IsSpeaker           bool       `json:"is_speaker"`
		Name                string     `json:"name"`
		PhotoURL            string     `json:"photo_url"`
		TimeJoinedAsSpeaker *time.Time `json:"time_joined_as_speaker"`
		UserID              int        `json:"user_id"`
	} `json:"users"`
	WelcomeForUserProfile *BaseUserProfile `json:"welcome_for_user_profile"`
}

type ChannelUser

type ChannelUser struct {
	BaseUserProfile
	FirstName           string     `json:"first_name"`
	IsFollowedBySpeaker bool       `json:"is_followed_by_speaker"`
	IsInvitedAsSpeaker  bool       `json:"is_invited_as_speaker"`
	IsModerator         bool       `json:"is_moderator"`
	IsNew               bool       `json:"is_new"`
	IsSpeaker           bool       `json:"is_speaker"`
	Skintone            int        `json:"skintone"`
	TimeJoinedAsSpeaker *time.Time `json:"time_joined_as_speaker"`
}

type CheckForUpdateParams added in v0.3.0

type CheckForUpdateParams struct {
	IsTestFlight int `url:"is_testflight"`
}

type CheckForUpdateResponse added in v0.3.0

type CheckForUpdateResponse struct {
	Response
	AppBuild    *int    `json:"app_build,omitempty"`
	AppURL      *string `json:"app_url,omitempty"`
	AppVersion  *string `json:"app_version,omitempty"`
	HasUpdate   bool    `json:"has_update"`
	IsMandatory *bool   `json:"is_mandatory,omitempty"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...ClientOption) *Client

func NewFromToken

func NewFromToken(token string, opts ...ClientOption) *Client

NewFromToken is a convenience function for instantiating a Client with a token.

func (*Client) AddEmail added in v0.3.0

func (c *Client) AddEmail(params *UpdateNameParams) (*AddEmailResponse, *http.Response, error)

func (*Client) Block added in v0.3.0

func (c *Client) Block(params *BlockParams) (*BlockResponse, *http.Response, error)

func (*Client) BlockFromChannel

func (c *Client) BlockFromChannel(params *BlockFromChannelParams) (*BlockFromChannelResponse, *http.Response, error)

func (*Client) CallPhoneNumberAuth

func (c *Client) CallPhoneNumberAuth(params *CallPhoneNumberAuthParams) (*CallPhoneNumberAuthResponse, *http.Response, error)

func (*Client) CheckForUpdate added in v0.3.0

func (c *Client) CheckForUpdate(params *CheckForUpdateParams) (*CheckForUpdateResponse, *http.Response, error)

func (*Client) CompletePhoneNumberAuth

func (c *Client) CompletePhoneNumberAuth(params *CompletePhoneNumberAuthParams) (*CompletePhoneNumberAuthResponse, *http.Response, error)

func (*Client) CreateChannel

func (c *Client) CreateChannel(params *CreateChannelParams) (*CreateChannelResponse, *http.Response, error)

func (*Client) EndChannel

func (c *Client) EndChannel(params *EndChannelParams) (*EndChannelResponse, *http.Response, error)

func (*Client) Follow added in v0.3.0

func (c *Client) Follow(params *FollowParams) (*FollowResponse, *http.Response, error)

func (*Client) FollowClub added in v0.3.0

func (c *Client) FollowClub(params *FollowClubParams) (*FollowClubResponse, *http.Response, error)

func (*Client) GetChannel

func (c *Client) GetChannel(params *GetChannelParams) (*GetChannelResponse, *http.Response, error)

func (*Client) GetChannels

func (c *Client) GetChannels() (*GetChannelsResponse, *http.Response, error)

func (*Client) GetClub

func (c *Client) GetClub(params *GetClubParams) (*GetClubResponse, *http.Response, error)

func (*Client) GetClubMembers

func (c *Client) GetClubMembers(params *GetClubMembersParams) (*GetClubMembersResponse, *http.Response, error)

func (*Client) GetClubs

func (c *Client) GetClubs(params *GetClubsParams) (*GetClubsResponse, *http.Response, error)

func (*Client) GetEvents added in v0.3.0

func (c *Client) GetEvents(params *GetEventsParams) (*GetEventsResponse, *http.Response, error)

func (*Client) GetEventsForClub added in v0.3.0

func (c *Client) GetEventsForClub(params *GetEventsForClubParams) (*GetEventsForClubResponse, *http.Response, error)

func (*Client) GetEventsForUser added in v0.3.0

func (c *Client) GetEventsForUser(params *GetEventsForUserParams) (*GetEventsForUserResponse, *http.Response, error)

func (*Client) GetFollowers

func (c *Client) GetFollowers(params *GetFollowersParams) (*GetFollowersResponse, *http.Response, error)

func (*Client) GetFollowing

func (c *Client) GetFollowing(params *GetFollowingParams) (*GetFollowingResponse, *http.Response, error)

func (*Client) GetMutualFollows added in v0.3.0

func (c *Client) GetMutualFollows(params *GetMutualFollowsParams) (*GetMutualFollowsResponse, *http.Response, error)

func (*Client) GetOnlineFriends added in v0.3.0

func (c *Client) GetOnlineFriends() (*GetOnlineFriendsResponse, *http.Response, error)

func (*Client) GetProfile

func (c *Client) GetProfile(params *GetProfileParams) (*GetProfileResponse, *http.Response, error)

func (*Client) GetStripeEphemeralKey added in v0.2.0

func (c *Client) GetStripeEphemeralKey(params *GetStripeEphemeralKeyParams) (*GetStripeEphemeralKeyResponse, *http.Response, error)

func (*Client) InviteToApp

func (c *Client) InviteToApp(params *InviteToAppParams) (*InviteToAppResponse, *http.Response, error)

func (*Client) JoinChannel

func (c *Client) JoinChannel(params *JoinChannelParams) (*JoinChannelResponse, *http.Response, error)

func (*Client) LeaveChannel

func (c *Client) LeaveChannel(params *LeaveChannelParams) (*LeaveChannelResponse, *http.Response, error)

func (*Client) Me

func (c *Client) Me(params *MeParams) (*MeResponse, *http.Response, error)

func (*Client) ResendPhoneNumberAuth

func (c *Client) ResendPhoneNumberAuth(params *ResendPhoneNumberAuthParams) (*ResendPhoneNumberAuthResponse, *http.Response, error)

func (*Client) SearchClubs

func (c *Client) SearchClubs(params *SearchClubsParams) (*SearchClubsResponse, *http.Response, error)

func (*Client) SearchUsers

func (c *Client) SearchUsers(params *SearchUsersParams) (*SearchUsersResponse, *http.Response, error)

func (*Client) SendDirectPayment added in v0.2.0

func (c *Client) SendDirectPayment(params *SendDirectPaymentParams) (*SendDirectPaymentResponse, *http.Response, error)

func (*Client) StartPhoneNumberAuth

func (c *Client) StartPhoneNumberAuth(params *StartPhoneNumberAuthParams) (*StartPhoneNumberAuthResponse, *http.Response, error)

func (*Client) Unblock added in v0.3.0

func (c *Client) Unblock(params *UnblockParams) (*UnblockResponse, *http.Response, error)

func (*Client) Unfollow added in v0.3.0

func (c *Client) Unfollow(params *UnfollowParams) (*UnfollowResponse, *http.Response, error)

func (*Client) UnfollowClub added in v0.3.0

func (c *Client) UnfollowClub(params *UnfollowClubParams) (*UnfollowClubResponse, *http.Response, error)

func (*Client) UpdateBio added in v0.3.0

func (c *Client) UpdateBio(params *UpdateBioParams) (*UpdateBioResponse, *http.Response, error)

func (*Client) UpdateName added in v0.3.0

func (c *Client) UpdateName(params *UpdateNameParams) (*UpdateNameResponse, *http.Response, error)

func (*Client) UpdateUsername added in v0.3.0

func (c *Client) UpdateUsername(params *UpdateUsernameParams) (*UpdateUsernameResponse, *http.Response, error)

type ClientOption

type ClientOption func(*Client)

func WithDeviceID

func WithDeviceID(deviceID uuid.UUID) ClientOption

WithDeviceID is an option for setting the device ID.

func WithToken

func WithToken(token string) ClientOption

WithUserID is an option for setting the auth token.

func WithUserID

func WithUserID(id int) ClientOption

WithUserID is an option for setting the user ID.

type Club

type Club struct {
	BaseClub
	EnablePrivate       bool   `json:"enable_private"`
	IsCommunity         bool   `json:"is_community"`
	IsFollowAllowed     bool   `json:"is_follow_allowed"`
	IsMembershipPrivate bool   `json:"is_membership_private"`
	NumFollowers        int    `json:"num_followers"`
	NumMembers          int    `json:"num_members"`
	NumOnline           int    `json:"num_online"`
	Rules               []Rule `json:"rules"`
	Url                 string `json:"url"`
}

type ClubMember

type ClubMember struct {
	BaseUserProfile
	Bio               *string `json:"bio"`
	IsAdmin           bool    `json:"is_admin"`
	IsFollower        bool    `json:"is_follower"`
	IsMember          bool    `json:"is_member"`
	IsPendingAccept   bool    `json:"is_pending_accept"`
	IsPendingApproval bool    `json:"is_pending_approval"`
}

type CompletePhoneNumberAuthParams

type CompletePhoneNumberAuthParams struct {
	DeviceToken      *string `json:"device_token,omitempty"`
	PhoneNumber      string  `json:"phone_number"`
	VerificationCode string  `json:"verification_code"`
}

type CompletePhoneNumberAuthResponse

type CompletePhoneNumberAuthResponse struct {
	Response
	AccessToken               *string          `json:"access_token,omitempty"`
	AuthToken                 *string          `json:"auth_token,omitempty"`
	IsOnboarding              *bool            `json:"is_onboarding,omitempty"`
	IsVerified                bool             `json:"is_verified"`
	IsWaitlisted              *bool            `json:"is_waitlisted,omitempty"`
	NumberOfAttemptsRemaining *int             `json:"number_of_attempts_remaining,omitempty"`
	RefreshToken              *string          `json:"refresh_token,omitempty"`
	UserProfile               *BaseUserProfile `json:"user_profile,omitempty"`
}

type CreateChannelParams

type CreateChannelParams struct {
	ClubID       *int    `json:"club_id"`
	EventID      *int    `json:"event_id"`
	IsPrivate    bool    `json:"is_private"`
	IsSocialMode bool    `json:"is_social_mode"`
	Topic        *string `json:"topic"`
	UserIds      []int   `json:"user_ids"`
}

type CreateChannelResponse

type CreateChannelResponse struct {
	Response
	AgoraNativeMute         bool             `json:"agora_native_mute"`
	Channel                 string           `json:"channel"`
	ChannelID               int              `json:"channel_id"`
	Club                    *Club            `json:"club"`
	ClubID                  *int             `json:"club_id"`
	ClubName                *string          `json:"club_name"`
	CreatorUserProfileID    int              `json:"creator_user_profile_id"`
	FeatureFlags            []string         `json:"feature_flags"`
	HandraisePermission     int              `json:"handraise_permission"`
	IsClubAdmin             bool             `json:"is_club_admin"`
	IsClubMember            bool             `json:"is_club_member"`
	IsHandraiseEnabled      bool             `json:"is_handraise_enabled"`
	IsPrivate               bool             `json:"is_private"`
	IsSocialMode            bool             `json:"is_social_mode"`
	PubnubEnable            bool             `json:"pubnub_enable"`
	PubnubHeartbeatInterval int              `json:"pubnub_heartbeat_interval"`
	PubnubHeartbeatValue    int              `json:"pubnub_heartbeat_value"`
	PubnubOrigin            string           `json:"pubnub_origin"`
	PubnubToken             string           `json:"pubnub_token"`
	RtmToken                string           `json:"rtm_token"`
	Token                   string           `json:"token"`
	Topic                   *string          `json:"topic"`
	URL                     string           `json:"url"`
	Users                   []ChannelUser    `json:"users"`
	WelcomeForUserProfile   *BaseUserProfile `json:"welcome_for_user_profile"`
}

type EndChannelParams

type EndChannelParams struct {
	Channel   string `json:"channel"`
	ChannelID *int   `json:"channel_id"`
}

type EndChannelResponse

type EndChannelResponse struct {
	Response
}

type Event

type Event struct {
	Channel      *string     `json:"channel"`
	Club         *Club       `json:"club"`
	Description  string      `json:"description"`
	EventID      int         `json:"event_id"`
	Hosts        []EventHost `json:"hosts"`
	IsAttending  bool        `json:"is_attending"`
	IsExpired    bool        `json:"is_expired"`
	IsMemberOnly bool        `json:"is_member_only"`
	Name         string      `json:"name"`
	TimeStart    string      `json:"time_start"`
	URL          string      `json:"url"`
}

type EventHost

type EventHost struct {
	BaseUserProfile
	Bio     *string `json:"bio"`
	Twitter *string `json:"twitter"`
}

type FeatureFlag

type FeatureFlag string
const (
	AgoraAudioProfileSpeechStandard FeatureFlag = "AGORA_AUDIO_PROFILE_SPEECH_STANDARD"
)

type FollowClubParams added in v0.3.0

type FollowClubParams struct {
	ClubID        int    `json:"club_id,omitempty"`
	Slug          string `json:"slug,omitempty"`
	SourceTopicID int    `json:"source_topic_id,omitempty"`
}

type FollowClubResponse added in v0.3.0

type FollowClubResponse struct {
	Response
}

type FollowParams added in v0.3.0

type FollowParams struct {
	Source        int    `json:"source"` // TODO: Document all sources
	SourceTopicID *int   `json:"source_topic_id"`
	UserIDS       *[]int `json:"user_ids"`
	UserID        int    `json:"user_id"`
}

type FollowResponse added in v0.3.0

type FollowResponse struct {
	Response
}

type FollowerUserProfile

type FollowerUserProfile struct {
	BaseUserProfile
	Bio               *string `json:"bio"`
	LastActiveMinutes *int    `json:"last_active_minutes"`
	Twitter           *string `json:"twitter"`
}

type FollowingUserProfile

type FollowingUserProfile struct {
	BaseUserProfile
	Bio     *string `json:"bio"`
	Twitter *string `json:"twitter"`
}

type GetChannelParams

type GetChannelParams struct {
	Channel   string `json:"channel"`
	ChannelID *int   `json:"channel_id"`
}

type GetChannelResponse

type GetChannelResponse struct {
	Response
	Channel               string           `json:"channel"`
	ChannelID             int              `json:"channel_id"`
	Club                  *Club            `json:"club"`
	ClubID                *int             `json:"club_id"`
	ClubName              *string          `json:"club_name"`
	CreatorUserProfileID  int              `json:"creator_user_profile_id"`
	FeatureFlags          []FeatureFlag    `json:"feature_flags"`
	HandraisePermission   int              `json:"handraise_permission"`
	IsClubAdmin           bool             `json:"is_club_admin"`
	IsClubMember          bool             `json:"is_club_member"`
	IsHandraiseEnabled    bool             `json:"is_handraise_enabled"`
	IsPrivate             bool             `json:"is_private"`
	IsSocialMode          bool             `json:"is_social_mode"`
	ShouldLeave           bool             `json:"should_leave"`
	Topic                 *string          `json:"topic"`
	URL                   string           `json:"url"`
	Users                 []ChannelUser    `json:"users"`
	WelcomeForUserProfile *BaseUserProfile `json:"welcome_for_user_profile"`
}

type GetChannelsResponse

type GetChannelsResponse struct {
	Response
	Channels []struct {
		Channel
		LoggingContext LoggingContext `json:"logging_context"`
	} `json:"channels"`
	Events []Event `json:"events"`
}

type GetClubMembersParams

type GetClubMembersParams struct {
	ClubID          int `url:"club_id"`
	ReturnFollowers int `url:"return_followers"`
	ReturnMembers   int `url:"return_members"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetClubMembersResponse

type GetClubMembersResponse struct {
	PageResponse
	Users []ClubMember `json:"users"`
}

type GetClubParams

type GetClubParams struct {
	ClubID        int    `json:"club_id,omitempty"`
	Slug          string `json:"slug,omitempty"`
	SourceTopicID int    `json:"source_topic_id,omitempty"`
}

type GetClubResponse

type GetClubResponse struct {
	Response
	AddedByUserProfile *BaseUserProfile `json:"added_by_user_profile"`
	Club               Club             `json:"club"`
	InviteLink         *string          `json:"invite_link"`
	IsAdmin            bool             `json:"is_admin"`
	IsFollower         bool             `json:"is_follower"`
	IsMember           bool             `json:"is_member"`
	IsPendingAccept    bool             `json:"is_pending_accept"`
	IsPendingApproval  bool             `json:"is_pending_approval"`
	MemberUserIds      []int            `json:"member_user_ids"`
	NumInvites         int              `json:"num_invites"`
	Topics             []Topic          `json:"topics"`
}

type GetClubsParams

type GetClubsParams struct {
	IsStartableOnly bool `json:"is_startable_only"`
}

type GetClubsResponse

type GetClubsResponse struct {
	Response
	Clubs []struct {
		Club
		IsAdmin bool `json:"is_admin"`
	} `json:"clubs"`
}

type GetEventsForClubParams added in v0.3.0

type GetEventsForClubParams struct {
	ClubID              int         `json:"club_id"`
	InviteCode          interface{} `json:"invite_code"` // TODO: Find real type
	QueryID             *string     `json:"query_id"`
	QueryResultPosition *int        `json:"query_result_position"`
	Slug                *string     `json:"slug"`
	SourceTopicID       *int        `json:"source_topic_id"`
}

type GetEventsForClubResponse added in v0.3.0

type GetEventsForClubResponse struct {
	Response
	Events []Event `json:"events"`
}

type GetEventsForUserParams added in v0.3.0

type GetEventsForUserParams struct {
	UserID int `url:"user_id"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetEventsForUserResponse added in v0.3.0

type GetEventsForUserResponse struct {
	PageResponse
	Events []struct {
		Event
		ClubIsFollower int `json:"club_is_follower"`
		ClubIsMember   int `json:"club_is_member"`
	} `json:"events"`
}

type GetEventsParams added in v0.3.0

type GetEventsParams struct {
	IsFiltered bool `url:"is_filtered"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetEventsResponse added in v0.3.0

type GetEventsResponse struct {
	PageResponse
	Events []struct {
		Event
		ClubIsFollower int `json:"club_is_follower"`
		ClubIsMember   int `json:"club_is_member"`
	} `json:"events"`
}

type GetFollowersParams

type GetFollowersParams struct {
	UserID int `url:"user_id"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetFollowersResponse

type GetFollowersResponse struct {
	PageResponse
	Users []FollowerUserProfile `json:"users"`
}

type GetFollowingParams

type GetFollowingParams struct {
	UserID int `url:"user_id"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetFollowingResponse

type GetFollowingResponse struct {
	PageResponse
	Clubs []Club                 `json:"clubs"`
	Users []FollowingUserProfile `json:"users"`
}

type GetMutualFollowsParams added in v0.3.0

type GetMutualFollowsParams struct {
	UserID int `url:"user_id"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type GetMutualFollowsResponse added in v0.3.0

type GetMutualFollowsResponse struct {
	PageResponse
	Users []FollowerUserProfile `json:"users"`
}

type GetOnlineFriendsParams added in v0.3.0

type GetOnlineFriendsParams struct{}

type GetOnlineFriendsResponse added in v0.3.0

type GetOnlineFriendsResponse struct {
	Clubs []struct {
		Club
		IsAdmin       bool              `json:"is_admin"`
		OnlineMembers []BaseUserProfile `json:"online_members"`
	} `json:"clubs"`
	Users []struct {
		BaseUserProfile
		LastActiveMinutes int `json:"last_active_minutes"`
	} `json:"users"`
}

type GetProfileParams

type GetProfileParams struct {
	UserID   int    `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type GetProfileResponse

type GetProfileResponse struct {
	Response
	UserProfile UserProfile `json:"user_profile"`
}

type GetStripeEphemeralKeyParams added in v0.2.0

type GetStripeEphemeralKeyParams struct {
	StripeVersion string `json:"stripe_version"`
}

type GetStripeEphemeralKeyResponse added in v0.2.0

type GetStripeEphemeralKeyResponse struct {
	Response
	AssociatedObjects []struct {
		ID   string `json:"id"`
		Type string `json:"type"`
	} `json:"associated_objects"`
	Created  int    `json:"created"`
	Expires  int    `json:"expires"`
	ID       string `json:"id"`
	Livemode bool   `json:"livemode"`
	Object   string `json:"object"`
	Secret   string `json:"secret"`
}

type InviteToAppParams

type InviteToAppParams struct {
	Message     *string `json:"message"`
	Name        *string `json:"name"`
	PhoneNumber string  `json:"phone_number"`
}

type InviteToAppResponse

type InviteToAppResponse struct {
	Response
}

type JoinChannelParams

type JoinChannelParams struct {
	AttributionDetails string            `json:"attribution_details"` // Base 64 JSON
	AttributionSource  AttributionSource `json:"attribution_source"`
	Channel            string            `json:"channel"`
}

type JoinChannelResponse

type JoinChannelResponse struct {
	Response
	AgoraNativeMute         bool             `json:"agora_native_mute"`
	Channel                 string           `json:"channel"`
	ChannelID               int              `json:"channel_id"`
	Club                    *Club            `json:"club"`
	ClubID                  *int             `json:"club_id"`
	ClubName                *string          `json:"club_name"`
	CreatorUserProfileID    int              `json:"creator_user_profile_id"`
	FeatureFlags            []string         `json:"feature_flags"`
	HandraisePermission     int              `json:"handraise_permission"`
	IsClubAdmin             bool             `json:"is_club_admin"`
	IsClubMember            bool             `json:"is_club_member"`
	IsEmpty                 bool             `json:"is_empty"`
	IsHandraiseEnabled      bool             `json:"is_handraise_enabled"`
	IsPrivate               bool             `json:"is_private"`
	IsSocialMode            bool             `json:"is_social_mode"`
	PubnubEnable            bool             `json:"pubnub_enable"`
	PubnubHeartbeatInterval int              `json:"pubnub_heartbeat_interval"`
	PubnubHeartbeatValue    int              `json:"pubnub_heartbeat_value"`
	PubnubOrigin            string           `json:"pubnub_origin"`
	PubnubToken             string           `json:"pubnub_token"`
	RtmToken                string           `json:"rtm_token"`
	Token                   string           `json:"token"`
	Topic                   *string          `json:"topic"`
	URL                     string           `json:"url"`
	Users                   []ChannelUser    `json:"users"`
	WelcomeForUserProfile   *BaseUserProfile `json:"welcome_for_user_profile"`
}

type LeaveChannelParams

type LeaveChannelParams struct {
	Channel   string `json:"channel"`
	ChannelID *int   `json:"channel_id"`
}

type LeaveChannelResponse

type LeaveChannelResponse struct {
	Response
}

type LoggingContext added in v0.2.0

type LoggingContext struct {
	BatchID   string   `json:"batch_id"`
	ChannelID int      `json:"channel_id"`
	Reasons   []Reason `json:"reasons"`
}

type MeParams

type MeParams struct {
	ReturnBlockedIds   bool   `json:"return_blocked_ids"`
	TimezoneIdentifier string `json:"timezone_identifier"`
	ReturnFollowingIds bool   `json:"return_following_ids"`
}

type MeResponse

type MeResponse struct {
	Response
	AccessToken                  string   `json:"access_token"`
	ActionableNotificationsCount int      `json:"actionable_notifications_count"`
	AuthToken                    string   `json:"auth_token"`
	BlockedIds                   *[]int   `json:"blocked_ids"`
	Email                        string   `json:"email"`
	FeatureFlags                 []string `json:"feature_flags"`
	FollowingIds                 *[]int   `json:"following_ids"`
	HasUnreadNotifications       bool     `json:"has_unread_notifications"`
	IsAdmin                      bool     `json:"is_admin"`
	NotificationsEnabled         bool     `json:"notifications_enabled"`
	NumInvites                   int      `json:"num_invites"`
	RefreshToken                 string   `json:"refresh_token"`
	ServiceStatus                *struct {
		ButtonTitle string `json:"button_title"`
		Message     string `json:"message"`
		Title       string `json:"title"`
		URL         string `json:"url"`
	} `json:"service_status"`
	UserProfile BaseUserProfile `json:"user_profile"`
}

type PageResponse

type PageResponse struct {
	Response
	Count    int  `json:"count"`
	Next     *int `json:"next"`
	Previous *int `json:"previous"`
}

type Reason added in v0.2.0

type Reason string
const (
	AffinityList  Reason = "affinity_list"
	ClubIFollow   Reason = "club_i_follow"
	PersonIFollow Reason = "person_i_follow"
)

type ResendPhoneNumberAuthParams

type ResendPhoneNumberAuthParams struct {
	PhoneNumber string `json:"phone_number"`
}

type ResendPhoneNumberAuthResponse

type ResendPhoneNumberAuthResponse struct {
	Response
	ErrorMessage *string `json:"error_message"`
}

type Response

type Response struct {
	Success bool `json:"success"`
}

type Rule

type Rule struct {
	Desc  string `json:"desc"`
	Title string `json:"title"`
}

type SearchClub

type SearchClub struct {
	BaseClub
	ClubID int `json:"club_id,string"` // Club IDs are returned as strings in search results
}

type SearchClubsParams

type SearchClubsParams struct {
	CofollowsOnly bool   `json:"cofollows_only" url:"-"`
	FollowersOnly bool   `json:"followers_only" url:"-"`
	FollowingOnly bool   `json:"following_only" url:"-"`
	Query         string `json:"query" url:"-"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type SearchClubsResponse

type SearchClubsResponse struct {
	PageResponse
	Clubs   []SearchClub `json:"clubs"`
	QueryID string       `json:"query_id"`
}

type SearchUserProfile

type SearchUserProfile struct {
	BaseUserProfile
	Bio    *string `json:"bio"`
	UserID int     `json:"user_id,string"` // User IDs are returned as strings in search results
}

type SearchUsersParams

type SearchUsersParams struct {
	CofollowsOnly bool   `json:"cofollows_only" url:"-"`
	FollowersOnly bool   `json:"followers_only" url:"-"`
	FollowingOnly bool   `json:"following_only" url:"-"`
	Query         string `json:"query" url:"-"`

	Page     *int `json:"-" url:"page,omitempty"`
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type SearchUsersResponse

type SearchUsersResponse struct {
	PageResponse
	QueryID string              `json:"query_id"`
	Users   []SearchUserProfile `json:"users"`
}

type SendDirectPaymentParams added in v0.2.0

type SendDirectPaymentParams struct {
	Amount          int     `json:"amount"` // Amount is in the smallest common currency unit. E.g. $1.00 = 100
	Channel         *string `json:"channel"`
	PaymentMethodID string  `json:"payment_method_id"`
	ReceivingUserID int     `json:"receiving_user_id"`
}

type SendDirectPaymentResponse added in v0.2.0

type SendDirectPaymentResponse struct {
	Response
	ClientSecret     *string     `json:"client_secret"`
	ConnectAccountID interface{} `json:"connect_account_id"` // TODO: Find real type
	NeedsAction      bool        `json:"needs_action"`
}

type StartPhoneNumberAuthParams

type StartPhoneNumberAuthParams struct {
	PhoneNumber string `json:"phone_number"`
}

type StartPhoneNumberAuthResponse

type StartPhoneNumberAuthResponse struct {
	Response
	ErrorMessage *string `json:"error_message"`
	IsBlocked    bool    `json:"is_blocked"`
}

type Topic

type Topic struct {
	AbbreviatedTitle string `json:"abbreviated_title"`
	ID               int    `json:"id"`
	Title            string `json:"title"`
}

type UnblockParams added in v0.3.0

type UnblockParams struct {
	UserID   int    `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type UnblockResponse added in v0.3.0

type UnblockResponse struct {
	Response
}

type UnfollowClubParams added in v0.3.0

type UnfollowClubParams struct {
	ClubID        int    `json:"club_id,omitempty"`
	Slug          string `json:"slug,omitempty"`
	SourceTopicID int    `json:"source_topic_id,omitempty"`
}

type UnfollowClubResponse added in v0.3.0

type UnfollowClubResponse struct {
	Response
}

type UnfollowParams added in v0.3.0

type UnfollowParams struct {
	UserID   int    `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type UnfollowResponse added in v0.3.0

type UnfollowResponse struct {
	Response
}

type UpdateBioParams added in v0.3.0

type UpdateBioParams struct {
	Bio string `json:"bio"`
}

type UpdateBioResponse added in v0.3.0

type UpdateBioResponse struct {
	Response
}

type UpdateNameParams added in v0.3.0

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

type UpdateNameResponse added in v0.3.0

type UpdateNameResponse struct {
	Response
	ErrorMessage *string `json:"error_message"`
}

type UpdateUsernameParams added in v0.3.0

type UpdateUsernameParams struct {
	TwitterToken  *string `json:"twitter_token"`
	TwitterSecret *string `json:"twitter_secret"`
	Username      string  `json:"username"`
}

type UpdateUsernameResponse added in v0.3.0

type UpdateUsernameResponse struct {
	Response
	ErrorMessage *string `json:"error_message"`
}

type UserProfile

type UserProfile struct {
	BaseUserProfile
	Bio                     *string           `json:"bio"`
	CanEditDisplayname      bool              `json:"can_edit_displayname"`
	CanEditName             bool              `json:"can_edit_name"`
	CanEditUsername         bool              `json:"can_edit_username"`
	CanReceiveDirectPayment bool              `json:"can_receive_direct_payment"`
	Clubs                   []Club            `json:"clubs"`
	DirectPaymentFeeFixed   float64           `json:"direct_payment_fee_fixed"`
	DirectPaymentFeeRate    float64           `json:"direct_payment_fee_rate"`
	Displayname             *string           `json:"displayname"`
	FollowsMe               bool              `json:"follows_me"`
	HasVerifiedEmail        bool              `json:"has_verified_email"`
	Instagram               *string           `json:"instagram"`
	InvitedByClub           *Club             `json:"invited_by_club"`
	InvitedByUserProfile    *BaseUserProfile  `json:"invited_by_user_profile"`
	IsBlockedByNetwork      bool              `json:"is_blocked_by_network"`
	MutualFollows           []BaseUserProfile `json:"mutual_follows"`
	MutualFollowsCount      int               `json:"mutual_follows_count"`
	NotificationType        *int              `json:"notification_type"`
	NumFollowers            int               `json:"num_followers"`
	NumFollowing            int               `json:"num_following"`
	TimeCreated             time.Time         `json:"time_created"`
	Topics                  []Topic           `json:"topics"`
	Twitter                 *string           `json:"twitter"`
	UpcomingEvents          []Event           `json:"upcoming_events"`
	Url                     *string           `json:"url"`
}

Jump to

Keyboard shortcuts

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