Module: GdsApi
- Defined in:
- lib/gds_api.rb,
lib/gds_api/search.rb,
lib/gds_api/railtie.rb,
lib/gds_api/version.rb,
lib/gds_api/response.rb,
lib/gds_api/exceptions.rb,
lib/gds_api/json_client.rb,
lib/gds_api/govuk_headers.rb,
lib/gds_api/list_response.rb,
lib/gds_api/search_api_v2.rb,
lib/gds_api/test_helpers/router.rb,
lib/gds_api/test_helpers/search.rb,
lib/gds_api/test_helpers/calendars.rb,
lib/gds_api/test_helpers/worldwide.rb,
lib/gds_api/test_helpers/account_api.rb,
lib/gds_api/test_helpers/support_api.rb,
lib/gds_api/test_helpers/asset_manager.rb,
lib/gds_api/test_helpers/content_store.rb,
lib/gds_api/test_helpers/locations_api.rb,
lib/gds_api/test_helpers/organisations.rb,
lib/gds_api/test_helpers/places_manager.rb,
lib/gds_api/test_helpers/publishing_api.rb,
lib/gds_api/test_helpers/email_alert_api.rb,
lib/gds_api/test_helpers/common_responses.rb,
lib/gds_api/test_helpers/link_checker_api.rb,
lib/gds_api/middleware/govuk_header_sniffer.rb,
lib/gds_api/test_helpers/licence_application.rb,
lib/gds_api/test_helpers/local_links_manager.rb,
lib/gds_api/test_helpers/content_item_helpers.rb,
lib/gds_api/publishing_api/special_route_publisher.rb
Defined Under Namespace
Modules: ExceptionHandling, TestHelpers Classes: AccountApi, AssetManager, Base, BaseError, Calendars, ContentStore, EmailAlertApi, EndpointNotFound, GovukHeaderSniffer, GovukHeaders, HTTPBadGateway, HTTPBadRequest, HTTPClientError, HTTPConflict, HTTPErrorResponse, HTTPForbidden, HTTPGatewayTimeout, HTTPGone, HTTPIntermittentClientError, HTTPIntermittentServerError, HTTPInternalServerError, HTTPNotFound, HTTPPayloadTooLarge, HTTPServerError, HTTPTooManyRequests, HTTPUnauthorized, HTTPUnavailable, HTTPUnprocessableEntity, InvalidUrl, JsonClient, LicenceApplication, LinkCheckerApi, ListResponse, LocalLinksManager, LocationsApi, Maslow, Organisations, PlacesManager, PublishingApi, Railtie, Response, Router, Search, SearchApiV2, SocketErrorException, Support, SupportApi, TimedOutException, Worldwide
Constant Summary collapse
- VERSION =
"97.5.0".freeze
Class Method Summary collapse
-
.account_api(options = {}) ⇒ GdsApi::AccountApi
Creates a GdsApi::AccountApi adapter.
-
.asset_manager(options = {}) ⇒ GdsApi::AssetManager
Creates a GdsApi::AssetManager adapter.
-
.calendars(options = {}) ⇒ GdsApi::Calendars
Creates a GdsApi::Calendars adapter.
-
.content_store(options = {}) ⇒ GdsApi::ContentStore
Creates a GdsApi::ContentStore adapter.
-
.email_alert_api(options = {}) ⇒ GdsApi::EmailAlertApi
Creates a GdsApi::EmailAlertApi adapter.
-
.licence_application(options = {}) ⇒ GdsApi::LicenceApplication
Creates a GdsApi::LicenceApplication.
-
.link_checker_api(options = {}) ⇒ GdsApi::LinkCheckerApi
Creates a GdsApi::LinkCheckerApi adapter.
-
.local_links_manager(options = {}) ⇒ GdsApi::LocalLinksManager
Creates a GdsApi::LocalLinksManager adapter.
-
.locations_api(options = {}) ⇒ GdsApi::LocationsApi
Creates a GdsApi::LocationsApi adapter.
-
.maslow(options = {}) ⇒ GdsApi::Maslow
Creates a GdsApi::Maslow adapter.
-
.organisations(options = {}) ⇒ GdsApi::Organisations
Creates a GdsApi::Organisations adapter for accessing Whitehall APIs through the origin, where the requests will be handled by Collections frontend.
-
.places_manager(options = {}) ⇒ GdsApi::PlacesManager
Creates a GdsApi::PlacesManager adapter.
-
.publishing_api(options = {}) ⇒ GdsApi::PublishingApi
Creates a GdsApi::PublishingApi adapter.
-
.router(options = {}) ⇒ GdsApi::Router
Creates a GdsApi::Router adapter for communicating with Router API.
-
.search(options = {}) ⇒ GdsApi::Search
Creates a GdsApi::Search adapter to access via a search.* hostname.
-
.support(options = {}) ⇒ GdsApi::Support
Creates a GdsApi::Support adapter.
-
.support_api(options = {}) ⇒ GdsApi::SupportApi
Creates a GdsApi::SupportApi adapter.
-
.worldwide(options = {}) ⇒ GdsApi::Worldwide
Creates a GdsApi::Worldwide adapter for accessing Whitehall APIs on a whitehall-frontend host.
Class Method Details
.account_api(options = {}) ⇒ GdsApi::AccountApi
Creates a GdsApi::AccountApi adapter
This will set a bearer token if a ACCOUNT_API_BEARER_TOKEN environment variable is set
32 33 34 35 36 37 |
# File 'lib/gds_api.rb', line 32 def self.account_api( = {}) GdsApi::AccountApi.new( Plek.find("account-api"), { bearer_token: ENV["ACCOUNT_API_BEARER_TOKEN"] }.merge(), ) end |
.asset_manager(options = {}) ⇒ GdsApi::AssetManager
Creates a GdsApi::AssetManager adapter
This will set a bearer token if a ASSET_MANAGER_BEARER_TOKEN environment variable is set
45 46 47 48 49 50 |
# File 'lib/gds_api.rb', line 45 def self.asset_manager( = {}) GdsApi::AssetManager.new( Plek.find("asset-manager"), { bearer_token: ENV["ASSET_MANAGER_BEARER_TOKEN"] }.merge(), ) end |
.calendars(options = {}) ⇒ GdsApi::Calendars
Creates a GdsApi::Calendars adapter
55 56 57 |
# File 'lib/gds_api.rb', line 55 def self.calendars( = {}) GdsApi::Calendars.new(Plek.new.website_root, ) end |
.content_store(options = {}) ⇒ GdsApi::ContentStore
Creates a GdsApi::ContentStore adapter
This will set a bearer token if a CONTENT_STORE_BEARER_TOKEN environment variable is set
65 66 67 68 69 70 |
# File 'lib/gds_api.rb', line 65 def self.content_store( = {}) GdsApi::ContentStore.new( Plek.find("content-store"), { bearer_token: ENV["CONTENT_STORE_BEARER_TOKEN"] }.merge(), ) end |
.email_alert_api(options = {}) ⇒ GdsApi::EmailAlertApi
Creates a GdsApi::EmailAlertApi adapter
This will set a bearer token if a EMAIL_ALERT_API_BEARER_TOKEN environment variable is set
78 79 80 81 82 83 |
# File 'lib/gds_api.rb', line 78 def self.email_alert_api( = {}) GdsApi::EmailAlertApi.new( Plek.find("email-alert-api"), { bearer_token: ENV["EMAIL_ALERT_API_BEARER_TOKEN"] }.merge(), ) end |
.licence_application(options = {}) ⇒ GdsApi::LicenceApplication
Creates a GdsApi::LicenceApplication
95 96 97 |
# File 'lib/gds_api.rb', line 95 def self.licence_application( = {}) GdsApi::LicenceApplication.new(Plek.find("licensify"), ) end |
.link_checker_api(options = {}) ⇒ GdsApi::LinkCheckerApi
Creates a GdsApi::LinkCheckerApi adapter
This will set a bearer token if a LINK_CHECKER_API_BEARER_TOKEN environment variable is set
105 106 107 108 109 110 |
# File 'lib/gds_api.rb', line 105 def self.link_checker_api( = {}) GdsApi::LinkCheckerApi.new( Plek.find("link-checker-api"), { bearer_token: ENV["LINK_CHECKER_API_BEARER_TOKEN"] }.merge(), ) end |
.local_links_manager(options = {}) ⇒ GdsApi::LocalLinksManager
Creates a GdsApi::LocalLinksManager adapter
115 116 117 |
# File 'lib/gds_api.rb', line 115 def self.local_links_manager( = {}) GdsApi::LocalLinksManager.new(Plek.find("local-links-manager"), ) end |
.locations_api(options = {}) ⇒ GdsApi::LocationsApi
Creates a GdsApi::LocationsApi adapter
122 123 124 |
# File 'lib/gds_api.rb', line 122 def self.locations_api( = {}) GdsApi::LocationsApi.new(Plek.find("locations-api"), ) end |
.maslow(options = {}) ⇒ GdsApi::Maslow
Creates a GdsApi::Maslow adapter
It’s set to use an external url as an endpoint as the Maslow adapter is used to generate external links
132 133 134 |
# File 'lib/gds_api.rb', line 132 def self.maslow( = {}) GdsApi::Maslow.new(Plek.new.external_url_for("maslow"), ) end |
.organisations(options = {}) ⇒ GdsApi::Organisations
Creates a GdsApi::Organisations adapter for accessing Whitehall APIs through the origin, where the requests will be handled by Collections frontend.
141 142 143 |
# File 'lib/gds_api.rb', line 141 def self.organisations( = {}) GdsApi::Organisations.new(Plek.new.website_root, ) end |
.places_manager(options = {}) ⇒ GdsApi::PlacesManager
Creates a GdsApi::PlacesManager adapter
88 89 90 |
# File 'lib/gds_api.rb', line 88 def self.places_manager( = {}) GdsApi::PlacesManager.new(Plek.find("places-manager"), ) end |
.publishing_api(options = {}) ⇒ GdsApi::PublishingApi
Creates a GdsApi::PublishingApi adapter
This will set a bearer token if a PUBLISHING_API_BEARER_TOKEN environment variable is set
151 152 153 154 155 156 |
# File 'lib/gds_api.rb', line 151 def self.publishing_api( = {}) GdsApi::PublishingApi.new( Plek.find("publishing-api"), { bearer_token: ENV["PUBLISHING_API_BEARER_TOKEN"] }.merge(), ) end |
.router(options = {}) ⇒ GdsApi::Router
Creates a GdsApi::Router adapter for communicating with Router API
This will set a bearer token if a ROUTER_API_BEARER_TOKEN environment variable is set
164 165 166 167 168 169 |
# File 'lib/gds_api.rb', line 164 def self.router( = {}) GdsApi::Router.new( Plek.find("router-api"), { bearer_token: ENV["ROUTER_API_BEARER_TOKEN"] }.merge(), ) end |
.search(options = {}) ⇒ GdsApi::Search
Creates a GdsApi::Search adapter to access via a search.* hostname
174 175 176 |
# File 'lib/gds_api.rb', line 174 def self.search( = {}) GdsApi::Search.new(Plek.find("search-api"), ) end |
.support(options = {}) ⇒ GdsApi::Support
Creates a GdsApi::Support adapter
181 182 183 |
# File 'lib/gds_api.rb', line 181 def self.support( = {}) GdsApi::Support.new(Plek.find("support"), ) end |
.support_api(options = {}) ⇒ GdsApi::SupportApi
Creates a GdsApi::SupportApi adapter
This will set a bearer token if a SUPPORT_API_BEARER_TOKEN environment variable is set
191 192 193 194 195 196 |
# File 'lib/gds_api.rb', line 191 def self.support_api( = {}) GdsApi::SupportApi.new( Plek.find("support-api"), { bearer_token: ENV["SUPPORT_API_BEARER_TOKEN"] }.merge(), ) end |
.worldwide(options = {}) ⇒ GdsApi::Worldwide
Creates a GdsApi::Worldwide adapter for accessing Whitehall APIs on a whitehall-frontend host
202 203 204 |
# File 'lib/gds_api.rb', line 202 def self.worldwide( = {}) GdsApi::Worldwide.new(Plek.new.website_root, ) end |