Class: OCI::OspGateway::Models::InvoiceLineSummary
- Inherits:
 - 
      Object
      
        
- Object
 - OCI::OspGateway::Models::InvoiceLineSummary
 
 
- Defined in:
 - lib/oci/osp_gateway/models/invoice_line_summary.rb
 
Overview
Product items of the invoice
Instance Attribute Summary collapse
- #currency ⇒ OCI::OspGateway::Models::Currency
 - 
  
    
      #net_unit_price  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Unit price of the ordered product.
 - 
  
    
      #order_no  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Product of the item.
 - 
  
    
      #part_number  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Part number.
 - 
  
    
      #product  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
[Required] Product of the item.
 - 
  
    
      #quantity  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Quantity of the ordered product.
 - 
  
    
      #time_end  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
End date.
 - 
  
    
      #time_start  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Start date.
 - 
  
    
      #total_price  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Total price of the ordered product (Net unit price x quantity).
 
Class Method Summary collapse
- 
  
    
      .attribute_map  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Attribute mapping from ruby-style variable name to JSON key.
 - 
  
    
      .swagger_types  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Attribute type mapping.
 
Instance Method Summary collapse
- 
  
    
      #==(other)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Checks equality by comparing each attribute.
 - 
  
    
      #build_from_hash(attributes)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Builds the object from hash.
 - #eql?(other) ⇒ Boolean
 - 
  
    
      #hash  ⇒ Fixnum 
    
    
  
  
  
  
  
  
  
  
  
    
Calculates hash code according to all attributes.
 - 
  
    
      #initialize(attributes = {})  ⇒ InvoiceLineSummary 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initializes the object.
 - 
  
    
      #to_hash  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the object in the form of hash.
 - 
  
    
      #to_s  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
Returns the string representation of the object.
 
Constructor Details
#initialize(attributes = {}) ⇒ InvoiceLineSummary
Initializes the object
      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 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 95 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.product = attributes[:'product'] if attributes[:'product'] self.order_no = attributes[:'orderNo'] if attributes[:'orderNo'] raise 'You cannot provide both :orderNo and :order_no' if attributes.key?(:'orderNo') && attributes.key?(:'order_no') self.order_no = attributes[:'order_no'] if attributes[:'order_no'] self.part_number = attributes[:'partNumber'] if attributes[:'partNumber'] raise 'You cannot provide both :partNumber and :part_number' if attributes.key?(:'partNumber') && attributes.key?(:'part_number') self.part_number = attributes[:'part_number'] if attributes[:'part_number'] self.time_start = attributes[:'timeStart'] if attributes[:'timeStart'] raise 'You cannot provide both :timeStart and :time_start' if attributes.key?(:'timeStart') && attributes.key?(:'time_start') self.time_start = attributes[:'time_start'] if attributes[:'time_start'] self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd'] raise 'You cannot provide both :timeEnd and :time_end' if attributes.key?(:'timeEnd') && attributes.key?(:'time_end') self.time_end = attributes[:'time_end'] if attributes[:'time_end'] self.quantity = attributes[:'quantity'] if attributes[:'quantity'] self.net_unit_price = attributes[:'netUnitPrice'] if attributes[:'netUnitPrice'] raise 'You cannot provide both :netUnitPrice and :net_unit_price' if attributes.key?(:'netUnitPrice') && attributes.key?(:'net_unit_price') self.net_unit_price = attributes[:'net_unit_price'] if attributes[:'net_unit_price'] self.total_price = attributes[:'totalPrice'] if attributes[:'totalPrice'] raise 'You cannot provide both :totalPrice and :total_price' if attributes.key?(:'totalPrice') && attributes.key?(:'total_price') self.total_price = attributes[:'total_price'] if attributes[:'total_price'] self.currency = attributes[:'currency'] if attributes[:'currency'] end  | 
  
Instance Attribute Details
#currency ⇒ OCI::OspGateway::Models::Currency
      44 45 46  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 44 def currency @currency end  | 
  
#net_unit_price ⇒ Float
Unit price of the ordered product
      37 38 39  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 37 def net_unit_price @net_unit_price end  | 
  
#order_no ⇒ String
Product of the item
      17 18 19  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 17 def order_no @order_no end  | 
  
#part_number ⇒ String
Part number
      21 22 23  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 21 def part_number @part_number end  | 
  
#product ⇒ String
[Required] Product of the item
      13 14 15  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 13 def product @product end  | 
  
#quantity ⇒ Float
Quantity of the ordered product
      33 34 35  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 33 def quantity @quantity end  | 
  
#time_end ⇒ DateTime
End date
      29 30 31  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 29 def time_end @time_end end  | 
  
#time_start ⇒ DateTime
Start date
      25 26 27  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 25 def time_start @time_start end  | 
  
#total_price ⇒ Float
Total price of the ordered product (Net unit price x quantity)
      41 42 43  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 41 def total_price @total_price end  | 
  
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
      47 48 49 50 51 52 53 54 55 56 57 58 59 60 61  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 47 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'product': :'product', 'order_no': :'orderNo', 'part_number': :'partNumber', 'time_start': :'timeStart', 'time_end': :'timeEnd', 'quantity': :'quantity', 'net_unit_price': :'netUnitPrice', 'total_price': :'totalPrice', 'currency': :'currency' # rubocop:enable Style/SymbolLiteral } end  | 
  
.swagger_types ⇒ Object
Attribute type mapping.
      64 65 66 67 68 69 70 71 72 73 74 75 76 77 78  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 64 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'product': :'String', 'order_no': :'String', 'part_number': :'String', 'time_start': :'DateTime', 'time_end': :'DateTime', 'quantity': :'Float', 'net_unit_price': :'Float', 'total_price': :'Float', 'currency': :'OCI::OspGateway::Models::Currency' # rubocop:enable Style/SymbolLiteral } end  | 
  
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
      151 152 153 154 155 156 157 158 159 160 161 162 163 164  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 151 def ==(other) return true if equal?(other) self.class == other.class && product == other.product && order_no == other.order_no && part_number == other.part_number && time_start == other.time_start && time_end == other.time_end && quantity == other.quantity && net_unit_price == other.net_unit_price && total_price == other.total_price && currency == other.currency end  | 
  
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
      189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 189 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end  | 
  
#eql?(other) ⇒ Boolean
      169 170 171  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 169 def eql?(other) self == other end  | 
  
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
      178 179 180  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 178 def hash [product, order_no, part_number, time_start, time_end, quantity, net_unit_price, total_price, currency].hash end  | 
  
#to_hash ⇒ Hash
Returns the object in the form of hash
      222 223 224 225 226 227 228 229 230 231  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 222 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end  | 
  
#to_s ⇒ String
Returns the string representation of the object
      216 217 218  | 
    
      # File 'lib/oci/osp_gateway/models/invoice_line_summary.rb', line 216 def to_s to_hash.to_s end  |