Class: StickyIoRestfulApiV2025731::DataAddCampaign
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- StickyIoRestfulApiV2025731::DataAddCampaign
- Defined in:
- lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb
Overview
DataAddCampaign Model.
Instance Attribute Summary collapse
-
#alternative_payments ⇒ Array[String]
TODO: Write general description for this method.
-
#archived_at ⇒ String
TODO: Write general description for this method.
-
#channel ⇒ Channel
TODO: Write general description for this method.
-
#coupon_profiles ⇒ Array[CouponProfile]
TODO: Write general description for this method.
-
#created_at ⇒ CreatedAt
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#gateway ⇒ Gateway
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#is_active ⇒ Integer
TODO: Write general description for this method.
-
#is_archived ⇒ Integer
TODO: Write general description for this method.
-
#is_avs_enabled ⇒ Integer
TODO: Write general description for this method.
-
#is_collections_enabled ⇒ Integer
TODO: Write general description for this method.
-
#is_custom_price_allowed ⇒ Integer
TODO: Write general description for this method.
-
#is_prepaid_blocked ⇒ Integer
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#offers ⇒ Array[Offer]
TODO: Write general description for this method.
-
#payment_methods ⇒ Array[PaymentMethod]
TODO: Write general description for this method.
-
#postback_profiles ⇒ Array[PostbackProfile]
TODO: Write general description for this method.
-
#pre_auth_amount ⇒ String
TODO: Write general description for this method.
-
#return_profiles ⇒ Array[String]
TODO: Write general description for this method.
-
#shipping_profiles ⇒ Array[ShippingProfile]
TODO: Write general description for this method.
-
#updated_at ⇒ UpdatedAtData
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(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) ⇒ DataAddCampaign
constructor
A new instance of DataAddCampaign.
-
#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(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) ⇒ DataAddCampaign
Returns a new instance of DataAddCampaign.
140 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 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 140 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_payments ⇒ Array[String]
TODO: Write general description for this method
82 83 84 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 82 def alternative_payments @alternative_payments end |
#archived_at ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 50 def archived_at @archived_at end |
#channel ⇒ Channel
TODO: Write general description for this method
70 71 72 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 70 def channel @channel end |
#coupon_profiles ⇒ Array[CouponProfile]
TODO: Write general description for this method
98 99 100 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 98 def coupon_profiles @coupon_profiles end |
#created_at ⇒ CreatedAt
TODO: Write general description for this method
42 43 44 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 42 def created_at @created_at end |
#description ⇒ String
TODO: Write general description for this method
58 59 60 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 58 def description @description end |
#gateway ⇒ Gateway
TODO: Write general description for this method
78 79 80 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 78 def gateway @gateway end |
#id ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 18 def id @id end |
#is_active ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 14 def is_active @is_active end |
#is_archived ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 22 def is_archived @is_archived end |
#is_avs_enabled ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 34 def is_avs_enabled @is_avs_enabled end |
#is_collections_enabled ⇒ Integer
TODO: Write general description for this method
38 39 40 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 38 def is_collections_enabled @is_collections_enabled end |
#is_custom_price_allowed ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 30 def is_custom_price_allowed @is_custom_price_allowed end |
#is_prepaid_blocked ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 26 def is_prepaid_blocked @is_prepaid_blocked end |
#name ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 54 def name @name end |
#offers ⇒ Array[Offer]
TODO: Write general description for this method
66 67 68 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 66 def offers @offers end |
#payment_methods ⇒ Array[PaymentMethod]
TODO: Write general description for this method
74 75 76 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 74 def payment_methods @payment_methods end |
#postback_profiles ⇒ Array[PostbackProfile]
TODO: Write general description for this method
94 95 96 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 94 def postback_profiles @postback_profiles end |
#pre_auth_amount ⇒ String
TODO: Write general description for this method
62 63 64 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 62 def pre_auth_amount @pre_auth_amount end |
#return_profiles ⇒ Array[String]
TODO: Write general description for this method
90 91 92 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 90 def return_profiles @return_profiles end |
#shipping_profiles ⇒ Array[ShippingProfile]
TODO: Write general description for this method
86 87 88 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 86 def shipping_profiles @shipping_profiles end |
#updated_at ⇒ UpdatedAtData
TODO: Write general description for this method
46 47 48 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.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.
176 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 280 281 282 283 284 285 286 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 176 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 = Gateway.from_hash(hash['gateway']) if hash['gateway'] alternative_payments = hash.key?('alternative_payments') ? hash['alternative_payments'] : nil # 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 # Parameter is an array, so we need to iterate through it postback_profiles = nil unless hash['postback_profiles'].nil? postback_profiles = [] hash['postback_profiles'].each do |structure| postback_profiles << (PostbackProfile.from_hash(structure) if structure) end end postback_profiles = nil unless hash.key?('postback_profiles') # Parameter is an array, so we need to iterate through it coupon_profiles = nil unless hash['coupon_profiles'].nil? coupon_profiles = [] hash['coupon_profiles'].each do |structure| coupon_profiles << (CouponProfile.from_hash(structure) if structure) end end coupon_profiles = nil unless hash.key?('coupon_profiles') # 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. DataAddCampaign.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 |
.names ⇒ Object
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.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 |
.nullables ⇒ Object
An array for nullable fields
134 135 136 137 138 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 134 def self.nullables %w[ archived_at ] end |
.optionals ⇒ Object
An array for optional fields
129 130 131 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 129 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 304 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_s ⇒ Object
Provides a human-readable string representation of the object.
289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_add_campaign.rb', line 289 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 |