Sha256: 692292f9ba340d7120e30c8ac18e05f68382ee3465369799b311ce44aa44df7d

Contents?: true

Size: 740 Bytes

Versions: 12

Compression:

Stored size: 740 Bytes

Contents

module OpenApi
  # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#oauthFlowObject
  class OAuthFlow
    prepend EquatableAsContent

    attr_accessor :authorization_url, :token_url, :refresh_url ,:scopes

    def initialize(authorization_url:, token_url:, refresh_url: nil, scopes:)
      self.authorization_url = authorization_url
      self.token_url = token_url
      self.refresh_url = refresh_url
      self.scopes = scopes.with_indifferent_access
    end

    def self.load(hash)
      return unless hash

      new(
        authorization_url: hash["authorizationUrl"],
        token_url: hash["tokenUrl"],
        refresh_url: hash["refreshUrl"],
        scopes: hash["scopes"],
      )
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
open_api-0.6.2 lib/open_api/o_auth_flow.rb
open_api-0.6.1 lib/open_api/o_auth_flow.rb
open_api-0.6.0 lib/open_api/o_auth_flow.rb
open_api-0.5.0 lib/open_api/o_auth_flow.rb
open_api-0.4.0 lib/open_api/o_auth_flow.rb
open_api-0.3.4 lib/open_api/o_auth_flow.rb
open_api-0.3.3 lib/open_api/o_auth_flow.rb
open_api-0.3.2 lib/open_api/o_auth_flow.rb
open_api-0.3.1 lib/open_api/o_auth_flow.rb
open_api-0.3.0 lib/open_api/o_auth_flow.rb
open_api-0.2.0 lib/open_api/o_auth_flow.rb
open_api-0.1.0 lib/open_api/o_auth_flow.rb