Class: BID::Awards::Service

Inherits:
Service show all
Defined in:
lib/bid/awards/service.rb

Constant Summary collapse

STATSD_KEY_PREFIX =
'api.bid.awards'

Constants inherited from Service

Service::SENTRY_TAG

Instance Method Summary collapse

Methods inherited from Service

#initialize

Methods included from SentryLogging

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

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

Constructor Details

This class inherits a constructor from BID::Service

Instance Method Details

#end_pointObject (private)



32
33
34
# File 'lib/bid/awards/service.rb', line 32

def end_point
  "#{Settings.bid.awards.base_url}/api/v1/awards/pension/#{@user.participant_id}"
end

#get_awards_pensionObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/bid/awards/service.rb', line 13

def get_awards_pension
  with_monitoring do
    perform(
      :get,
      end_point,
      nil,
      request_headers
    )
  end
end

#request_headersObject (private)



26
27
28
29
30
# File 'lib/bid/awards/service.rb', line 26

def request_headers
  {
    Authorization: "Bearer #{Settings.bid.awards.credentials}"
  }
end