-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ekohe/feature/single_event_request_and_sub…
…scription_support FEATURE #3335 single event request and subscription support
- Loading branch information
Showing
13 changed files
with
337 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.bundle/ | ||
/.idea/ | ||
/.yardoc | ||
/_yardoc/ | ||
/coverage/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
module Office365 | ||
module Models | ||
class Subscription < Base | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module Office365 | ||
module REST | ||
module Subscription | ||
def create_subscription(args = {}) | ||
raise ArgumentError, "Missing changeType" if args[:changeType].nil? | ||
raise ArgumentError, "Missing notificationUrl" if args[:notificationUrl].nil? | ||
raise ArgumentError, "Missing resource" if args[:resource].nil? | ||
raise ArgumentError, "Missing expirationDateTime" if args[:expirationDateTime].nil? | ||
raise ArgumentError, "Missing clientState" if args[:clientState].nil? | ||
|
||
Models::Subscription.new( | ||
Request.new(access_token, debug: debug).post("/v1.0/subscriptions", { json_header: true }.merge(args)) | ||
) | ||
end | ||
|
||
def renew_subscription(args = {}) | ||
raise ArgumentError, "Missing subscription identifier" if args[:identifier].nil? | ||
|
||
identifier = args.delete(:identifier) | ||
|
||
Models::Subscription.new( | ||
Request.new(access_token, debug: debug).patch("/v1.0/subscriptions/#{identifier}", { json_header: true }.merge(args)) | ||
) | ||
end | ||
end | ||
end | ||
end |
49 changes: 49 additions & 0 deletions
49
spec/fixtures/vcr_cassettes/office365_create_subscription.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
spec/fixtures/vcr_cassettes/office365_renew_subscription.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.