Class: StickyIoRestfulApiV2025731::DataGetSubsciption

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb

Overview

DataGetSubsciption Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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:, created_at:, is_recurring:, recur_at:, depth:, forecasted_revenue:, credit:, product:, next_product:, shipping:, discounts:, status:, billing_model:, additional_properties: nil) ⇒ DataGetSubsciption

Returns a new instance of DataGetSubsciption.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 93

def initialize(id:, created_at:, is_recurring:, recur_at:, depth:,
               forecasted_revenue:, credit:, product:, next_product:,
               shipping:, discounts:, status:, billing_model:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @created_at = created_at
  @is_recurring = is_recurring
  @recur_at = recur_at
  @depth = depth
  @forecasted_revenue = forecasted_revenue
  @credit = credit
  @product = product
  @next_product = next_product
  @shipping = shipping
  @discounts = discounts
  @status = status
  @billing_model = billing_model
  @additional_properties = additional_properties
end

Instance Attribute Details

#billing_modelBillingModelData1

TODO: Write general description for this method

Returns:



62
63
64
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 62

def billing_model
  @billing_model
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 18

def created_at
  @created_at
end

#creditString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 38

def credit
  @credit
end

#depthInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 30

def depth
  @depth
end

#discountsDiscounts

TODO: Write general description for this method

Returns:



54
55
56
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 54

def discounts
  @discounts
end

#forecasted_revenueString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 34

def forecasted_revenue
  @forecasted_revenue
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 14

def id
  @id
end

#is_recurringInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 22

def is_recurring
  @is_recurring
end

#next_productNextProduct

TODO: Write general description for this method

Returns:



46
47
48
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 46

def next_product
  @next_product
end

#productProductData1

TODO: Write general description for this method

Returns:



42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 42

def product
  @product
end

#recur_atString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 26

def recur_at
  @recur_at
end

#shippingShipping

TODO: Write general description for this method

Returns:



50
51
52
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 50

def shipping
  @shipping
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 58

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  created_at = hash.key?('created_at') ? hash['created_at'] : nil
  is_recurring = hash.key?('is_recurring') ? hash['is_recurring'] : nil
  recur_at = hash.key?('recur_at') ? hash['recur_at'] : nil
  depth = hash.key?('depth') ? hash['depth'] : nil
  forecasted_revenue =
    hash.key?('forecasted_revenue') ? hash['forecasted_revenue'] : nil
  credit = hash.key?('credit') ? hash['credit'] : nil
  product = ProductData1.from_hash(hash['product']) if hash['product']
  next_product = NextProduct.from_hash(hash['next_product']) if hash['next_product']
  shipping = Shipping.from_hash(hash['shipping']) if hash['shipping']
  discounts = Discounts.from_hash(hash['discounts']) if hash['discounts']
  status = hash.key?('status') ? hash['status'] : nil
  billing_model = BillingModelData1.from_hash(hash['billing_model']) if hash['billing_model']

  # 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.
  DataGetSubsciption.new(id: id,
                         created_at: created_at,
                         is_recurring: is_recurring,
                         recur_at: recur_at,
                         depth: depth,
                         forecasted_revenue: forecasted_revenue,
                         credit: credit,
                         product: product,
                         next_product: next_product,
                         shipping: shipping,
                         discounts: discounts,
                         status: status,
                         billing_model: billing_model,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['created_at'] = 'created_at'
  @_hash['is_recurring'] = 'is_recurring'
  @_hash['recur_at'] = 'recur_at'
  @_hash['depth'] = 'depth'
  @_hash['forecasted_revenue'] = 'forecasted_revenue'
  @_hash['credit'] = 'credit'
  @_hash['product'] = 'product'
  @_hash['next_product'] = 'next_product'
  @_hash['shipping'] = 'shipping'
  @_hash['discounts'] = 'discounts'
  @_hash['status'] = 'status'
  @_hash['billing_model'] = 'billing_model'
  @_hash
end

.nullablesObject

An array for nullable fields



89
90
91
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 89

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 84

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



171
172
173
174
175
176
177
178
179
180
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 171

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, created_at: #{@created_at.inspect}, is_recurring:"\
  " #{@is_recurring.inspect}, recur_at: #{@recur_at.inspect}, depth: #{@depth.inspect},"\
  " forecasted_revenue: #{@forecasted_revenue.inspect}, credit: #{@credit.inspect}, product:"\
  " #{@product.inspect}, next_product: #{@next_product.inspect}, shipping:"\
  " #{@shipping.inspect}, discounts: #{@discounts.inspect}, status: #{@status.inspect},"\
  " billing_model: #{@billing_model.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



161
162
163
164
165
166
167
168
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subsciption.rb', line 161

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, created_at: #{@created_at}, is_recurring: #{@is_recurring},"\
  " recur_at: #{@recur_at}, depth: #{@depth}, forecasted_revenue: #{@forecasted_revenue},"\
  " credit: #{@credit}, product: #{@product}, next_product: #{@next_product}, shipping:"\
  " #{@shipping}, discounts: #{@discounts}, status: #{@status}, billing_model:"\
  " #{@billing_model}, additional_properties: #{@additional_properties}>"
end