Skip to content

Commit

Permalink
Merge pull request #47 from koshilife/#28_support_delete_invitee_data
Browse files Browse the repository at this point in the history
support POST /data_compliance/deletion/invitees
  • Loading branch information
koshilife committed Apr 15, 2022
2 parents 42678a0 + 5134af5 commit d888437
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## 0.10.0 - 2022-04-15

- supported a API `POST /data_compliance/deletion/invitees`. (#28)
- changed files:
- Client
- (Add method) delete_invitee_data

## 0.9.0 - 2022-04-14

- supported no show APIs. (#45)
Expand All @@ -16,7 +23,7 @@
- (Add method) mark_no_show
- (Add method) unmark_no_show
- (New) InviteeNoShow model
- To simplify `require` statements changed `Model::ASSOCIATION` constant to class methods and removed unused lines.
- To simplify `require` statements, changed `Model::ASSOCIATION` constant to class methods and removed unused lines.

## 0.8.3 - 2022-03-08

Expand Down
19 changes: 19 additions & 0 deletions lib/calendly/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,25 @@ def delete_invitee_no_show(uuid)
true
end

#
# Delete Invitee Data
# To submit a request to remove invitee data from all previously booked events in your organization.
#
# @param [Array<String>] emails invitees' emails
# @return [true]
# @raise [Calendly::Error] if the emails arg is empty.
# @raise [Calendly::ApiError] if the api returns error code.
# @since 0.10.0
def delete_invitee_data(emails)
check_not_empty emails, 'emails'
request(
:post,
'data_compliance/deletion/invitees',
body: {emails: emails}
)
true
end

#
# Returns information about a user's organization membership
#
Expand Down
2 changes: 1 addition & 1 deletion lib/calendly/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Calendly
VERSION = '0.9.0'
VERSION = '0.10.0'
end
23 changes: 23 additions & 0 deletions test/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,29 @@ def test_that_it_raises_an_argument_error_on_delete_invitee_no_show
assert_required_error proc_arg_is_empty, 'uuid'
end

#
# test for delete_invitee_data
#

def test_that_it_deletes_invitee_data
invitee_emails = ['foo@example.com', 'bar@example.com']
req_body = {emails: invitee_emails}
res_body = '{}'

url = "#{HOST}/data_compliance/deletion/invitees"
add_stub_request :post, url, req_body: req_body, res_body: res_body, res_status: 202

result = @client.delete_invitee_data invitee_emails
assert_equal true, result
end

def test_that_it_raises_an_argument_error_on_delete_invitee_data
proc_arg_is_empty = proc do
@client.delete_invitee_data []
end
assert_required_error proc_arg_is_empty, 'emails'
end

#
# test for membership
#
Expand Down

0 comments on commit d888437

Please sign in to comment.