Class: Readiness::Calendly::Users
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
#initialize(object = {}) ⇒ Users
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/support_readiness/calendly/users.rb', line 24
def initialize(object = {})
@avatar_url = object['avatar_url']
@created_at = object['created_at']
@current_organization = object['current_organization']
@email = object['email']
@name = object['name']
@resource_type = object['resource_type']
@scheduling_url = object['scheduling_url']
@slug = object['slug']
@timezone = object['timezone']
@updated_at = object['updated_at']
@uri = object['uri']
end
|
Instance Attribute Details
#avatar_url ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def avatar_url
@avatar_url
end
|
#created_at ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def created_at
@created_at
end
|
#current_organization ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def current_organization
@current_organization
end
|
#email ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def email
@email
end
|
#name ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def name
@name
end
|
#resource_type ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def resource_type
@resource_type
end
|
#scheduling_url ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def scheduling_url
@scheduling_url
end
|
#slug ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def slug
@slug
end
|
#timezone ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def timezone
@timezone
end
|
#updated_at ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def updated_at
@updated_at
end
|
#uri ⇒ Object
13
14
15
|
# File 'lib/support_readiness/calendly/users.rb', line 13
def uri
@uri
end
|
Class Method Details
.current(client) ⇒ Object
Gets information on the current user
52
53
54
55
56
|
# File 'lib/support_readiness/calendly/users.rb', line 52
def self.current(client)
response = client.connection.get 'users/me'
handle_request_error(0, 'Calendly', response.status) unless response.status == 200
Users.new(Oj.load(response.body)['resource'])
end
|
.find(client, uid) ⇒ Object
Locates an user within Calendly. This will not exit on error (except Authentication errors)
75
76
77
78
79
|
# File 'lib/support_readiness/calendly/users.rb', line 75
def self.find(client, uid)
response = client.connection.get "users/#{uid}"
handle_request_error(0, 'Calendly', response.status, { action: 'get', id: uid }) unless response.status == 200
Users.new(Oj.load(response.body)['resource'])
end
|
.find!(client, uid) ⇒ Object
Locates an user within Calendly. This will exit on error
98
99
100
101
102
|
# File 'lib/support_readiness/calendly/users.rb', line 98
def self.find!(client, uid)
response = client.connection.get "users/#{uid}"
handle_request_error(1, 'Calendly', response.status, { action: 'Find user', id: uid }) unless response.status == 200
Users.new(Oj.load(response.body)['resource'])
end
|