calendly 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/calendly/client.rb +33 -2
- data/lib/calendly/models/event_type.rb +19 -0
- data/lib/calendly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987260a701999245159a34a38b587e873a80272a3391b5909339c7b6cd01994a
|
4
|
+
data.tar.gz: bb1b11aba44dcfca555b97887611cc989921a972263ea071e1ec144cac7d2bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62d40c515e6833f34ef591b8b2a2a8089970951f6eae3fb68190388de58919a67c16851426f11c0c7c2b06bbc89f9de5248223ed2bd0d4b45fe45c11c0e232d7
|
7
|
+
data.tar.gz: 58136d311993b7b3a1e352888eba6756c7235476078934f2b8e893f06a29af33e36cefd3bdb751d8540948953c1cfdd145c1e160779cad2d3c554eff3f1ccc31
|
data/CHANGELOG.md
CHANGED
data/lib/calendly/client.rb
CHANGED
@@ -512,7 +512,7 @@ module Calendly
|
|
512
512
|
else
|
513
513
|
params[:scope] = 'organization'
|
514
514
|
end
|
515
|
-
body = request
|
515
|
+
body = request :post, 'webhook_subscriptions', body: params
|
516
516
|
WebhookSubscription.new body[:resource], self
|
517
517
|
end
|
518
518
|
|
@@ -530,11 +530,42 @@ module Calendly
|
|
530
530
|
true
|
531
531
|
end
|
532
532
|
|
533
|
+
#
|
534
|
+
# Create a scheduling link.
|
535
|
+
#
|
536
|
+
# @param [String] uri A link to the resource that owns this scheduling Link.
|
537
|
+
# @param [String] max_event_count The max number of events that can be scheduled using this scheduling link.
|
538
|
+
# @param [String] resource_type Resource type.
|
539
|
+
# @return [Hash]
|
540
|
+
# e.g.
|
541
|
+
# {
|
542
|
+
# booking_url: "https://calendly.com/s/FOO-BAR-SLUG",
|
543
|
+
# owner: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2",
|
544
|
+
# owner_type: "EventType"
|
545
|
+
# }
|
546
|
+
# @raise [Calendly::Error] if the uri arg is empty.
|
547
|
+
# @raise [Calendly::Error] if the max_event_count arg is empty.
|
548
|
+
# @raise [Calendly::Error] if the resource_type arg is empty.
|
549
|
+
# @raise [Calendly::ApiError] if the api returns error code.
|
550
|
+
# @since 0.5.2
|
551
|
+
def create_schedule_link(uri, max_event_count = 1, resource_type: 'EventType')
|
552
|
+
check_not_empty uri, 'uri'
|
553
|
+
check_not_empty max_event_count, 'max_event_count'
|
554
|
+
check_not_empty resource_type, 'resource_type'
|
555
|
+
params = {
|
556
|
+
max_event_count: max_event_count,
|
557
|
+
owner: uri,
|
558
|
+
owner_type: resource_type
|
559
|
+
}
|
560
|
+
body = request :post, 'scheduling_links', body: params
|
561
|
+
body[:resource]
|
562
|
+
end
|
563
|
+
|
533
564
|
private
|
534
565
|
|
535
566
|
def request(method, path, params: nil, body: nil)
|
536
567
|
debug_log "Request #{method.to_s.upcase} #{API_HOST}/#{path} params:#{params}, body:#{body}"
|
537
|
-
res = access_token.request
|
568
|
+
res = access_token.request method, path, params: params, body: body
|
538
569
|
debug_log "Response status:#{res.status}, body:#{res.body}"
|
539
570
|
parse_as_json res
|
540
571
|
rescue OAuth2::Error => e
|
@@ -86,6 +86,25 @@ module Calendly
|
|
86
86
|
client.event_type uuid
|
87
87
|
end
|
88
88
|
|
89
|
+
#
|
90
|
+
# Create an associated scheduling link.
|
91
|
+
#
|
92
|
+
# @param [String] max_event_count The max number of events that can be scheduled using this scheduling link.
|
93
|
+
# @return [Hash]
|
94
|
+
# e.g.
|
95
|
+
# {
|
96
|
+
# booking_url: "https://calendly.com/s/FOO-BAR-SLUG",
|
97
|
+
# owner: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2",
|
98
|
+
# owner_type: "EventType"
|
99
|
+
# }
|
100
|
+
# @raise [Calendly::Error] if the uri is empty.
|
101
|
+
# @raise [Calendly::Error] if the max_event_count arg is empty.
|
102
|
+
# @raise [Calendly::ApiError] if the api returns error code.
|
103
|
+
# @since 0.5.2
|
104
|
+
def create_schedule_link(max_event_count = 1)
|
105
|
+
client.create_schedule_link uri, max_event_count, resource_type: 'EventType'
|
106
|
+
end
|
107
|
+
|
89
108
|
private
|
90
109
|
|
91
110
|
def after_set_attributes(attrs)
|
data/lib/calendly/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenji Koshikawa
|
@@ -154,7 +154,7 @@ metadata:
|
|
154
154
|
homepage_uri: https://github.com/koshilife/calendly-api-ruby-client
|
155
155
|
source_code_uri: https://github.com/koshilife/calendly-api-ruby-client
|
156
156
|
changelog_uri: https://github.com/koshilife/calendly-api-ruby-client/blob/master/CHANGELOG.md
|
157
|
-
documentation_uri: https://www.rubydoc.info/gems/calendly/0.5.
|
157
|
+
documentation_uri: https://www.rubydoc.info/gems/calendly/0.5.2
|
158
158
|
post_install_message:
|
159
159
|
rdoc_options: []
|
160
160
|
require_paths:
|