Class: StickyIoRestfulApiV2025731::DataGetSubscription1

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

Overview

DataGetSubscription1 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:, contact_id:, offer_type_id:, created_at:, updated_at:, deleted_at:, offer_id:, billing_model_id:, is_completed:, is_active:, is_child:, additional_properties: nil) ⇒ DataGetSubscription1

Returns a new instance of DataGetSubscription1.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 85

def initialize(id:, contact_id:, offer_type_id:, created_at:, updated_at:,
               deleted_at:, offer_id:, billing_model_id:, is_completed:,
               is_active:, is_child:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @contact_id = contact_id
  @offer_type_id = offer_type_id
  @created_at = created_at
  @updated_at = updated_at
  @deleted_at = deleted_at
  @offer_id = offer_id
  @billing_model_id = billing_model_id
  @is_completed = is_completed
  @is_active = is_active
  @is_child = is_child
  @additional_properties = additional_properties
end

Instance Attribute Details

#billing_model_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def billing_model_id
  @billing_model_id
end

#contact_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def contact_id
  @contact_id
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def created_at
  @created_at
end

#deleted_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def deleted_at
  @deleted_at
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def id
  @id
end

#is_activeTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_active
  @is_active
end

#is_childTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_child
  @is_child
end

#is_completedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def is_completed
  @is_completed
end

#offer_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def offer_id
  @offer_id
end

#offer_type_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def offer_type_id
  @offer_type_id
end

#updated_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
143
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 106

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  contact_id = hash.key?('contact_id') ? hash['contact_id'] : nil
  offer_type_id = hash.key?('offer_type_id') ? hash['offer_type_id'] : nil
  created_at = hash.key?('created_at') ? hash['created_at'] : nil
  updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
  deleted_at = hash.key?('deleted_at') ? hash['deleted_at'] : nil
  offer_id = hash.key?('offer_id') ? hash['offer_id'] : nil
  billing_model_id =
    hash.key?('billing_model_id') ? hash['billing_model_id'] : nil
  is_completed = hash.key?('is_completed') ? hash['is_completed'] : nil
  is_active = hash.key?('is_active') ? hash['is_active'] : nil
  is_child = hash.key?('is_child') ? hash['is_child'] : nil

  # 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.
  DataGetSubscription1.new(id: id,
                           contact_id: contact_id,
                           offer_type_id: offer_type_id,
                           created_at: created_at,
                           updated_at: updated_at,
                           deleted_at: deleted_at,
                           offer_id: offer_id,
                           billing_model_id: billing_model_id,
                           is_completed: is_completed,
                           is_active: is_active,
                           is_child: is_child,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['contact_id'] = 'contact_id'
  @_hash['offer_type_id'] = 'offer_type_id'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['deleted_at'] = 'deleted_at'
  @_hash['offer_id'] = 'offer_id'
  @_hash['billing_model_id'] = 'billing_model_id'
  @_hash['is_completed'] = 'is_completed'
  @_hash['is_active'] = 'is_active'
  @_hash['is_child'] = 'is_child'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
82
83
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 79

def self.nullables
  %w[
    deleted_at
  ]
end

.optionalsObject

An array for optional fields



74
75
76
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 74

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



156
157
158
159
160
161
162
163
164
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 156

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, contact_id: #{@contact_id.inspect}, offer_type_id:"\
  " #{@offer_type_id.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
  " #{@updated_at.inspect}, deleted_at: #{@deleted_at.inspect}, offer_id:"\
  " #{@offer_id.inspect}, billing_model_id: #{@billing_model_id.inspect}, is_completed:"\
  " #{@is_completed.inspect}, is_active: #{@is_active.inspect}, is_child:"\
  " #{@is_child.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



146
147
148
149
150
151
152
153
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_subscription1.rb', line 146

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, contact_id: #{@contact_id}, offer_type_id: #{@offer_type_id},"\
  " created_at: #{@created_at}, updated_at: #{@updated_at}, deleted_at: #{@deleted_at},"\
  " offer_id: #{@offer_id}, billing_model_id: #{@billing_model_id}, is_completed:"\
  " #{@is_completed}, is_active: #{@is_active}, is_child: #{@is_child}, additional_properties:"\
  " #{@additional_properties}>"
end