Class: EVSS::PCIUAddress::Service
- Inherits:
-
Service
- Object
- Common::Client::Base
- Service
- EVSS::PCIUAddress::Service
- Defined in:
- lib/evss/pciu_address/service.rb
Overview
Proxy Service for PCIU Address Caseflow.
Constant Summary
Constants inherited from Service
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#get_address ⇒ EVSS::PCIUAddress::AddressResponse
Mailing address for a user.
-
#get_countries ⇒ EVSS::PCIUAddress::CountriesResponse
A list of country names.
-
#get_states ⇒ EVSS::PCIUAddress::StatesResponse
A list of state names.
- #request_body(address) ⇒ Object private
-
#update_address(address) ⇒ EVSS::PCIUAddress::AddressResponse
The updated mailing address for a user.
Methods inherited from Service
#handle_error, #headers, #initialize, #perform, #save_error_details, service_is_up?, #with_monitoring_and_error_handling
Methods included from Common::Client::Concerns::Monitoring
#increment, #increment_failure, #increment_total, #with_monitoring
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
Constructor Details
This class inherits a constructor from EVSS::Service
Instance Method Details
#get_address ⇒ EVSS::PCIUAddress::AddressResponse
Returns Mailing address for a user.
44 45 46 47 48 49 |
# File 'lib/evss/pciu_address/service.rb', line 44 def get_address with_monitoring_and_error_handling do raw_response = perform(:get, 'mailingAddress') EVSS::PCIUAddress::AddressResponse.new(raw_response.status, raw_response) end end |
#get_countries ⇒ EVSS::PCIUAddress::CountriesResponse
Returns A list of country names.
24 25 26 27 28 29 |
# File 'lib/evss/pciu_address/service.rb', line 24 def get_countries with_monitoring_and_error_handling do raw_response = perform(:get, 'countries') EVSS::PCIUAddress::CountriesResponse.new(raw_response.status, raw_response) end end |
#get_states ⇒ EVSS::PCIUAddress::StatesResponse
Returns A list of state names.
34 35 36 37 38 39 |
# File 'lib/evss/pciu_address/service.rb', line 34 def get_states with_monitoring_and_error_handling do raw_response = perform(:get, 'states') EVSS::PCIUAddress::StatesResponse.new(raw_response.status, raw_response) end end |
#request_body(address) ⇒ Object (private)
63 64 65 66 67 68 69 |
# File 'lib/evss/pciu_address/service.rb', line 63 def request_body(address) EVSS::PCIU::RequestBody.new( address, pciu_key: 'cnpMailingAddress', date_attr: 'address_effective_date' ).set end |
#update_address(address) ⇒ EVSS::PCIUAddress::AddressResponse
Returns The updated mailing address for a user.
54 55 56 57 58 59 |
# File 'lib/evss/pciu_address/service.rb', line 54 def update_address(address) with_monitoring_and_error_handling do raw_response = perform(:post, 'mailingAddress', request_body(address), headers) EVSS::PCIUAddress::AddressResponse.new(raw_response.status, raw_response) end end |