Class: EVSS::PCIU::Service
- Inherits:
-
Service
- Object
- Common::Client::Base
- Service
- EVSS::PCIU::Service
- Defined in:
- lib/evss/pciu/service.rb
Overview
EVSS::PCIU endpoints for a user’s mailing address, email address, primary/secondary phone numbers, and countries
Constant Summary
Constants inherited from Service
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#get_alternate_phone ⇒ EVSS::PCIU::PhoneNumberResponse
Returns a response object containing the user’s alternate phone number, extension, and country code.
-
#get_email_address ⇒ EVSS::PCIU::EmailAddressResponse
Returns a response object containing the user’s email address and its effective date.
-
#get_primary_phone ⇒ EVSS::PCIU::PhoneNumberResponse
Returns a response object containing the user’s primary phone number, extension, and country code.
-
#post_alternate_phone(phone_attrs) ⇒ EVSS::PCIU::PhoneNumberResponse
POST’s the passed phone attributes to the EVSS::PCIU service.
-
#post_email_address(email_attrs) ⇒ EVSS::PCIU::EmailAddressResponse
POST’s the passed email attributes to the EVSS::PCIU service.
-
#post_primary_phone(phone_attrs) ⇒ EVSS::PCIU::PhoneNumberResponse
POST’s the passed phone attributes to the EVSS::PCIU service.
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_alternate_phone ⇒ EVSS::PCIU::PhoneNumberResponse
Returns a response object containing the user’s alternate phone number, extension, and country code
68 69 70 71 72 73 74 |
# File 'lib/evss/pciu/service.rb', line 68 def get_alternate_phone with_monitoring_and_error_handling do raw_response = perform(:get, 'secondaryPhoneNumber') EVSS::PCIU::PhoneNumberResponse.new(raw_response.status, raw_response) end end |
#get_email_address ⇒ EVSS::PCIU::EmailAddressResponse
Returns a response object containing the user’s email address and its effective date
30 31 32 33 34 35 36 |
# File 'lib/evss/pciu/service.rb', line 30 def get_email_address with_monitoring_and_error_handling do raw_response = perform(:get, 'emailAddress') EVSS::PCIU::EmailAddressResponse.new(raw_response.status, raw_response) end end |
#get_primary_phone ⇒ EVSS::PCIU::PhoneNumberResponse
Returns a response object containing the user’s primary phone number, extension, and country code
49 50 51 52 53 54 55 |
# File 'lib/evss/pciu/service.rb', line 49 def get_primary_phone with_monitoring_and_error_handling do raw_response = perform(:get, 'primaryPhoneNumber') EVSS::PCIU::PhoneNumberResponse.new(raw_response.status, raw_response) end end |
#post_alternate_phone(phone_attrs) ⇒ EVSS::PCIU::PhoneNumberResponse
POST’s the passed phone attributes to the EVSS::PCIU service. Returns a response object containing the user’s alternate phone number, extension, and country code
115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/evss/pciu/service.rb', line 115 def post_alternate_phone(phone_attrs) with_monitoring_and_error_handling do raw_response = perform( :post, 'secondaryPhoneNumber', RequestBody.new(phone_attrs, pciu_key: 'cnpPhone').set, headers ) EVSS::PCIU::PhoneNumberResponse.new(raw_response.status, raw_response) end end |
#post_email_address(email_attrs) ⇒ EVSS::PCIU::EmailAddressResponse
POST’s the passed email attributes to the EVSS::PCIU service. Returns a response object containing the user’s email and effective date.
138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/evss/pciu/service.rb', line 138 def post_email_address(email_attrs) with_monitoring_and_error_handling do raw_response = perform( :post, 'emailAddress', { value: email_attrs.email }.to_json, headers ) EVSS::PCIU::EmailAddressResponse.new(raw_response.status, raw_response) end end |
#post_primary_phone(phone_attrs) ⇒ EVSS::PCIU::PhoneNumberResponse
POST’s the passed phone attributes to the EVSS::PCIU service. Returns a response object containing the user’s primary phone number, extension, and country code
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/evss/pciu/service.rb', line 89 def post_primary_phone(phone_attrs) with_monitoring_and_error_handling do raw_response = perform( :post, 'primaryPhoneNumber', RequestBody.new(phone_attrs, pciu_key: 'cnpPhone').set, headers ) EVSS::PCIU::PhoneNumberResponse.new(raw_response.status, raw_response) end end |