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.



9147
9148
9149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9147

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

Instance Method Details

#post_by_name(organization, name) ⇒ Object



9151
9152
9153
9154
9155
9156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9151

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