Class: Readiness::Calendly::OrganizationMemberships
Overview
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
auth_error, bad_request_error, convert_actions, convert_conditions, convert_standard_names_to_ids, convert_ticket_form_agent_conditions, convert_ticket_form_brands, convert_ticket_form_end_user_conditions, convert_ticket_form_names_to_ids, convert_view_names_to_ids, convert_view_restrictions, covert_ticket_form_field_ids, create_package!, erb_renderer, handle_request_error, not_found_error, not_processible_error, put_into_archive, recursively_deflate_directory, timestamp_filename, to_clean_json, to_clean_json_with_key, to_hash, to_nearly_clean_json, to_nearly_clean_json_with_key, to_param_string, write_entries
Constructor Details
24
25
26
27
28
29
30
31
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 24
def initialize(object = {})
@created_at = object['created_at']
@organization = object['organization']
@role = object['role']
@updated_at = object['updated_at']
@uri = object['uri']
@user = (object['user'].nil? ? Users.new : Users.new(object['user']))
end
|
Instance Attribute Details
#created_at ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def created_at
@created_at
end
|
#organization ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def organization
@organization
end
|
#role ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def role
@role
end
|
#updated_at ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def updated_at
@updated_at
end
|
#uri ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def uri
@uri
end
|
#user ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 13
def user
@user
end
|
Class Method Details
.list(client, organization) ⇒ Array
Provides a list of organization memberships.
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/support_readiness/calendly/organization_memberships.rb', line 51
def self.list(client, organization)
members = []
opts = { organization: organization.uri, count: 100 }
loop do
response = client.connection.get "organization_memberships", opts
handle_request_error(0, 'Calendly', response.status, { action: 'get', id: organization.uri.split('/').last }) unless response.status == 200
body = Oj.load(response.body)
members += body['collection'].map { |c| OrganizationMemberships.new(c) }
break if body['pagination']['next_page_token'].nil?
opts = { organization: organization.uri, count: 100, page_token: body['pagination']['next_page_token'] }
end
members
end
|