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 16, 2023
1 parent 55f397d commit 5838457
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions textile/features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ h3(#restclient). RestClient
* @(RSC22)@ @RestClient#batchPublish@ function:
** @(RSC22a)@ 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".
** @(RSC22b)@ Returns an array of @BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>@s. Optionally, in languages where this is idiomatic, an overload may be implemented whereby the method can be called with a single @BatchPublishSpec@ and return a single @BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>@. This is not a feature of the REST API, whose response will still be an array, so if implementing this overload, the SDK will have to extract the element from the 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<BatchPresenceSuccessResult | BatchPresenceFailureResult>@ object.

h3(#rest-auth). Auth

Expand Down Expand Up @@ -1531,6 +1532,20 @@ h4. BatchPublishFailureResult
** @(BPF2a)@ @channel@ string - the name of the channel
** @(BPF2b)@ @error@ @ErrorInfo@ - an @ErrorInfo@ indicating the reason the message(s) failed to publish

h4. BatchPresenceSuccessResult

* @(BGR1)@ Contains information about the result of a successful batch presence request for a single channel
* @(BGR2)@ The attributes of @BatchPresenceSuccessResult@ consist of:
** @(BGR2a)@ @channel@ string - the name of the channel
** @(BGR2b)@ @presence@ @PresenceMessage[]@ - an array containing all members present on the channel if the request succeeded

h4. BatchPresenceFailureResult

* @(BGF1)@ Contains information about the result of an unsuccessful batch presence request for a single channel
* @(BGF2)@ The attributes of @BatchPresenceFailureResult@ consist of:
** @(BGF2a)@ @channel@ string - the name of the channel
** @(BGF2b)@ @error@ @ErrorInfo@ - @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 @@ -1748,6 +1763,7 @@ class RestClient: // RSC*
time() => io Time // RSC16
batchPublish(BatchPublishSpec) => io BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult> // RSC22
batchPublish(BatchPublishSpec[]) => io BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>[] // RSC22
batchPresence(string[]) => io BatchResult<BatchPresenceSuccessResult | BatchPresenceFailureResult>[] // RSC23

class RealtimeClient: // RTC*
constructor(keyOrTokenStr: String) // RTC12
Expand Down Expand Up @@ -1777,6 +1793,7 @@ class RealtimeClient: // RTC*
time() => io Time // RTC6
batchPublish(BatchPublishSpec) => io BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult> // RSC22
batchPublish(BatchPublishSpec[]) => io BatchResult<BatchPublishSuccessResult | BatchPublishFailureResult>[] // RSC22
batchPresence(string[]) => io BatchResult<BatchPresenceSuccessResult | BatchPresenceFailureResult>[] // RSC23

class ClientOptions: // TO*
embeds AuthOptions // This is not currently documented in the spec and needs to be – see https://github.com/ably/docs/issues/1476
Expand Down Expand Up @@ -2380,6 +2397,14 @@ class BatchPublishSuccessResult:
class BatchPublishFailureResult:
channel: string // BPF2a
error: ErrorInfo // BPF2c

class BatchPresenceSuccessResult:
channel: string // BGR2a
presence?: [PresenceMessage] // BGR2b

class BatchPresenceFailureResult
channel: string // BGF2a
error?: ErrorInfo // BGF2b
</pre>

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

0 comments on commit 5838457

Please sign in to comment.