Class: ApiReference::InvoiceMinified
- Defined in:
- lib/api_reference/models/invoice_minified.rb
Overview
InvoiceMinified Model.
Instance Attribute Summary collapse
-
#customer ⇒ CustomerMinified
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#invoice_number ⇒ String
TODO: Write general description for this method.
-
#status ⇒ Status1
TODO: Write general description for this method.
-
#subscription ⇒ SubscriptionMinified
TODO: Write general description for this method.
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(id:, invoice_number:, status:, customer:, subscription:, additional_properties: nil) ⇒ InvoiceMinified
constructor
A new instance of InvoiceMinified.
-
#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(id:, invoice_number:, status:, customer:, subscription:, additional_properties: nil) ⇒ InvoiceMinified
Returns a new instance of InvoiceMinified.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/api_reference/models/invoice_minified.rb', line 55 def initialize(id:, invoice_number:, status:, customer:, subscription:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @invoice_number = invoice_number @status = status @customer = customer @subscription = subscription @additional_properties = additional_properties end |
Instance Attribute Details
#customer ⇒ CustomerMinified
TODO: Write general description for this method
26 27 28 |
# File 'lib/api_reference/models/invoice_minified.rb', line 26 def customer @customer end |
#id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/invoice_minified.rb', line 14 def id @id end |
#invoice_number ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/api_reference/models/invoice_minified.rb', line 18 def invoice_number @invoice_number end |
#status ⇒ Status1
TODO: Write general description for this method
22 23 24 |
# File 'lib/api_reference/models/invoice_minified.rb', line 22 def status @status end |
#subscription ⇒ SubscriptionMinified
TODO: Write general description for this method
30 31 32 |
# File 'lib/api_reference/models/invoice_minified.rb', line 30 def subscription @subscription end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/api_reference/models/invoice_minified.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil invoice_number = hash.key?('invoice_number') ? hash['invoice_number'] : nil status = hash.key?('status') ? hash['status'] : nil customer = CustomerMinified.from_hash(hash['customer']) if hash['customer'] subscription = SubscriptionMinified.from_hash(hash['subscription']) if hash['subscription'] # 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. InvoiceMinified.new(id: id, invoice_number: invoice_number, status: status, customer: customer, subscription: subscription, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/api_reference/models/invoice_minified.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['invoice_number'] = 'invoice_number' @_hash['status'] = 'status' @_hash['customer'] = 'customer' @_hash['subscription'] = 'subscription' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 |
# File 'lib/api_reference/models/invoice_minified.rb', line 49 def self.nullables %w[ subscription ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/api_reference/models/invoice_minified.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 110 |
# File 'lib/api_reference/models/invoice_minified.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, invoice_number: #{@invoice_number.inspect}, status:"\ " #{@status.inspect}, customer: #{@customer.inspect}, subscription:"\ " #{@subscription.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 102 |
# File 'lib/api_reference/models/invoice_minified.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, invoice_number: #{@invoice_number}, status: #{@status},"\ " customer: #{@customer}, subscription: #{@subscription}, additional_properties:"\ " #{@additional_properties}>" end |