Sha256: 3b19695515ae3eefd4adba656cd4f8ffc3c0925c9c581d77943df54c44712958

Contents?: true

Size: 768 Bytes

Versions: 30

Compression:

Stored size: 768 Bytes

Contents

module Services
  module Hubspot
    module Authorization
      module Tokens
        class Generate < Tokens::Base
          def initialize(code:, request:)
            @code = code
            @request = request
          end

          def call
            default_api = ::Hubspot::OAuth::DefaultApi.new
            tokens = default_api.create_token(
              grant_type: :authorization_code,
              code: @code,
              redirect_uri: redirect_uri,
              client_id: ENV['HUBSPOT_CLIENT_ID'],
              client_secret: ENV['HUBSPOT_CLIENT_SECRET'],
              return_type: 'Object'
            )
            tokens[:expires_at] = expires_at(tokens[:expires_in])
            tokens
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 12 versions & 1 rubygems

Version Path
hubspot-api-client-9.0.0 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-9.0.0 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-9.0.0 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.1 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.1 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.1 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.0 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.0 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-8.0.0 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.3.0 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.3.0 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.3.0 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.2.0 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.2.0 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.2.0 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.1.1 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.1.1 sample-apps/trello-integration-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.1.1 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.1.0 sample-apps/search-result-paging-app/app/lib/services/hubspot/authorization/tokens/generate.rb
hubspot-api-client-7.1.0 sample-apps/webhooks-contacts-app/app/lib/services/hubspot/authorization/tokens/generate.rb