Class: Mws::Apis::Feeds::Feed::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/apis/feeds/feed.rb

Constant Summary collapse

Type =
Mws::Enum.for(
  fufillment_center: 'FulfillmentCenter',
  inventory: 'Inventory', 
  listings: 'Listings', 
  order_acknowledgement: 'OrderAcknowledgement', 
  order_adjustment: 'OrderAdjustment', 
  order_fulfillment: 'OrderFulfillment', 
  override: 'Override', 
  price: 'Price',
  processing_report: 'ProcessingReport',
  product: 'Product',
  image: 'ProductImage',
  relationship: 'Relationship',
  settlement_report: 'SettlementReport'
)
OperationType =
Mws::Enum.for(
  update: 'Update', 
  delete: 'Delete', 
  partial_update: 'PartialUpdate'
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, type, resource, operation_type) ⇒ Message

Returns a new instance of Message.



96
97
98
99
100
101
# File 'lib/mws/apis/feeds/feed.rb', line 96

def initialize(id, type, resource, operation_type)
  @id = id
  @type = Type.for(type)
  @resource = resource
  @operation_type = OperationType.for(operation_type) || OperationType.UPDATE
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



92
93
94
# File 'lib/mws/apis/feeds/feed.rb', line 92

def id
  @id
end

#resourceObject (readonly)

Returns the value of attribute resource.



92
93
94
# File 'lib/mws/apis/feeds/feed.rb', line 92

def resource
  @resource
end

Instance Method Details

#to_xml(parent) ⇒ Object



103
104
105
106
107
108
109
# File 'lib/mws/apis/feeds/feed.rb', line 103

def to_xml(parent)
  Mws::Serializer.tree 'Message', parent do | xml |
    xml.MessageID @id
    xml.OperationType @operation_type.val
    @resource.to_xml @type.val, xml
  end
end