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

Safe HaskellNone
LanguageHaskell2010

FCMClient.JSON.Types

Description

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

Data types in this module map field for field in the google docs. See FCMClient.Types module for some wrapper functions on top of raw JSON types.

Synopsis

Documentation

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.

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.