mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Simplify types for Subscription API #105

Closed mtesseract closed 6 years ago

mtesseract commented 6 years ago

closes https://github.com/mtesseract/nakadi-client/issues/103

Introduces a new type SubscriptionRequest. This simplifies the type Subscription, most importantly the Subscription ID becomes mandatory.

Also, I have simplified (for the user) the handling of the subscription position in these datatypes. In JSON the subcription position is given by two distinct object fields: read_from and cursors. On the sid of the Haskell API this is now merged in a new ADT SubscriptionPosition. This is a much better modelling of the Nakadi API in my opinion.

Again, because of brittany there is quite some reformatting noise. I did not find a way to temporarily (or on a file-basis) deactivate it. :-( But I will comment on the PR in order to highlight real changes as opposed to reformatting noise.