Sha256: 470e1da9f3088642955248b8690292c0c23fd342cdab8f1fd18443bcd08d47b2

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

Contents

require "seatsio/exception"
require "base64"
require "seatsio/httpClient"
require "seatsio/domain"
require "json"
require "cgi"
require "seatsio/domain"
require "seatsio/events/change_object_status_request"

module Seatsio

  class HoldTokensClient
    # @return [Seatsio::HoldTokensClient]
    def initialize(secret_key, workspace_key, base_url)
      @http_client = ::Seatsio::HttpClient.new(secret_key, workspace_key, base_url)
    end

    def create(expires_in_minutes: nil)
      body = {}
      if expires_in_minutes
        body[:expiresInMinutes] = expires_in_minutes
      end
      response = @http_client.post('hold-tokens', body)
      Domain::HoldToken.new(response)
    end

    def retrieve(hold_token)
      response = @http_client.get("/hold-tokens/#{hold_token}")
      Domain::HoldToken.new(response)
    end

    def expire_in_minutes(hold_token, expires_in_minutes = nil)
      body = {"expiresInMinutes": expires_in_minutes}
      response = @http_client.post("/hold-tokens/#{hold_token}", body)
      Domain::HoldToken.new(response)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
seatsio-26.2.0 lib/seatsio/hold_tokens.rb
seatsio-26.1.0 lib/seatsio/hold_tokens.rb
seatsio-26.0.0 lib/seatsio/hold_tokens.rb
seatsio-25.3.0 lib/seatsio/hold_tokens.rb
seatsio-25.2.0 lib/seatsio/hold_tokens.rb
seatsio-25.1.0 lib/seatsio/hold_tokens.rb
seatsio-25.0.0 lib/seatsio/hold_tokens.rb
seatsio-24.4.0 lib/seatsio/hold_tokens.rb
seatsio-24.3.0 lib/seatsio/hold_tokens.rb
seatsio-24.2.0 lib/seatsio/hold_tokens.rb
seatsio-24.1.0 lib/seatsio/hold_tokens.rb
seatsio-24.0.0 lib/seatsio/hold_tokens.rb
seatsio-23.7.0 lib/seatsio/hold_tokens.rb
seatsio-23.6.0 lib/seatsio/hold_tokens.rb
seatsio-23.5.0 lib/seatsio/hold_tokens.rb
seatsio-23.3.0 lib/seatsio/hold_tokens.rb
seatsio-23 lib/seatsio/hold_tokens.rb
seatsio-22 lib/seatsio/hold_tokens.rb
seatsio-21 lib/seatsio/hold_tokens.rb
seatsio-20 lib/seatsio/hold_tokens.rb