Sha256: 44ace34629a89aa147a6e8b77d7e14447232046c9aaa81ee1067da99910f28e4

Contents?: true

Size: 1.74 KB

Versions: 36

Compression:

Stored size: 1.74 KB

Contents

# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

# typed: true
# frozen_string_literal: true

require 'faraday'
require 'faraday/multipart'
require 'sorbet-runtime'

module OpenApiSDK
  extend T::Sig
  class Metatags
    extend T::Sig


    sig { params(sdk_config: SDKConfiguration).void }
    def initialize(sdk_config)
      @sdk_configuration = sdk_config
    end


    sig { params(request: T.nilable(::OpenApiSDK::Operations::GetMetatagsRequest)).returns(::OpenApiSDK::Operations::GetMetatagsResponse) }
    def get(request)
      # get - Retrieve the metatags for a URL
      # Retrieve the metatags for a URL.
      url, params = @sdk_configuration.get_server_details
      base_url = Utils.template_url(url, params)
      url = "#{base_url}/metatags"
      headers = {}
      query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetMetatagsRequest, request)
      headers['Accept'] = 'application/json'
      headers['user-agent'] = @sdk_configuration.user_agent

      r = @sdk_configuration.client.get(url) do |req|
        req.headers = headers
        req.params = query_params
        Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
      end

      content_type = r.headers.fetch('Content-Type', 'application/octet-stream')

      res = ::OpenApiSDK::Operations::GetMetatagsResponse.new(
        status_code: r.status, content_type: content_type, raw_response: r
      )
      if r.status == 200
        if Utils.match_content_type(content_type, 'application/json')
          out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetMetatagsResponseBody)
          res.object = out
        end
      end
      res
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
dub-0.2.2.pre.alpha.40 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.39 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.38 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.37 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.36 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.35 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.34 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.33 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.32 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.31 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.30 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.29 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.28 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.27 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.26 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.25 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.24 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.23 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.22 lib/open_api_sdk/metatags.rb
dub-0.2.2.pre.alpha.21 lib/open_api_sdk/metatags.rb