class Io::Flow::V0::Clients::ImportTemplates

Public Class Methods

new(client) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 7196
def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Public Instance Methods

get(organization) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 7200
def get(organization)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  r = @client.request("/#{CGI.escape(organization)}/import/templates").get
  r.map { |x| ::Io::Flow::V0::Models::ImportTemplate.new(x) }
end
post(organization, import_template_form) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 7206
def post(organization, import_template_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  (x = import_template_form; x.is_a?(::Io::Flow::V0::Models::ImportTemplateForm) ? x : ::Io::Flow::V0::Models::ImportTemplateForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/import/templates").with_json(import_template_form.to_json).post
  ::Io::Flow::V0::Models::ImportTemplateExample.new(r)
end