Class: GI::Client

Inherits:
Common::Client::Base show all
Defined in:
lib/gi/client.rb

Overview

Core class responsible for api interface operations

Direct Known Subclasses

Lce::Client, SearchClient

Instance Method Summary collapse

Methods inherited from Common::Client::Base

#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#get_calculator_constants_v0(params = {}) ⇒ Object



22
23
24
25
# File 'lib/gi/client.rb', line 22

def get_calculator_constants_v0(params = {})
  response = perform(:get, 'v0/calculator/constants', params)
  gids_response(response)
end

#get_calculator_constants_v1(params = {}) ⇒ Object



60
61
62
63
# File 'lib/gi/client.rb', line 60

def get_calculator_constants_v1(params = {})
  response = perform(:get, 'v1/calculator/constants', params)
  gids_response(response)
end

#get_institution_autocomplete_suggestions_v0(params = {}) ⇒ Object



12
13
14
15
# File 'lib/gi/client.rb', line 12

def get_institution_autocomplete_suggestions_v0(params = {})
  response = perform(:get, 'v0/institutions/autocomplete', params)
  gids_response(response)
end

#get_institution_autocomplete_suggestions_v1(params = {}) ⇒ Object



50
51
52
53
# File 'lib/gi/client.rb', line 50

def get_institution_autocomplete_suggestions_v1(params = {})
  response = perform(:get, 'v1/institutions/autocomplete', params)
  gids_response(response)
end

#get_institution_children_v0(params = {}) ⇒ Object



33
34
35
36
37
# File 'lib/gi/client.rb', line 33

def get_institution_children_v0(params = {})
  facility_code = params[:id]
  response = perform(:get, "v0/institutions/#{facility_code}/children", params.except(:id))
  gids_response(response)
end

#get_institution_children_v1(params = {}) ⇒ Object



71
72
73
74
75
# File 'lib/gi/client.rb', line 71

def get_institution_children_v1(params = {})
  facility_code = params[:id]
  response = perform(:get, "v1/institutions/#{facility_code}/children", params.except(:id))
  gids_response(response)
end

#get_institution_details_v0(params = {}) ⇒ Object



27
28
29
30
31
# File 'lib/gi/client.rb', line 27

def get_institution_details_v0(params = {})
  facility_code = params[:id]
  response = perform(:get, "v0/institutions/#{facility_code}", params.except(:id))
  gids_response(response)
end

#get_institution_details_v1(params = {}) ⇒ Object



65
66
67
68
69
# File 'lib/gi/client.rb', line 65

def get_institution_details_v1(params = {})
  facility_code = params[:id]
  response = perform(:get, "v1/institutions/#{facility_code}", params.except(:id))
  gids_response(response)
end

#get_institution_program_autocomplete_suggestions_v0(params = {}) ⇒ Object



17
18
19
20
# File 'lib/gi/client.rb', line 17

def get_institution_program_autocomplete_suggestions_v0(params = {})
  response = perform(:get, 'v0/institution_programs/autocomplete', params)
  gids_response(response)
end

#get_institution_program_autocomplete_suggestions_v1(params = {}) ⇒ Object



55
56
57
58
# File 'lib/gi/client.rb', line 55

def get_institution_program_autocomplete_suggestions_v1(params = {})
  response = perform(:get, 'v1/institution_programs/autocomplete', params)
  gids_response(response)
end

#get_yellow_ribbon_programs_v0(params = {}) ⇒ Object



39
40
41
42
# File 'lib/gi/client.rb', line 39

def get_yellow_ribbon_programs_v0(params = {})
  response = perform(:get, 'v0/yellow_ribbon_programs', params)
  gids_response(response)
end

#get_yellow_ribbon_programs_v1(params = {}) ⇒ Object



77
78
79
80
# File 'lib/gi/client.rb', line 77

def get_yellow_ribbon_programs_v1(params = {})
  response = perform(:get, 'v1/yellow_ribbon_programs', params)
  gids_response(response)
end

#get_zipcode_rate_v0(params = {}) ⇒ Object



44
45
46
47
48
# File 'lib/gi/client.rb', line 44

def get_zipcode_rate_v0(params = {})
  zipcode = params[:id]
  response = perform(:get, "v0/zipcode_rates/#{zipcode}", {})
  gids_response(response)
end

#get_zipcode_rate_v1(params = {}) ⇒ Object



82
83
84
85
86
# File 'lib/gi/client.rb', line 82

def get_zipcode_rate_v1(params = {})
  zipcode = params[:id]
  response = perform(:get, "v1/zipcode_rates/#{zipcode}", {})
  gids_response(response)
end

#gids_response(response) ⇒ Object (private)



90
91
92
# File 'lib/gi/client.rb', line 90

def gids_response(response)
  GI::GIDSResponse.from(response)
end