class PayPal::SDK::REST::DataTypes::Template

Public Class Methods

get(template_id, options = {}) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 1372
def get(template_id, options = {})
  raise ArgumentError.new("template_id required") if template_id.to_s.strip.empty?
  path = "v1/invoicing/templates/#{template_id}"
  self.new(api.get(path, options))
end
load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 1337
def self.load_members
            object_of :template_id, String
            object_of :name, String
            object_of :default, Boolean
            object_of :template_data, TemplateData
            array_of  :settings, TemplateSettings
            object_of :unit_of_measure, String
            object_of :custom, Boolean
            array_of  :links, Links
end

Public Instance Methods

create() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 1364
def create()
    path = "v1/invoicing/templates"
    response = api.post(path, self.to_hash, http_header)
    self.merge!(response)
    Template.new(response)
end
delete() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 1350
def delete()
  path = "v1/invoicing/templates/#{self.template_id}"
  response = api.delete(path, {})
  self.merge!(response)
  success?
end
update() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 1357
def update()
  path = "v1/invoicing/templates/#{self.template_id}"
  response = api.put(path, self.to_hash, http_header)
  self.merge!(response)
  Template.new(response)
end