Class: Candid::Credentialing::V2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candid/credentialing/v_2/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Candid::Credentialing::V2::Client



8
9
10
# File 'lib/candid/credentialing/v_2/client.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#create(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::ProviderCredentialingSpan



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/candid/credentialing/v_2/client.rb', line 128

def create(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "POST",
    path: "/api/provider-credentialing-span/v2",
    body: params
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::ProviderCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#create_facility(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::FacilityCredentialingSpan



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/candid/credentialing/v_2/client.rb', line 13

def create_facility(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "POST",
    path: "/api/provider-credentialing-span/v2/facility",
    body: params
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::FacilityCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#delete(request_options: {}, **params) ⇒ untyped

Soft deletes a credentialing span rate from the system.

Raises:

  • (error_class)


200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/candid/credentialing/v_2/client.rb', line 200

def delete(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "DELETE",
    path: "/api/provider-credentialing-span/v2/#{params[:provider_credentialing_id]}"
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  return if code.between?(200, 299)

  error_class = Candid::Errors::ResponseError.subclass_for_code(code)
  raise error_class.new(_response.body, code: code)
end

#delete_facility(request_options: {}, **params) ⇒ untyped

Soft deletes a credentialing span rate from the system.

Raises:

  • (error_class)


85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/candid/credentialing/v_2/client.rb', line 85

def delete_facility(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "DELETE",
    path: "/api/provider-credentialing-span/v2/facility/#{params[:facility_credentialing_id]}"
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  return if code.between?(200, 299)

  error_class = Candid::Errors::ResponseError.subclass_for_code(code)
  raise error_class.new(_response.body, code: code)
end

#get(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::ProviderCredentialingSpan



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/candid/credentialing/v_2/client.rb', line 150

def get(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "GET",
    path: "/api/provider-credentialing-span/v2/#{params[:provider_credentialing_id]}"
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::ProviderCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#get_all(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::ProviderCredentialingSpanPage



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/candid/credentialing/v_2/client.rb', line 171

def get_all(request_options: {}, **params)
  params = Candid::Internal::Types::Utils.symbolize_keys(params)
  _query_param_names = i[limit page_token payer_uuid provider_id as_rendering_provider as_contracting_provider]
  _query = params.slice(*_query_param_names)
  params.except(*_query_param_names)

  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "GET",
    path: "/api/provider-credentialing-span/v2",
    query: _query
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::ProviderCredentialingSpanPage.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#get_all_facilities(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::FacilityCredentialingSpanPage



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/candid/credentialing/v_2/client.rb', line 56

def get_all_facilities(request_options: {}, **params)
  params = Candid::Internal::Types::Utils.symbolize_keys(params)
  _query_param_names = i[limit page_token payer_uuid contracting_provider_id service_facility_id]
  _query = params.slice(*_query_param_names)
  params.except(*_query_param_names)

  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "GET",
    path: "/api/provider-credentialing-span/v2/facility",
    query: _query
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::FacilityCredentialingSpanPage.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#get_facility(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::FacilityCredentialingSpan



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/candid/credentialing/v_2/client.rb', line 35

def get_facility(request_options: {}, **params)
  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "GET",
    path: "/api/provider-credentialing-span/v2/facility/#{params[:facility_credentialing_id]}"
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::FacilityCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#update(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::ProviderCredentialingSpan



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/candid/credentialing/v_2/client.rb', line 219

def update(request_options: {}, **params)
  _path_param_names = ["provider_credentialing_id"]

  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "PATCH",
    path: "/api/provider-credentialing-span/v2/#{params[:provider_credentialing_id]}",
    body: params.except(*_path_param_names)
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::ProviderCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end

#update_facility(request_options: {}, **params) ⇒ Candid::Credentialing::V2::Types::FacilityCredentialingSpan



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/candid/credentialing/v_2/client.rb', line 104

def update_facility(request_options: {}, **params)
  _path_param_names = ["facility_credentialing_id"]

  _request = Candid::Internal::JSON::Request.new(
    base_url: request_options[:base_url] || Candid::Environment::PRODUCTION,
    method: "PATCH",
    path: "/api/provider-credentialing-span/v2/facility/#{params[:facility_credentialing_id]}",
    body: params.except(*_path_param_names)
  )
  begin
    _response = @client.send(_request)
  rescue Net::HTTPRequestTimeout
    raise Candid::Errors::TimeoutError
  end
  code = _response.code.to_i
  if code.between?(200, 299)
    Candid::Credentialing::V2::Types::FacilityCredentialingSpan.load(_response.body)
  else
    error_class = Candid::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(_response.body, code: code)
  end
end