Module: Connect::WebService::Rest

Includes:
ConnectParameters::ParamsFactory, Request
Included in:
Client
Defined in:
lib/connect/web_service/rest.rb

Instance Method Summary collapse

Methods included from ConnectParameters::ParamsFactory

#create_changed_from, #create_date, #create_date_time, #create_parameter, #create_string

Methods included from Request

#call

Instance Method Details

#add_param(params, param) ⇒ Object



77
78
79
# File 'lib/connect/web_service/rest.rb', line 77

def add_param(params, param)
  params << param if param.required || param.value.content
end

#client_user_read(options = {}) ⇒ Object



59
60
61
62
63
64
# File 'lib/connect/web_service/rest.rb', line 59

def client_user_read(options = {})
  params = []
  add_param(params, create_changed_from(options))
  add_param(params, create_string(name: 'ClientID', content: options[:client_id]))
  call(self, method: :client_user_read, params: params)
end

#department_add(options) ⇒ Object



19
20
21
22
23
# File 'lib/connect/web_service/rest.rb', line 19

def department_add(options)
  params = []
  add_param(params, create_string(name: 'Name', content: options[:name], required: true))
  call(self, method: :department_add, params: params)
end

#department_delete(options) ⇒ Object



32
33
34
35
36
# File 'lib/connect/web_service/rest.rb', line 32

def department_delete(options)
  params = []
  add_param(params, create_string(name: 'DepartmentID', content: options[:department_id], required: true))
  call(self, method: :department_delete, params: params)
end

#department_edit(options) ⇒ Object



25
26
27
28
29
30
# File 'lib/connect/web_service/rest.rb', line 25

def department_edit(options)
  params = []
  add_param(params, create_string(name: 'DepartmentID', content: options[:department_id], required: true))
  add_param(params, create_string(name: 'Name', content: options[:name]))
  call(self, method: :department_edit, params: params)
end

#department_read(options = {}) ⇒ Object



13
14
15
16
17
# File 'lib/connect/web_service/rest.rb', line 13

def department_read(options = {})
  params = []
  add_param(params, create_changed_from(options))
  call(self, method: :department_read, params: params)
end

#get_opened_service_treatments(options = {}) ⇒ Object



66
67
68
69
70
71
72
73
74
75
# File 'lib/connect/web_service/rest.rb', line 66

def get_opened_service_treatments(options = {})
  params = []
  add_param(params, create_date(name: 'OpenedFrom', content: options[:opened_from], required: true))
  add_param(params, create_date_time(name: 'OpenedTo', content: options[:opened_to]))
  add_param(params, create_string(name: 'ClientID', content: options[:client_id]))
  add_param(params, create_string(name: 'ServiceUserID', content: options[:service_user_id]))
  add_param(params, create_string(name: 'ServiceID', content: options[:service_id]))
  add_param(params, create_string(name: 'SpecialistID', content: options[:specialist_id]))
  call(self, method: :get_opened_service_treatments, params: params)
end

#region_readObject



9
10
11
# File 'lib/connect/web_service/rest.rb', line 9

def region_read
  call(self, method: :region_read)
end

#specialist_add(options) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/connect/web_service/rest.rb', line 44

def specialist_add(options)
  params = []
  add_param(params, create_string(name: 'Name', content: options[:name], required: true))
  add_param(params, create_string(name: 'email', content: options[:email], required: true))
  add_param(params, create_string(name: 'Surname', content: options[:surname]))
  add_param(params, create_string(name: 'SecondaryName', content: options[:secondary_name]))
  add_param(params, create_string(name: 'Password', content: options[:password]))
  add_param(params, create_date(name: 'Birthday', content: options[:birthday]))
  add_param(params, create_string(name: 'Post', content: options[:post]))
  add_param(params, create_string(name: 'DepartmentID', content: options[:department_id]))
  add_param(params, create_string(name: 'Phone', content: options[:phone]))

  call(self, method: :specialist_add, params: params)
end

#specialist_read(options = {}) ⇒ Object



38
39
40
41
42
# File 'lib/connect/web_service/rest.rb', line 38

def specialist_read(options = {})
  params = []
  add_param(params, create_changed_from(options))
  call(self, method: :specialist_read, params: params)
end