Class: SupportOps::Calendly::Groups
- Defined in:
- lib/support_ops_calendly/calendly/groups.rb
Overview
Defines the module Groups within the module SupportOps::Calendly.
Instance Attribute Summary collapse
-
#created_at ⇒ String
The moment when the Group record was created.
-
#member_count ⇒ Integer
The number of members in a group.
-
#name ⇒ String
The Group name (in human-readable format).
-
#organization ⇒ String
A unique reference to the associated Organization object.
-
#updated_at ⇒ String
The moment when the Group record was last updated.
-
#uri ⇒ String
Canonical reference (unique identifier) for the Group resource.
Class Method Summary collapse
-
.get(object) ⇒ Object
Get a specified Webhook Subscription.
-
.get!(object) ⇒ Object
Get a specified Webhook Subscription.
-
.list(key: value) ⇒ Object
Returns a list of groups.
Instance Method Summary collapse
-
#uuid ⇒ String
Returns the UUID of a group.
Methods inherited from Base
attributes, client, #client=, configure, define_attributes, #delete!, #find, #find!, #initialize, #members, readonly_attributes, #save!, #store_original_attributes
Constructor Details
This class inherits a constructor from SupportOps::Calendly::Base
Instance Attribute Details
#created_at ⇒ String
The moment when the Group record was created
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def created_at @created_at end |
#member_count ⇒ Integer
The number of members in a group
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def member_count @member_count end |
#name ⇒ String
The Group name (in human-readable format)
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def name @name end |
#organization ⇒ String
A unique reference to the associated Organization object
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def organization @organization end |
#updated_at ⇒ String
The moment when the Group record was last updated
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def updated_at @updated_at end |
#uri ⇒ String
Canonical reference (unique identifier) for the Group resource
18 19 20 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 18 def uri @uri end |
Class Method Details
.get(object) ⇒ Object
Get a specified Webhook Subscription
105 106 107 108 109 110 111 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 105 def self.get(object) if object.is_a? Groups Groups.new(uri: uri).find else Groups.new(uri: object).find end end |
.get!(object) ⇒ Object
Get a specified Webhook Subscription
131 132 133 134 135 136 137 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 131 def self.get!(object) if object.is_a? Groups Groups.new(uri: uri).find! else Groups.new(uri: object).find! end end |
.list(key: value) ⇒ Object
Returns a list of groups
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 67 def self.list(**args) args[:organization] = nil unless args[:organization] raise 'You must provide an organization URI' if args[:organization].nil? array = [] data = { count: 100, organization: args[:organization] } loop do response = client.connection.get('groups', data) body = Oj.load(response.body) array += body['collection'].map { |g| Groups.new(g) } break if body['pagination']['next_page_token'].nil? data['page_token'] = body['pagination']['next_page_token'] end array end |
Instance Method Details
#uuid ⇒ String
This is inherited from Base#uuid
Returns the UUID of a group
17 |
# File 'lib/support_ops_calendly/calendly/groups.rb', line 17 def uuid; end |