Module: GdsApi
- Defined in:
- lib/gds_api.rb,
lib/gds_api/railtie.rb,
lib/gds_api/version.rb,
lib/gds_api/response.rb,
lib/gds_api/rummager.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/test_helpers/mapit.rb,
lib/gds_api/test_helpers/router.rb,
lib/gds_api/test_helpers/support.rb,
lib/gds_api/test_helpers/rummager.rb,
lib/gds_api/test_helpers/calendars.rb,
lib/gds_api/test_helpers/imminence.rb,
lib/gds_api/test_helpers/worldwide.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/organisations.rb,
lib/gds_api/test_helpers/intent_helpers.rb,
lib/gds_api/test_helpers/publishing_api.rb,
lib/gds_api/performance_platform/data_in.rb,
lib/gds_api/test_helpers/email_alert_api.rb,
lib/gds_api/performance_platform/data_out.rb,
lib/gds_api/test_helpers/common_responses.rb,
lib/gds_api/test_helpers/link_checker_api.rb,
lib/gds_api/test_helpers/publishing_api_v2.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/whitehall_admin_api.rb,
lib/gds_api/test_helpers/content_item_helpers.rb,
lib/gds_api/publishing_api/special_route_publisher.rb,
lib/gds_api/test_helpers/performance_platform/data_in.rb,
lib/gds_api/test_helpers/performance_platform/data_out.rb
Defined Under Namespace
Modules: ExceptionHandling, PerformancePlatform, TestHelpers Classes: AssetManager, Base, BaseError, Calendars, ContentStore, EmailAlertApi, EndpointNotFound, GovukHeaderSniffer, GovukHeaders, HTTPBadGateway, HTTPClientError, HTTPConflict, HTTPErrorResponse, HTTPForbidden, HTTPGatewayTimeout, HTTPGone, HTTPIntermittentClientError, HTTPIntermittentServerError, HTTPInternalServerError, HTTPNotFound, HTTPPayloadTooLarge, HTTPServerError, HTTPTooManyRequests, HTTPUnauthorized, HTTPUnavailable, HTTPUnprocessableEntity, Imminence, InvalidUrl, JsonClient, LicenceApplication, LinkCheckerApi, ListResponse, LocalLinksManager, Mapit, Maslow, Organisations, PerformancePlatformDatasetNotConfigured, PublishingApi, PublishingApiV2, Railtie, Response, Router, Rummager, SocketErrorException, Support, SupportApi, TimedOutException, Worldwide
Constant Summary collapse
- VERSION =
'57.4.2'.freeze
Class Method Summary collapse
-
.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.
-
.imminence(options = {}) ⇒ GdsApi::Imminence
Creates a GdsApi::Imminence 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.
-
.mapit(options = {}) ⇒ GdsApi::Mapit
Creates a GdsApi::Mapit adapter.
-
.maslow(options = {}) ⇒ GdsApi::Maslow
Creates a GdsApi::Maslow adapter.
-
.organisations(options = {}) ⇒ GdsApi::Organisations
Creates a GdsApi::Organisations adapter for accessing Whitehall APIs on a whitehall-admin host.
-
.publishing_api(options = {}) ⇒ GdsApi::PublishingApi
Creates a GdsApi::PublishingApi adapter.
-
.publishing_api_v2(options = {}) ⇒ GdsApi::PublishingApiV2
Creates a GdsApi::PublishingApiV2 adapter.
-
.router(options = {}) ⇒ GdsApi::Router
Creates a GdsApi::Router adapter for communicating with Router API.
-
.rummager(options = {}) ⇒ GdsApi::Rummager
Creates a GdsApi::Rummager adapter to access via a rummager.* hostname.
-
.search(options = {}) ⇒ GdsApi::Rummager
Creates a GdsApi::Rummager 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-admin host.
Class Method Details
.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
29 30 31 32 33 34 |
# File 'lib/gds_api.rb', line 29 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
39 40 41 |
# File 'lib/gds_api.rb', line 39 def self.calendars( = {}) GdsApi::Calendars.new(Plek.find('calendars'), ) 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
49 50 51 52 53 54 |
# File 'lib/gds_api.rb', line 49 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
62 63 64 65 66 67 |
# File 'lib/gds_api.rb', line 62 def self.email_alert_api( = {}) GdsApi::EmailAlertApi.new( Plek.find('email-alert-api'), { bearer_token: ENV['EMAIL_ALERT_API_BEARER_TOKEN'] }.merge() ) end |
.imminence(options = {}) ⇒ GdsApi::Imminence
Creates a GdsApi::Imminence adapter
72 73 74 |
# File 'lib/gds_api.rb', line 72 def self.imminence( = {}) GdsApi::Imminence.new(Plek.find('imminence'), ) end |
.licence_application(options = {}) ⇒ GdsApi::LicenceApplication
Creates a GdsApi::LicenceApplication
79 80 81 |
# File 'lib/gds_api.rb', line 79 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
89 90 91 92 93 94 |
# File 'lib/gds_api.rb', line 89 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
99 100 101 |
# File 'lib/gds_api.rb', line 99 def self.local_links_manager( = {}) GdsApi::LocalLinksManager.new(Plek.find('local-links-manager'), ) end |
.mapit(options = {}) ⇒ GdsApi::Mapit
Creates a GdsApi::Mapit adapter
106 107 108 |
# File 'lib/gds_api.rb', line 106 def self.mapit( = {}) GdsApi::Mapit.new(Plek.find('mapit'), ) 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
116 117 118 |
# File 'lib/gds_api.rb', line 116 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 on a whitehall-admin host
124 125 126 |
# File 'lib/gds_api.rb', line 124 def self.organisations( = {}) GdsApi::Organisations.new(Plek.new.website_root, ) 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
134 135 136 137 138 139 |
# File 'lib/gds_api.rb', line 134 def self.publishing_api( = {}) GdsApi::PublishingApi.new( Plek.find('publishing-api'), { bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] }.merge() ) end |
.publishing_api_v2(options = {}) ⇒ GdsApi::PublishingApiV2
Creates a GdsApi::PublishingApiV2 adapter
This will set a bearer token if a PUBLISHING_API_BEARER_TOKEN environment variable is set
147 148 149 150 151 152 |
# File 'lib/gds_api.rb', line 147 def self.publishing_api_v2( = {}) GdsApi::PublishingApiV2.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
160 161 162 163 164 165 |
# File 'lib/gds_api.rb', line 160 def self.router( = {}) GdsApi::Router.new( Plek.find('router-api'), { bearer_token: ENV['ROUTER_API_BEARER_TOKEN'] }.merge(), ) end |
.rummager(options = {}) ⇒ GdsApi::Rummager
Creates a GdsApi::Rummager adapter to access via a rummager.* hostname
170 171 172 |
# File 'lib/gds_api.rb', line 170 def self.rummager( = {}) GdsApi::Rummager.new(Plek.find('search'), ) end |
.search(options = {}) ⇒ GdsApi::Rummager
Creates a GdsApi::Rummager adapter to access via a search.* hostname
177 178 179 |
# File 'lib/gds_api.rb', line 177 def self.search( = {}) GdsApi::Rummager.new(Plek.find('search'), ) end |
.support(options = {}) ⇒ GdsApi::Support
Creates a GdsApi::Support adapter
184 185 186 |
# File 'lib/gds_api.rb', line 184 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
194 195 196 197 198 199 |
# File 'lib/gds_api.rb', line 194 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-admin host
205 206 207 |
# File 'lib/gds_api.rb', line 205 def self.worldwide( = {}) GdsApi::Worldwide.new(Plek.find('whitehall-admin'), ) end |