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.



4496
4497
4498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4496

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



4500
4501
4502
4503
4504
4505
4506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4500

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