Class: WalmartApIs::CreateMarketplaceItemLabelsRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::CreateMarketplaceItemLabelsRequest
- Defined in:
- lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb
Overview
The createMarketplaceItemLabels request.
Instance Attribute Summary collapse
-
#height ⇒ Float
The height of the item label.
-
#label_type ⇒ LabelPrintType
Indicates the type of print type for a given label.
-
#locale_code ⇒ String
The locale code constructed from ISO 639 language code and ISO 3166-1 alpha-2 country codes separated by an underscore character.
-
#marketplace_id ⇒ String
The Walmart Marketplace ID.
-
#msku_quantities ⇒ Array[MskuQuantity]
Represents the quantity of an MSKU to print item labels for.
-
#page_type ⇒ ItemLabelPageType
The page type to use to print the labels.
-
#width ⇒ Float
The width of the item label.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(label_type:, marketplace_id:, msku_quantities:, height: SKIP, locale_code: 'en_US', page_type: SKIP, width: SKIP, additional_properties: nil) ⇒ CreateMarketplaceItemLabelsRequest
constructor
A new instance of CreateMarketplaceItemLabelsRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(label_type:, marketplace_id:, msku_quantities:, height: SKIP, locale_code: 'en_US', page_type: SKIP, width: SKIP, additional_properties: nil) ⇒ CreateMarketplaceItemLabelsRequest
Returns a new instance of CreateMarketplaceItemLabelsRequest.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 71 def initialize(label_type:, marketplace_id:, msku_quantities:, height: SKIP, locale_code: 'en_US', page_type: SKIP, width: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @height = height unless height == SKIP @label_type = label_type @locale_code = locale_code unless locale_code == SKIP @marketplace_id = marketplace_id @msku_quantities = msku_quantities @page_type = page_type unless page_type == SKIP @width = width unless width == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#height ⇒ Float
The height of the item label.
14 15 16 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 14 def height @height end |
#label_type ⇒ LabelPrintType
Indicates the type of print type for a given label.
18 19 20 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 18 def label_type @label_type end |
#locale_code ⇒ String
The locale code constructed from ISO 639 language code and ISO 3166-1 alpha-2 country codes separated by an underscore character.
23 24 25 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 23 def locale_code @locale_code end |
#marketplace_id ⇒ String
The Walmart Marketplace ID. For a list of possible values, refer to Marketplace IDs.
29 30 31 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 29 def marketplace_id @marketplace_id end |
#msku_quantities ⇒ Array[MskuQuantity]
Represents the quantity of an MSKU to print item labels for.
33 34 35 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 33 def msku_quantities @msku_quantities end |
#page_type ⇒ ItemLabelPageType
The page type to use to print the labels.
37 38 39 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 37 def page_type @page_type end |
#width ⇒ Float
The width of the item label.
41 42 43 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 41 def width @width end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. label_type = hash.key?('labelType') ? hash['labelType'] : nil marketplace_id = hash.key?('marketplaceId') ? hash['marketplaceId'] : nil # Parameter is an array, so we need to iterate through it msku_quantities = nil unless hash['mskuQuantities'].nil? msku_quantities = [] hash['mskuQuantities'].each do |structure| msku_quantities << (MskuQuantity.from_hash(structure) if structure) end end msku_quantities = nil unless hash.key?('mskuQuantities') height = hash.key?('height') ? hash['height'] : SKIP locale_code = hash['localeCode'] ||= 'en_US' page_type = hash.key?('pageType') ? hash['pageType'] : SKIP width = hash.key?('width') ? hash['width'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CreateMarketplaceItemLabelsRequest.new(label_type: label_type, marketplace_id: marketplace_id, msku_quantities: msku_quantities, height: height, locale_code: locale_code, page_type: page_type, width: width, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['height'] = 'height' @_hash['label_type'] = 'labelType' @_hash['locale_code'] = 'localeCode' @_hash['marketplace_id'] = 'marketplaceId' @_hash['msku_quantities'] = 'mskuQuantities' @_hash['page_type'] = 'pageType' @_hash['width'] = 'width' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
57 58 59 60 61 62 63 64 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 57 def self.optionals %w[ height locale_code page_type width ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 143 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} height: #{@height.inspect}, label_type: #{@label_type.inspect},"\ " locale_code: #{@locale_code.inspect}, marketplace_id: #{@marketplace_id.inspect},"\ " msku_quantities: #{@msku_quantities.inspect}, page_type: #{@page_type.inspect}, width:"\ " #{@width.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
128 129 130 131 132 133 134 |
# File 'lib/walmart_ap_is/models/create_marketplace_item_labels_request.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} height: #{@height}, label_type: #{@label_type}, locale_code:"\ " #{@locale_code}, marketplace_id: #{@marketplace_id}, msku_quantities: #{@msku_quantities},"\ " page_type: #{@page_type}, width: #{@width}, additional_properties:"\ " #{@additional_properties}>" end |