Class: Io::Flow::V0::Models::HarmonizedItemPutForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HarmonizedItemPutForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HarmonizedItemPutForm
constructor
A new instance of HarmonizedItemPutForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HarmonizedItemPutForm
Returns a new instance of HarmonizedItemPutForm.
16287 16288 16289 16290 16291 16292 16293 16294 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16287 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name], 'HarmonizedItemPutForm') @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @categories = (x = opts.delete(:categories); x.nil? ? nil : HttpClient::Preconditions.assert_class('categories', x, Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
16285 16286 16287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16285 def attributes @attributes end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
16285 16286 16287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16285 def categories @categories end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
16285 16286 16287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16285 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16285 16286 16287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16285 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16300 16301 16302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16300 def copy(incoming={}) HarmonizedItemPutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16304 16305 16306 16307 16308 16309 16310 16311 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16304 def to_hash { :name => name, :categories => categories.nil? ? nil : categories, :description => description, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
16296 16297 16298 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16296 def to_json JSON.dump(to_hash) end |