Skip to content

Commit

Permalink
feat: add RestClient#batchPresence specs
Browse files Browse the repository at this point in the history
  • Loading branch information
owenpearson committed May 2, 2023
1 parent 212483b commit c63714c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions textile/features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ h3(#restclient). RestClient
** @(RSC20e)@ Failures to log exceptions to the @errors.ably.io@ endpoint must be handled gracefully. This includes for example DNS failures, TCP/HTTP requests rejected, slow requests and internal failure errors. Additionally, as specified in @RSC20b2@, a failure to log an exception is logged with log level @info@ i.e. an exception reporting failure is not consider a client library @error@ or @warning@
** @(RSC20f)@ Any errors emitted by the library as a result of an internal failure must contain a status code @500@, an error code in the range @51000@ to @51999@ and a suitable error message. The error code must match one of "our common error codes":https://github.com/ably/ably-common/blob/main/protocol/errors.json
* @(RSC22)@ @RestClient#batchPublish@ function takes a @BatchPublishSpec@ or an array of @BatchPublishSpec@s and sends then in a POST request to @/messages@ with the @newBatchResponse@ query param set to "true". When called with an array of @BatchPublishSpec@s it should return an array of @BatchResult<BatchPublishResult>@s. When called with a single @BatchPublishSpec@, the REST response will be an array containing a single @BatchResult<BatchPublishResult>@ which should be returned without the enclosing array.
* @(RSC23)@ @RestClient#batchPresence@ function takes an array of channel name strings and sends them as a comma separated string in the @channels@ query parameter in a GET request to @/presence@ with the @newBatchResponse@ query param set to "true", returning a @BatchResult<BatchPresenceResult>@ object.

h3(#rest-auth). Auth

Expand Down Expand Up @@ -1523,6 +1524,14 @@ h4. BatchPublishResult
** @(BPR2b)@ @messageId@ string - an optional string containing the @messageId@ prefix for the published message(s), if successful
** @(BPR2c)@ @error@ @ErrorInfo@ - an optional @ErrorInfo@ indicating the reason the message(s) failed to publish, if unsuccessful

h4. BatchPresenceResult

* @(BGR1)@ Contains information about the result of a batch presence request for a single channel
* @(BGR2)@ The attributes of @BatchPublishChannelResult@ consist of:
** @(BGR2a)@ @channel@ string - the name of the channel
** @(BGR2b)@ @presence@ @PresenceMessage[]@ - an optional array containing all members present on the channel if the request succeeded
** @(BGR2c)@ @error@ @ErrorInfo@ - an optional @ErrorInfo@ indicating the reason the presence request failed for the given channel, if unsuccessful

h4. MessageFilter
* @(MFI1)@ Supplies filter options to subscribe as defined in #RTL22
* @(MFI2)@ Contains the following attributes:
Expand Down Expand Up @@ -1740,6 +1749,7 @@ class RestClient: // RSC*
time() => io Time // RSC16
batchPublish(BatchPublishSpec) => io BatchResult<BatchPublishResult> // RSC22
batchPublish(BatchPublishSpec[]) => io BatchResult<BatchPublishResult>[] // RSC22
batchPresence(string[]) => io BatchResult<BatchPresenceResult> // RSC23

class RealtimeClient: // RTC*
constructor(keyOrTokenStr: String) // RTC12
Expand Down Expand Up @@ -2367,6 +2377,11 @@ class BatchPublishResult:
channel: string // BPR2a
messageId?: string // BPR2b
error?: ErrorInfo // BPR2c

class BatchPresenceResult:
channel: string // BGR2a
presence?: [PresenceMessage] // BGR2b
error?: ErrorInfo // BGR2c
</pre>

h2(#old-specs). Old specs
Expand Down

0 comments on commit c63714c

Please sign in to comment.