Class: Io::Flow::V0::Clients::Uploads

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Uploads

Returns a new instance of Uploads.



4749
4750
4751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4749

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#post_by_name(organization, name, hash) ⇒ Object



4753
4754
4755
4756
4757
4758
4759
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4753

def post_by_name(organization, name, hash)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('name', name, String)
  HttpClient::Preconditions.assert_class('hash', hash, Hash)
  r = @client.request("/#{CGI.escape(organization)}/uploads/#{CGI.escape(name)}").with_json(hash.to_json).post
  ::Io::Flow::V0::Models::Upload.new(r)
end