class GdsApi::PublishingApiV2

def get_expanded_links(content_id, locale: nil, with_drafts: true, generate: false)

Other tags:
    See: https://github.com/alphagov/publishing-api/blob/master/doc/api.md#get-v2expanded-linkscontent_id -

Parameters:
  • generate (Bool) -- Whether to require publishing-api to generate the expanded links, which may be slow. Defaults to `false`.
  • with_drafts (Bool) -- Whether links to draft-only editions are returned, defaulting to `true`.
  • locale (String) -- Locale with which to generate the expanded links. Unless this is specified, the default locale (`en`) in the Publishing API will be used.
  • content_id (UUID) --
def get_expanded_links(content_id, locale: nil, with_drafts: true, generate: false)
  params = {}
  params[:with_drafts] = "false" unless with_drafts
  params[:generate] = "true" if generate
  params[:locale] = locale if locale
  query = query_string(params)
  validate_content_id(content_id)
  get_json("#{endpoint}/v2/expanded-links/#{content_id}#{query}")
end