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,
bearer_auth: &str,
) -> Result<Self, FCMDeviceGroupClientCreationError>
pub fn new( sender_id: &str, bearer_auth: &str, ) -> 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,
bearer_auth: &str,
) -> Result<Self, FCMDeviceGroupClientCreationError>
pub fn with_url( url: impl IntoUrl, sender_id: &str, bearer_auth: &str, ) -> 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) -> Self
pub fn with_client(client: HttpClient, url: impl IntoUrl) -> 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