Class: Common::Client::Configuration::REST

Inherits:
Base
  • Object
show all
Defined in:
lib/common/client/configuration/rest.rb

Overview

Configuration for REST based services.

Examples:

Create a configuration and use it in a service.

class MyConfiguration < Common::Client::Configuration::REST
  def base_path
    Settings.my_service.url
  end

  def service_name
    'MyServiceName'
  end

  def connection
    Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
      faraday.use :breakers
      faraday.request :json

      faraday.response :raise_custom_error, error_prefix: service_name
      faraday.response :betamocks if mock_enabled?
      faraday.response :json
      faraday.adapter Faraday.default_adapter
    end
  end
end

class MyService < Common::Client::Base
  configuration MyConfiguration
end

Direct Known Subclasses

Apps::Configuration, Auth::ClientCredentials::Configuration, BB::Configuration, BBInternal::Configuration, BID::Configuration, BenefitsClaims::Configuration, BenefitsDocuments::Configuration, BenefitsEducation::Configuration, BenefitsIntake::Configuration, BenefitsIntakeService::Configuration, BenefitsReferenceData::Configuration, BipClaims::Configuration, CARMA::Client::MuleSoftAuthTokenConfiguration, CARMA::Client::MuleSoftConfiguration, Caseflow::Configuration, CentralMail::Configuration, Chip::Configuration, DebtManagementCenter::DebtsConfiguration, DecisionReview::Configuration, DecisionReviewV1::Configuration, DirectDeposit::Configuration, EVSS::Configuration, Form526BackupSubmission::Configuration, Forms::Configuration, GI::Configuration, IAMSSOeOAuth::Configuration, IHub::Configuration, LGY::Configuration, Lighthouse::Facilities::Configuration, Lighthouse::LettersGenerator::Configuration, Lighthouse::VeteransHealth::Configuration, MAP::SecurityToken::Configuration, MAP::SignUp::Configuration, MDOT::Configuration, MHV::AccountCreation::Configuration, MHVAC::Configuration, MailAutomation::Configuration, MedicalRecords::Configuration, PHRMgr::Configuration, PagerDuty::Configuration, Post911SOB::DGIB::Configuration, RES::Configuration, Rx::Configuration, SM::Configuration, Salesforce::Configuration, Search::Configuration, SearchClickTracking::Configuration, SearchGsa::Configuration, SearchTypeahead::Configuration, SignIn::Idme::Configuration, SignIn::Logingov::Configuration, TokenValidation::V2::Configuration, UserEligibility::Configuration, VAProfile::Configuration, VAProfile::Profile::V3::Configuration, VBS::Configuration, VEText::Configuration, VRE::Configuration, VeteranVerification::Configuration, VirtualRegionalOffice::Configuration

Instance Attribute Summary

Attributes inherited from Base

#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent

Method Summary

Methods inherited from Base

#base_path, #breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception, #service_name