pub struct HingeClient<S: Storage + Clone> {
pub settings: Settings,
pub storage: S,
pub phone_number: String,
pub device_id: String,
pub install_id: String,
pub session_id: String,
pub installed: bool,
pub hinge_auth: Option<HingeAuthToken>,
pub sendbird_auth: Option<SendbirdAuthToken>,
pub sendbird_session_key: Option<String>,
pub recommendations: HashMap<String, RecommendationSubject>,
/* private fields */
}Fields§
§settings: Settings§storage: S§phone_number: String§device_id: String§install_id: String§session_id: String§installed: bool§hinge_auth: Option<HingeAuthToken>§sendbird_auth: Option<SendbirdAuthToken>§sendbird_session_key: Option<String>§recommendations: HashMap<String, RecommendationSubject>Implementations§
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn initiate_login(&mut self) -> Result<(), HingeError>
pub async fn submit_otp(&mut self, otp: &str) -> Result<LoginTokens, HingeError>
pub async fn submit_email_code( &mut self, case_id: &str, email_code: &str, ) -> Result<LoginTokens, HingeError>
pub async fn is_session_valid(&mut self) -> Result<bool, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn send_message( &self, payload: SendMessagePayload, ) -> Result<Value, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn get_connections_v2( &self, ) -> Result<ConnectionsResponse, HingeError>
pub async fn get_connection_detail( &self, subject_id: &str, ) -> Result<ConnectionDetailApi, HingeError>
pub async fn get_connection_match_note( &self, subject_id: &str, ) -> Result<MatchNoteResponse, HingeError>
pub async fn get_standouts(&self) -> Result<StandoutsResponse, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn get_like_limit(&self) -> Result<LikeLimit, HingeError>
pub async fn get_likes_v2(&self) -> Result<LikesV2Response, HingeError>
pub async fn get_like_subject( &self, subject_id: &str, ) -> Result<LikeItemV2, HingeError>
pub async fn get_match_note( &self, subject_id: &str, ) -> Result<MatchNoteResponse, HingeError>
pub async fn get_likes_v2_raw(&self) -> Result<Value, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub fn save_session(&self, path: &str) -> Result<(), HingeError>
pub fn load_session(&mut self, path: &str) -> Result<(), HingeError>
pub fn load_tokens_secure(&mut self) -> Result<(), HingeError>
pub fn with_persistence( self, session_path: Option<String>, cache_dir: Option<PathBuf>, auto_persist: bool, ) -> Self
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn rendered_profile_text_for_user( &mut self, user_id: &str, ) -> Result<String, HingeError>
pub async fn get_self_profile(&self) -> Result<SelfProfileResponse, HingeError>
pub async fn get_self_content(&self) -> Result<SelfContentResponse, HingeError>
pub async fn get_self_preferences( &self, ) -> Result<PreferencesResponse, HingeError>
pub async fn get_profiles_public_raw_unfiltered( &self, ids: Vec<String>, ) -> Result<Value, HingeError>
pub async fn get_content_public_raw_unfiltered( &self, ids: Vec<String>, ) -> Result<Value, HingeError>
pub async fn get_profiles( &self, user_ids: Vec<String>, ) -> Result<Vec<PublicUserProfile>, HingeError>
pub async fn get_profile_content( &self, user_ids: Vec<String>, ) -> Result<Vec<ProfileContentFull>, HingeError>
pub async fn update_self_preferences( &self, preferences: Preferences, ) -> Result<Value, HingeError>
pub async fn update_self_profile( &self, profile_updates: ProfileUpdate, ) -> Result<Value, HingeError>
pub async fn update_answers( &self, answers: Vec<AnswerContentPayload>, ) -> Result<Value, HingeError>
pub async fn delete_content( &self, content_ids: Vec<String>, ) -> Result<(), HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn fetch_prompts(&mut self) -> Result<PromptsResponse, HingeError>
pub async fn fetch_prompts_manager( &mut self, ) -> Result<HingePromptsManager, HingeError>
pub async fn get_prompt_text( &mut self, prompt_id: &str, ) -> Result<String, HingeError>
pub async fn search_prompts( &mut self, query: &str, ) -> Result<Vec<Prompt>, HingeError>
pub async fn get_prompts_by_category( &mut self, category_slug: &str, ) -> Result<Vec<Prompt>, HingeError>
pub async fn prompt_payload(&mut self) -> Value
pub async fn evaluate_answer( &self, payload: AnswerEvaluateRequest, ) -> Result<Value, HingeError>
pub async fn create_prompt_poll( &self, payload: CreatePromptPollRequest, ) -> Result<CreatePromptPollResponse, HingeError>
pub async fn create_video_prompt( &self, payload: CreateVideoPromptRequest, ) -> Result<CreateVideoPromptResponse, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn skip(&mut self, input: SkipInput) -> Result<Value, HingeError>
pub async fn rate_user( &mut self, input: RateInput, ) -> Result<LikeResponse, HingeError>
pub async fn respond_rate( &self, payload: RateRespondRequest, ) -> Result<RateRespondResponse, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn raw_hinge_json( &self, method: Method, path_or_url: &str, body: Option<Value>, ) -> Result<Value, HingeError>
pub async fn raw_sendbird_json( &self, method: Method, path_or_url: &str, body: Option<Value>, ) -> Result<Value, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn get_recommendations( &mut self, ) -> Result<RecommendationsResponse, HingeError>
pub async fn get_recommendations_v2_params( &mut self, params: RecsV2Params, ) -> Result<RecommendationsResponse, HingeError>
pub fn apply_recommendations_and_save( &mut self, recs: &mut RecommendationsResponse, path: Option<&str>, ) -> Result<(), HingeError>
pub async fn repeat_profiles(&mut self) -> Result<Value, HingeError>
pub fn save_recommendations(&self, path: &str) -> Result<(), HingeError>
pub fn load_recommendations(&mut self, path: &str) -> Result<(), HingeError>
pub fn remove_recommendation(&mut self, subject_id: &str)
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn sendbird_list_my_group_channels( &mut self, user_id: &str, limit: usize, ) -> Result<Value, HingeError>
pub async fn sendbird_list_channels_typed( &mut self, limit: usize, ) -> Result<SendbirdChannelsResponse, HingeError>
pub async fn sendbird_get_channel( &mut self, channel_url: &str, ) -> Result<Value, HingeError>
pub async fn sendbird_get_channel_typed( &mut self, channel_url: &str, ) -> Result<SendbirdGroupChannel, HingeError>
pub async fn sendbird_get_messages( &mut self, channel_url: &str, message_ts: i64, prev_limit: usize, ) -> Result<SendbirdMessagesResponse, HingeError>
pub async fn sendbird_get_full_messages( &mut self, channel_url: &str, ) -> Result<Vec<SendbirdMessage>, HingeError>
pub async fn export_chat( &mut self, input: ExportChatInput, ) -> Result<ExportChatResult, HingeError>
pub async fn sendbird_create_distinct_dm( &mut self, self_user_id: &str, peer_user_id: &str, data_mm: i32, ) -> Result<Value, HingeError>
pub async fn sendbird_get_or_create_dm_channel( &mut self, self_user_id: &str, peer_user_id: &str, ) -> Result<String, HingeError>
pub async fn ensure_sendbird_channel_with( &mut self, peer_user_id: &str, ) -> Result<SendbirdChannelHandle, HingeError>
pub async fn sendbird_init_flow(&mut self) -> Result<Value, HingeError>
Sourcepub async fn sendbird_creds(&mut self) -> Result<Value, HingeError>
pub async fn sendbird_creds(&mut self) -> Result<Value, HingeError>
Return Sendbird credentials for the JS client (appId and token), ensuring auth
pub async fn sendbird_ws_subscribe( &mut self, ) -> Result<(UnboundedSender<String>, Receiver<String>), HingeError>
Sourcepub async fn sendbird_ws_send_command(
&mut self,
command: String,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_command( &mut self, command: String, ) -> Result<(), HingeError>
Send a raw command to the Sendbird WebSocket
Sourcepub async fn sendbird_ws_send_read(
&mut self,
channel_url: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_read( &mut self, channel_url: &str, ) -> Result<(), HingeError>
Send a READ acknowledgment for a Sendbird channel (fire and forget)
Sourcepub async fn sendbird_ws_send_read_and_wait(
&mut self,
channel_url: &str,
) -> Result<SendbirdReadResponse, HingeError>
pub async fn sendbird_ws_send_read_and_wait( &mut self, channel_url: &str, ) -> Result<SendbirdReadResponse, HingeError>
Send a READ acknowledgment and wait for the response
Sourcepub async fn sendbird_ws_send_ping(&mut self) -> Result<(), HingeError>
pub async fn sendbird_ws_send_ping(&mut self) -> Result<(), HingeError>
Send a PING to keep the WebSocket alive
Sourcepub async fn sendbird_ws_send_typing_start(
&mut self,
channel_url: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_typing_start( &mut self, channel_url: &str, ) -> Result<(), HingeError>
Send a TPST (Typing Start) command - fire and forget
Sourcepub async fn sendbird_ws_send_typing_end(
&mut self,
channel_url: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_typing_end( &mut self, channel_url: &str, ) -> Result<(), HingeError>
Send a TPEN (Typing End) command - fire and forget
Sourcepub async fn sendbird_ws_send_enter_channel(
&mut self,
channel_url: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_enter_channel( &mut self, channel_url: &str, ) -> Result<(), HingeError>
Send an ENTR (Enter Channel) command - fire and forget
Sourcepub async fn sendbird_ws_send_exit_channel(
&mut self,
channel_url: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_exit_channel( &mut self, channel_url: &str, ) -> Result<(), HingeError>
Send an EXIT (Exit Channel) command - fire and forget
Sourcepub async fn sendbird_ws_send_message_ack(
&mut self,
channel_url: &str,
message_id: &str,
) -> Result<(), HingeError>
pub async fn sendbird_ws_send_message_ack( &mut self, channel_url: &str, message_id: &str, ) -> Result<(), HingeError>
Send a MACK (Message Acknowledgment) command - fire and forget
Sourcepub async fn sendbird_ws_close(
&mut self,
code: Option<u16>,
reason: Option<String>,
) -> Result<(), HingeError>
pub async fn sendbird_ws_close( &mut self, code: Option<u16>, reason: Option<String>, ) -> Result<(), HingeError>
Close the WebSocket connection with a specific code
Sourcepub async fn sendbird_ws_ensure_connected(&mut self) -> Result<bool, HingeError>
pub async fn sendbird_ws_ensure_connected(&mut self) -> Result<bool, HingeError>
Check if WebSocket is connected and reconnect if needed
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub async fn get_content_settings(&self) -> Result<UserSettings, HingeError>
pub async fn update_content_settings( &self, settings: UserSettings, ) -> Result<Value, HingeError>
pub async fn get_auth_settings(&self) -> Result<AuthSettings, HingeError>
pub async fn get_notification_settings( &self, ) -> Result<NotificationSettings, HingeError>
pub async fn get_user_traits(&self) -> Result<Vec<UserTrait>, HingeError>
pub async fn get_account_info(&self) -> Result<AccountInfo, HingeError>
pub async fn get_export_status(&self) -> Result<ExportStatus, HingeError>
Source§impl<S: Storage + Clone> HingeClient<S>
impl<S: Storage + Clone> HingeClient<S>
pub fn set_recs_fetch_config(&mut self, config: RecsFetchConfig)
pub fn set_public_ids_batch_size(&mut self, batch_size: usize)
pub fn new( phone_number: impl Into<String>, storage: S, settings: Option<Settings>, ) -> Self
pub fn with_secret_store(self, store: Arc<dyn SecretStore>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for HingeClient<S>where
S: Freeze,
impl<S> !RefUnwindSafe for HingeClient<S>
impl<S> Send for HingeClient<S>where
S: Send,
impl<S> Sync for HingeClient<S>where
S: Sync,
impl<S> Unpin for HingeClient<S>where
S: Unpin,
impl<S> UnsafeUnpin for HingeClient<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for HingeClient<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more