fcm-client-0.1.0.0: Admin API for Firebase Cloud Messaging

Safe HaskellNone
LanguageHaskell2010

FCMClient.Types

Description

Google Firebase Cloud Messaging model / JSON conversions. https://firebase.google.com/docs/cloud-messaging/http-server-ref

This module re-exports JSON types with a few convenience wrappers around selected fields.

Synopsis

Documentation

data FCMLocValue Source #

Instances
Eq FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

Ord FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

Read FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

Show FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

IsString FCMLocValue Source #

Shortcut for string localized parameters

Instance details

Defined in FCMClient.Types

ToJSON FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

FromJSON FCMLocValue Source # 
Instance details

Defined in FCMClient.Types

fcmBodyLocArgs :: Applicative f => ([FCMLocValue] -> f [FCMLocValue]) -> FCMNotification -> f FCMNotification Source #

Typed lens focused on localized notification body arguments.

fcmTitleLocArgs :: Applicative f => ([FCMLocValue] -> f [FCMLocValue]) -> FCMNotification -> f FCMNotification Source #

Typed lens focused on localized notification title arguments.

data FCMMessage Source #

FCM Message as defined in https://firebase.google.com/docs/cloud-messaging/http-server-ref#send-downstream Abstract type, use lens API to access fields. Record fields are kept private and used for JSON conversion.

fcmPriority :: Applicative f => (FCMPriority -> f FCMPriority) -> FCMMessage -> f FCMMessage Source #

Typed lens focused on message priority.

fcmContentAvailable :: Applicative f => (Bool -> f Bool) -> FCMMessage -> f FCMMessage Source #

Sets content available field when True, sets Nothing when False.

fcmDelayWhileIdle :: Applicative f => (Bool -> f Bool) -> FCMMessage -> f FCMMessage Source #

Sets delay while idle field when True, sets Nothing when False.

fcmDryRun :: Applicative f => (Bool -> f Bool) -> FCMMessage -> f FCMMessage Source #

Sets dry run field when True, sets Nothing when False.

fcmWithNotification :: Applicative f => (FCMNotification -> f FCMNotification) -> FCMMessage -> f FCMMessage Source #

Creates default empty notification if missing

data FCMResult Source #

Result of an RPC call.

Successful response doesn't imply all the messages were delivered, e.g. some may need to be re-sent if a rate limit was exceeded.

Error cases enumerate all, client and server error conditions.

Constructors

FCMResultSuccess !FCMResponseBody

Successful response (http 200). Doesn't imply all the messages were delivered, response body may contain error codes.

FCMResultError !FCMClientError

Didn't receive JSON response, there were an error of some kind.

Instances
Show FCMResult Source # 
Instance details

Defined in FCMClient.JSON.Types

data FCMClientError Source #

Types of FCM errors.

Constructors

FCMErrorResponseInvalidJSON !Text

Indicates that the request could not be parsed as JSON, or it contained invalid fields (for instance, passing a string where a number was expected). The exact failure reason is described in the response and the problem should be addressed before the request can be retried.

FCMErrorResponseInvalidAuth

There was an error authenticating the sender account.

FCMServerError !Status !Text

Errors in the 500-599 range (such as 500 or 503) indicate that there was an internal error in the FCM connection server while trying to process the request, or that the server is temporarily unavailable (for example, because of timeouts). Sender must retry later, honoring any Retry-After header included in the response. Application servers must implement exponential back-off.

FCMClientJSONError !Text

Client couldn't parse JSON response from server.

FCMClientHTTPError !Text

Unexpected HTTP response or some other HTTP error.