Class: StickyIoRestfulApiV2025731::DataAddCampaignWithAltPayments

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

Overview

DataAddCampaignWithAltPayments 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(is_active:, id:, is_archived:, is_prepaid_blocked:, is_custom_price_allowed:, is_avs_enabled:, is_collections_enabled:, created_at:, updated_at:, archived_at:, name:, description:, pre_auth_amount:, offers:, channel:, payment_methods:, gateway:, alternative_payments:, shipping_profiles:, return_profiles:, postback_profiles:, coupon_profiles:, additional_properties: nil) ⇒ DataAddCampaignWithAltPayments

Returns a new instance of DataAddCampaignWithAltPayments.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 141

def initialize(is_active:, id:, is_archived:, is_prepaid_blocked:,
               is_custom_price_allowed:, is_avs_enabled:,
               is_collections_enabled:, created_at:, updated_at:,
               archived_at:, name:, description:, pre_auth_amount:, offers:,
               channel:, payment_methods:, gateway:, alternative_payments:,
               shipping_profiles:, return_profiles:, postback_profiles:,
               coupon_profiles:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @is_active = is_active
  @id = id
  @is_archived = is_archived
  @is_prepaid_blocked = is_prepaid_blocked
  @is_custom_price_allowed = is_custom_price_allowed
  @is_avs_enabled = is_avs_enabled
  @is_collections_enabled = is_collections_enabled
  @created_at = created_at
  @updated_at = updated_at
  @archived_at = archived_at
  @name = name
  @description = description
  @pre_auth_amount = pre_auth_amount
  @offers = offers
  @channel = channel
  @payment_methods = payment_methods
  @gateway = gateway
  @alternative_payments = alternative_payments
  @shipping_profiles = shipping_profiles
  @return_profiles = return_profiles
  @postback_profiles = postback_profiles
  @coupon_profiles = coupon_profiles
  @additional_properties = additional_properties
end

Instance Attribute Details

#alternative_paymentsArray[AlternativePayment]

TODO: Write general description for this method

Returns:



82
83
84
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 82

def alternative_payments
  @alternative_payments
end

#archived_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def archived_at
  @archived_at
end

#channelChannel

TODO: Write general description for this method

Returns:



70
71
72
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 70

def channel
  @channel
end

#coupon_profilesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


98
99
100
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 98

def coupon_profiles
  @coupon_profiles
end

#created_atCreatedAt

TODO: Write general description for this method

Returns:



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

def created_at
  @created_at
end

#descriptionString

TODO: Write general description for this method

Returns:

  • (String)


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

def description
  @description
end

#gatewayString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 78

def gateway
  @gateway
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def id
  @id
end

#is_activeInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_active
  @is_active
end

#is_archivedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_archived
  @is_archived
end

#is_avs_enabledInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_avs_enabled
  @is_avs_enabled
end

#is_collections_enabledInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_collections_enabled
  @is_collections_enabled
end

#is_custom_price_allowedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_custom_price_allowed
  @is_custom_price_allowed
end

#is_prepaid_blockedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_prepaid_blocked
  @is_prepaid_blocked
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#offersArray[Offer]

TODO: Write general description for this method

Returns:



66
67
68
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 66

def offers
  @offers
end

#payment_methodsArray[PaymentMethod]

TODO: Write general description for this method

Returns:



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

def payment_methods
  @payment_methods
end

#postback_profilesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


94
95
96
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 94

def postback_profiles
  @postback_profiles
end

#pre_auth_amountString

TODO: Write general description for this method

Returns:

  • (String)


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

def pre_auth_amount
  @pre_auth_amount
end

#return_profilesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


90
91
92
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 90

def return_profiles
  @return_profiles
end

#shipping_profilesArray[ShippingProfile]

TODO: Write general description for this method

Returns:



86
87
88
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 86

def shipping_profiles
  @shipping_profiles
end

#updated_atUpdatedAtData

TODO: Write general description for this method

Returns:



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

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 177

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_active = hash.key?('is_active') ? hash['is_active'] : nil
  id = hash.key?('id') ? hash['id'] : nil
  is_archived = hash.key?('is_archived') ? hash['is_archived'] : nil
  is_prepaid_blocked =
    hash.key?('is_prepaid_blocked') ? hash['is_prepaid_blocked'] : nil
  is_custom_price_allowed =
    hash.key?('is_custom_price_allowed') ? hash['is_custom_price_allowed'] : nil
  is_avs_enabled =
    hash.key?('is_avs_enabled') ? hash['is_avs_enabled'] : nil
  is_collections_enabled =
    hash.key?('is_collections_enabled') ? hash['is_collections_enabled'] : nil
  created_at = CreatedAt.from_hash(hash['created_at']) if hash['created_at']
  updated_at = UpdatedAtData.from_hash(hash['updated_at']) if hash['updated_at']
  archived_at = hash.key?('archived_at') ? hash['archived_at'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  description = hash.key?('description') ? hash['description'] : nil
  pre_auth_amount =
    hash.key?('pre_auth_amount') ? hash['pre_auth_amount'] : nil
  # Parameter is an array, so we need to iterate through it
  offers = nil
  unless hash['offers'].nil?
    offers = []
    hash['offers'].each do |structure|
      offers << (Offer.from_hash(structure) if structure)
    end
  end

  offers = nil unless hash.key?('offers')
  channel = Channel.from_hash(hash['channel']) if hash['channel']
  # Parameter is an array, so we need to iterate through it
  payment_methods = nil
  unless hash['payment_methods'].nil?
    payment_methods = []
    hash['payment_methods'].each do |structure|
      payment_methods << (PaymentMethod.from_hash(structure) if structure)
    end
  end

  payment_methods = nil unless hash.key?('payment_methods')
  gateway = hash.key?('gateway') ? hash['gateway'] : nil
  # Parameter is an array, so we need to iterate through it
  alternative_payments = nil
  unless hash['alternative_payments'].nil?
    alternative_payments = []
    hash['alternative_payments'].each do |structure|
      alternative_payments << (AlternativePayment.from_hash(structure) if structure)
    end
  end

  alternative_payments = nil unless hash.key?('alternative_payments')
  # Parameter is an array, so we need to iterate through it
  shipping_profiles = nil
  unless hash['shipping_profiles'].nil?
    shipping_profiles = []
    hash['shipping_profiles'].each do |structure|
      shipping_profiles << (ShippingProfile.from_hash(structure) if structure)
    end
  end

  shipping_profiles = nil unless hash.key?('shipping_profiles')
  return_profiles =
    hash.key?('return_profiles') ? hash['return_profiles'] : nil
  postback_profiles =
    hash.key?('postback_profiles') ? hash['postback_profiles'] : nil
  coupon_profiles =
    hash.key?('coupon_profiles') ? hash['coupon_profiles'] : 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.
  DataAddCampaignWithAltPayments.new(is_active: is_active,
                                     id: id,
                                     is_archived: is_archived,
                                     is_prepaid_blocked: is_prepaid_blocked,
                                     is_custom_price_allowed: is_custom_price_allowed,
                                     is_avs_enabled: is_avs_enabled,
                                     is_collections_enabled: is_collections_enabled,
                                     created_at: created_at,
                                     updated_at: updated_at,
                                     archived_at: archived_at,
                                     name: name,
                                     description: description,
                                     pre_auth_amount: pre_auth_amount,
                                     offers: offers,
                                     channel: channel,
                                     payment_methods: payment_methods,
                                     gateway: gateway,
                                     alternative_payments: alternative_payments,
                                     shipping_profiles: shipping_profiles,
                                     return_profiles: return_profiles,
                                     postback_profiles: postback_profiles,
                                     coupon_profiles: coupon_profiles,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_active'] = 'is_active'
  @_hash['id'] = 'id'
  @_hash['is_archived'] = 'is_archived'
  @_hash['is_prepaid_blocked'] = 'is_prepaid_blocked'
  @_hash['is_custom_price_allowed'] = 'is_custom_price_allowed'
  @_hash['is_avs_enabled'] = 'is_avs_enabled'
  @_hash['is_collections_enabled'] = 'is_collections_enabled'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['archived_at'] = 'archived_at'
  @_hash['name'] = 'name'
  @_hash['description'] = 'description'
  @_hash['pre_auth_amount'] = 'pre_auth_amount'
  @_hash['offers'] = 'offers'
  @_hash['channel'] = 'channel'
  @_hash['payment_methods'] = 'payment_methods'
  @_hash['gateway'] = 'gateway'
  @_hash['alternative_payments'] = 'alternative_payments'
  @_hash['shipping_profiles'] = 'shipping_profiles'
  @_hash['return_profiles'] = 'return_profiles'
  @_hash['postback_profiles'] = 'postback_profiles'
  @_hash['coupon_profiles'] = 'coupon_profiles'
  @_hash
end

.nullablesObject

An array for nullable fields



134
135
136
137
138
139
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 134

def self.nullables
  %w[
    archived_at
    gateway
  ]
end

.optionalsObject

An array for optional fields



129
130
131
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 129

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 297

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} is_active: #{@is_active.inspect}, id: #{@id.inspect}, is_archived:"\
  " #{@is_archived.inspect}, is_prepaid_blocked: #{@is_prepaid_blocked.inspect},"\
  " is_custom_price_allowed: #{@is_custom_price_allowed.inspect}, is_avs_enabled:"\
  " #{@is_avs_enabled.inspect}, is_collections_enabled: #{@is_collections_enabled.inspect},"\
  " created_at: #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, archived_at:"\
  " #{@archived_at.inspect}, name: #{@name.inspect}, description: #{@description.inspect},"\
  " pre_auth_amount: #{@pre_auth_amount.inspect}, offers: #{@offers.inspect}, channel:"\
  " #{@channel.inspect}, payment_methods: #{@payment_methods.inspect}, gateway:"\
  " #{@gateway.inspect}, alternative_payments: #{@alternative_payments.inspect},"\
  " shipping_profiles: #{@shipping_profiles.inspect}, return_profiles:"\
  " #{@return_profiles.inspect}, postback_profiles: #{@postback_profiles.inspect},"\
  " coupon_profiles: #{@coupon_profiles.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign_with_alt_payments.rb', line 282

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} is_active: #{@is_active}, id: #{@id}, is_archived: #{@is_archived},"\
  " is_prepaid_blocked: #{@is_prepaid_blocked}, is_custom_price_allowed:"\
  " #{@is_custom_price_allowed}, is_avs_enabled: #{@is_avs_enabled}, is_collections_enabled:"\
  " #{@is_collections_enabled}, created_at: #{@created_at}, updated_at: #{@updated_at},"\
  " archived_at: #{@archived_at}, name: #{@name}, description: #{@description},"\
  " pre_auth_amount: #{@pre_auth_amount}, offers: #{@offers}, channel: #{@channel},"\
  " payment_methods: #{@payment_methods}, gateway: #{@gateway}, alternative_payments:"\
  " #{@alternative_payments}, shipping_profiles: #{@shipping_profiles}, return_profiles:"\
  " #{@return_profiles}, postback_profiles: #{@postback_profiles}, coupon_profiles:"\
  " #{@coupon_profiles}, additional_properties: #{@additional_properties}>"
end