pub struct FCMDeviceGroupClient { /* private fields */ }Expand description
Client to use fcm device groups
Implementations§
Source§impl FCMDeviceGroupClient
impl FCMDeviceGroupClient
Sourcepub fn new(
sender_id: &str,
auth: impl GetToken + 'static,
) -> Result<Self, FCMDeviceGroupClientCreationError>
pub fn new( sender_id: &str, auth: impl GetToken + 'static, ) -> Result<Self, FCMDeviceGroupClientCreationError>
Creates a new FCMDeviceGroupClient with the default url and the provided bearer auth string
Sourcepub fn with_url(
url: impl IntoUrl,
sender_id: &str,
auth: impl GetToken + 'static,
) -> Result<Self, FCMDeviceGroupClientCreationError>
pub fn with_url( url: impl IntoUrl, sender_id: &str, auth: impl GetToken + 'static, ) -> Result<Self, FCMDeviceGroupClientCreationError>
Creates a new FCMDeviceGroupClient with the given url and the provided bearer auth string
Sourcepub fn with_client(
client: HttpClient,
url: impl IntoUrl,
auth: impl GetToken + 'static,
) -> Self
pub fn with_client( client: HttpClient, url: impl IntoUrl, auth: impl GetToken + 'static, ) -> Self
Creates a new FCMDeviceGroupClient with the given url and client. Note that the creator of the client
is responsible for adding authorization headers
Sourcepub async fn apply(
&self,
operation: Operation,
) -> Result<OperationResponse, FCMDeviceGroupsRequestError<FCMDeviceGroupsBadRequest>>
pub async fn apply( &self, operation: Operation, ) -> Result<OperationResponse, FCMDeviceGroupsRequestError<FCMDeviceGroupsBadRequest>>
Apply the given operation with with the client.
Sourcepub async fn create_group(
&self,
notification_key_name: String,
registration_ids: Vec<String>,
) -> OperationResult<FCMDeviceGroup, CreateGroupError>
pub async fn create_group( &self, notification_key_name: String, registration_ids: Vec<String>, ) -> OperationResult<FCMDeviceGroup, CreateGroupError>
Create a new group with the provided name and ID
Sourcepub async fn add_to_group(
&self,
group: FCMDeviceGroup,
registration_ids: Vec<String>,
) -> OperationResult<FCMDeviceGroup, ChangeGroupMembersError>
pub async fn add_to_group( &self, group: FCMDeviceGroup, registration_ids: Vec<String>, ) -> OperationResult<FCMDeviceGroup, ChangeGroupMembersError>
Add a set of registration IDS to the group
Sourcepub async fn remove_from_group(
&self,
group: FCMDeviceGroup,
registration_ids: Vec<String>,
) -> OperationResult<FCMDeviceGroup, ChangeGroupMembersError>
pub async fn remove_from_group( &self, group: FCMDeviceGroup, registration_ids: Vec<String>, ) -> OperationResult<FCMDeviceGroup, ChangeGroupMembersError>
Remove a set of registration IDS to the group
Sourcepub async fn get_key(
&self,
notification_key_name: String,
) -> OperationResult<FCMDeviceGroup, GetKeyError>
pub async fn get_key( &self, notification_key_name: String, ) -> OperationResult<FCMDeviceGroup, GetKeyError>
Use this client to request the notification key for a given name
Trait Implementations§
Source§impl Clone for FCMDeviceGroupClient
impl Clone for FCMDeviceGroupClient
Source§fn clone(&self) -> FCMDeviceGroupClient
fn clone(&self) -> FCMDeviceGroupClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FCMDeviceGroupClient
impl !RefUnwindSafe for FCMDeviceGroupClient
impl Send for FCMDeviceGroupClient
impl Sync for FCMDeviceGroupClient
impl Unpin for FCMDeviceGroupClient
impl !UnwindSafe for FCMDeviceGroupClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more