cronofy 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c592a6641e20c6bccbe1fe2a4af85f1cff4bcbe8a223436181e7f82a8ab7406
4
- data.tar.gz: b008a137e2c008fcd10fc9edf83871c99a9f5b2b630ade62d39c5511e0407721
3
+ metadata.gz: 78e9782a7bdba695815ed3931c13185e37fa84d20f450e922ebd906eb4ba74e0
4
+ data.tar.gz: 5b43ef1fb59f670be1c8b59316b2b837d56ab9eb94f165c8b7764047d945780b
5
5
  SHA512:
6
- metadata.gz: 53e4116e1763cc0795d270fa405d7cadb0cda41641f6edb3c8f62a20605053206c4ccfd088e5c93161f5bfeb5f07c0489b1de76ebc27105e62b181b6b399a81b
7
- data.tar.gz: 35b950179483552856421bd5c967728a6e443cc11b6333f9eceea7e8ceff8ce06bf143573f552a4cd882faa94dcb0223adad123caee10beed60bbaac5ddaef16
6
+ metadata.gz: 159294f3efa6c0ff5ce443e1610a532d2e4ede0758589a1b38abddd134b0e7f88ad63525f471dd0d6f002966b111503ce14b00d67ceca487f58b6bab3534d06c
7
+ data.tar.gz: 040d8238dd7a35ea6810279da80453f45efcad258459bf49c68b959f5c54ee07816e8e437b82c040e1b3fa29a0a74a75e8b3919a0bee6e68a2ffa8c1733b08d1
@@ -1,3 +1,7 @@
1
+ ## [0.34.0]
2
+
3
+ * Support removing a participant from a Smart Invite [#75]
4
+
1
5
  ## [0.33.0]
2
6
 
3
7
  * Support listing Availability Rules [#74]
@@ -152,6 +156,7 @@
152
156
  [0.31.2]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.31.2
153
157
  [0.32.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.32.0
154
158
  [0.33.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.33.0
159
+ [0.34.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.34.0
155
160
 
156
161
  [#13]: https://github.com/cronofy/cronofy-ruby/pull/13
157
162
  [#16]: https://github.com/cronofy/cronofy-ruby/pull/16
@@ -189,3 +194,4 @@
189
194
  [#72]: https://github.com/cronofy/cronofy-ruby/pull/72
190
195
  [#73]: https://github.com/cronofy/cronofy-ruby/pull/73
191
196
  [#74]: https://github.com/cronofy/cronofy-ruby/pull/74
197
+ [#75]: https://github.com/cronofy/cronofy-ruby/pull/75
@@ -1323,6 +1323,32 @@ module Cronofy
1323
1323
  parse_json(SmartInviteResponse, nil, response)
1324
1324
  end
1325
1325
 
1326
+ # Public: Removes an individual recipient from a multiple recipient smart invite
1327
+ #
1328
+ # smart_invite_id - A String uniquely identifying the event for your
1329
+ # application (note: this is NOT an ID generated
1330
+ # by Cronofy).
1331
+ #
1332
+ # recipient - A Hash containing the recipient to be removed
1333
+ # :email - A String for the email address of
1334
+ # the recipient to remove.
1335
+ #
1336
+ # See https://docs.cronofy.com/developers/api-alpha/smart-invites/multiple-recipients/#remove-invite-recipient
1337
+ # for reference.
1338
+ #
1339
+ # Returns a SmartInviteResponse
1340
+ #
1341
+ # Raises Cronofy::CredentialsMissingError if no credentials available.
1342
+ # Raises Cronofy::InvalidRequestError if the request contains invalid
1343
+ # parameters.
1344
+ # Raises Cronofy::TooManyRequestsError if the request exceeds the rate
1345
+ # limits for the application.
1346
+ def remove_recipient_smart_invite(body={})
1347
+ body[:method] = 'remove'
1348
+ response = wrapped_request { api_key!.post("/v1/smart_invites", json_request_args(body)) }
1349
+ parse_json(SmartInviteResponse, nil, response)
1350
+ end
1351
+
1326
1352
  # Public: Gets the details for a smart invite.
1327
1353
  #
1328
1354
  # smart_invite_id - A String uniquely identifying the event for your
@@ -1,3 +1,3 @@
1
1
  module Cronofy
2
- VERSION = "0.33.0".freeze
2
+ VERSION = "0.34.0".freeze
3
3
  end
@@ -2630,6 +2630,67 @@ describe Cronofy::Client do
2630
2630
 
2631
2631
  end
2632
2632
 
2633
+ describe "Remove Recipient Smart Invite", test: true do
2634
+ let(:request_url) { "https://api.cronofy.com/v1/smart_invites" }
2635
+ let(:method) { :post }
2636
+
2637
+ let(:request_headers) do
2638
+ {
2639
+ "Authorization" => "Bearer #{client_secret}",
2640
+ "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}",
2641
+ "Content-Type" => "application/json; charset=utf-8",
2642
+ }
2643
+ end
2644
+
2645
+ let(:client_id) { 'example_id' }
2646
+ let(:client_secret) { 'example_secret' }
2647
+
2648
+ let(:client) do
2649
+ Cronofy::Client.new(
2650
+ client_id: client_id,
2651
+ client_secret: client_secret,
2652
+ )
2653
+ end
2654
+
2655
+ let(:args) do
2656
+ {
2657
+ smart_invite_id: "qTtZdczOccgaPncGJaCiLg",
2658
+ recipient: {
2659
+ email: "example@example.com"
2660
+ }
2661
+ }
2662
+ end
2663
+
2664
+ let(:request_body) do
2665
+ {
2666
+ method: 'remove',
2667
+ smart_invite_id: "qTtZdczOccgaPncGJaCiLg",
2668
+ recipient: {
2669
+ email: "example@example.com"
2670
+ }
2671
+ }
2672
+ end
2673
+ let(:correct_response_code) { 202 }
2674
+ let(:correct_response_body) do
2675
+ request_body.merge({
2676
+ attachments: {
2677
+ removed: {
2678
+ email: "example@example.com"
2679
+ }
2680
+ }
2681
+ })
2682
+ end
2683
+
2684
+ let(:correct_mapped_result) do
2685
+ Cronofy::SmartInviteResponse.new(correct_response_body)
2686
+ end
2687
+
2688
+ subject { client.remove_recipient_smart_invite(request_body) }
2689
+
2690
+ it_behaves_like 'a Cronofy request'
2691
+ it_behaves_like 'a Cronofy request with mapped return value'
2692
+ end
2693
+
2633
2694
  describe "Batch requests" do
2634
2695
  context "upserting an event" do
2635
2696
  let(:calendar_id) { 'calendar_id_123'}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Paryzhskyi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-09 00:00:00.000000000 Z
12
+ date: 2019-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2