Class: Io::Flow::V0::Models::ReturnPolicyItemResult

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ReturnPolicyItemResult

Returns a new instance of ReturnPolicyItemResult.



64243
64244
64245
64246
64247
64248
64249
64250
64251
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64243

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :organization_id, :catalog_item_id, :return_policy_id, :status], 'ReturnPolicyItemResult')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
  @catalog_item_id = HttpClient::Preconditions.assert_class('catalog_item_id', opts.delete(:catalog_item_id), String)
  @return_policy_id = HttpClient::Preconditions.assert_class('return_policy_id', opts.delete(:return_policy_id), String)
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ReturnItemStatus) ? x : ::Io::Flow::V0::Models::ReturnItemStatus.apply(x))
end

Instance Attribute Details

#catalog_item_idObject (readonly)

Returns the value of attribute catalog_item_id.



64241
64242
64243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64241

def catalog_item_id
  @catalog_item_id
end

#idObject (readonly)

Returns the value of attribute id.



64241
64242
64243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64241

def id
  @id
end

#organization_idObject (readonly)

Returns the value of attribute organization_id.



64241
64242
64243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64241

def organization_id
  @organization_id
end

#return_policy_idObject (readonly)

Returns the value of attribute return_policy_id.



64241
64242
64243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64241

def return_policy_id
  @return_policy_id
end

#statusObject (readonly)

Returns the value of attribute status.



64241
64242
64243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64241

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



64257
64258
64259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64257

def copy(incoming={})
  ReturnPolicyItemResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



64261
64262
64263
64264
64265
64266
64267
64268
64269
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64261

def to_hash
  {
    :id => id,
    :organization_id => organization_id,
    :catalog_item_id => catalog_item_id,
    :return_policy_id => return_policy_id,
    :status => status.value
  }
end

#to_jsonObject



64253
64254
64255
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64253

def to_json
  JSON.dump(to_hash)
end