Class: CirroIOV2::Resources::User

Inherits:
Base
  • Object
show all
Defined in:
lib/cirro_io_v2/resources/user.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize, #resource_root

Constructor Details

This class inherits a constructor from CirroIOV2::Resources::Base

Instance Method Details

#create(params = nil) ⇒ Object



4
5
6
7
# File 'lib/cirro_io_v2/resources/user.rb', line 4

def create(params = nil)
  response = client.request_client.request(:post, resource_root, body: params)
  CirroIOV2::Responses::UserResponse.new(response.body)
end

#find(id) ⇒ Object



9
10
11
12
# File 'lib/cirro_io_v2/resources/user.rb', line 9

def find(id)
  response = client.request_client.request(:get, "#{resource_root}/#{id}")
  CirroIOV2::Responses::UserResponse.new(response.body)
end

#invitation_attempt(id, params) ⇒ Object



29
30
31
32
# File 'lib/cirro_io_v2/resources/user.rb', line 29

def invitation_attempt(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/invitation_attempt", body: params)
  CirroIOV2::Responses::UserInvitationAttemptResponse.new(response.body)
end

#notification_preference(id) ⇒ Object



14
15
16
17
# File 'lib/cirro_io_v2/resources/user.rb', line 14

def notification_preference(id)
  response = client.request_client.request(:get, "#{resource_root}/#{id}/notification_preference")
  CirroIOV2::Responses::UserNotificationPreferenceResponse.new(response.body)
end

#notification_preferences(id, params) ⇒ Object



19
20
21
22
# File 'lib/cirro_io_v2/resources/user.rb', line 19

def notification_preferences(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/notification_preferences", body: params)
  CirroIOV2::Responses::UserNotificationPreferenceResponse.new(response.body)
end

#worker(id, params) ⇒ Object



24
25
26
27
# File 'lib/cirro_io_v2/resources/user.rb', line 24

def worker(id, params)
  response = client.request_client.request(:post, "#{resource_root}/#{id}/worker", body: params)
  CirroIOV2::Responses::UserResponse.new(response.body)
end