Class: SibApiV3Sdk::GetEmailCampaign
- Inherits:
-
Object
- Object
- SibApiV3Sdk::GetEmailCampaign
- Defined in:
- lib/sib-api-v3-sdk/models/get_email_campaign.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Creation date of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ).
-
#footer ⇒ Object
Footer of the campaign.
-
#header ⇒ Object
Header of the campaign.
-
#html_content ⇒ Object
HTML content of the campaign.
-
#id ⇒ Object
ID of the campaign.
-
#inline_image_activation ⇒ Object
Status of inline image.
-
#mirror_active ⇒ Object
Status of mirror links in campaign.
-
#modified_at ⇒ Object
Date of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ).
-
#name ⇒ Object
Name of the campaign.
-
#recurring ⇒ Object
FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times.
-
#reply_to ⇒ Object
Email defined as the "Reply to" of the campaign.
-
#scheduled_at ⇒ Object
Date on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ).
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#share_link ⇒ Object
Link to share the campaign on social medias.
-
#status ⇒ Object
Status of the campaign.
-
#subject ⇒ Object
Subject of the campaign.
-
#tag ⇒ Object
Tag of the campaign.
-
#test_sent ⇒ Object
Retrieved the status of test email sending.
-
#to_field ⇒ Object
Customisation of the "to" field of the campaign.
-
#type ⇒ Object
Type of campaign.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GetEmailCampaign
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GetEmailCampaign
Initializes the object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 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 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 153 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] end if attributes.has_key?(:'type') self.type = attributes[:'type'] end if attributes.has_key?(:'status') self.status = attributes[:'status'] end if attributes.has_key?(:'scheduledAt') self.scheduled_at = attributes[:'scheduledAt'] end if attributes.has_key?(:'testSent') self.test_sent = attributes[:'testSent'] end if attributes.has_key?(:'header') self.header = attributes[:'header'] end if attributes.has_key?(:'footer') self. = attributes[:'footer'] end if attributes.has_key?(:'sender') self.sender = attributes[:'sender'] end if attributes.has_key?(:'replyTo') self.reply_to = attributes[:'replyTo'] end if attributes.has_key?(:'toField') self.to_field = attributes[:'toField'] end if attributes.has_key?(:'htmlContent') self.html_content = attributes[:'htmlContent'] end if attributes.has_key?(:'shareLink') self.share_link = attributes[:'shareLink'] end if attributes.has_key?(:'tag') self.tag = attributes[:'tag'] end if attributes.has_key?(:'createdAt') self.created_at = attributes[:'createdAt'] end if attributes.has_key?(:'modifiedAt') self.modified_at = attributes[:'modifiedAt'] end if attributes.has_key?(:'inlineImageActivation') self.inline_image_activation = attributes[:'inlineImageActivation'] end if attributes.has_key?(:'mirrorActive') self.mirror_active = attributes[:'mirrorActive'] end if attributes.has_key?(:'recurring') self.recurring = attributes[:'recurring'] end end |
Instance Attribute Details
#created_at ⇒ Object
Creation date of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
63 64 65 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 63 def created_at @created_at end |
#footer ⇒ Object
Footer of the campaign
43 44 45 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 43 def @footer end |
#header ⇒ Object
Header of the campaign
40 41 42 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 40 def header @header end |
#html_content ⇒ Object
HTML content of the campaign
54 55 56 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 54 def html_content @html_content end |
#id ⇒ Object
ID of the campaign
19 20 21 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 19 def id @id end |
#inline_image_activation ⇒ Object
Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email.
69 70 71 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 69 def inline_image_activation @inline_image_activation end |
#mirror_active ⇒ Object
Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
72 73 74 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 72 def mirror_active @mirror_active end |
#modified_at ⇒ Object
Date of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)
66 67 68 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 66 def modified_at @modified_at end |
#name ⇒ Object
Name of the campaign
22 23 24 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 22 def name @name end |
#recurring ⇒ Object
FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
75 76 77 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 75 def recurring @recurring end |
#reply_to ⇒ Object
Email defined as the "Reply to" of the campaign
48 49 50 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 48 def reply_to @reply_to end |
#scheduled_at ⇒ Object
Date on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ)
34 35 36 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 34 def scheduled_at @scheduled_at end |
#sender ⇒ Object
Returns the value of attribute sender.
45 46 47 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 45 def sender @sender end |
#share_link ⇒ Object
Link to share the campaign on social medias
57 58 59 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 57 def share_link @share_link end |
#status ⇒ Object
Status of the campaign
31 32 33 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 31 def status @status end |
#subject ⇒ Object
Subject of the campaign
25 26 27 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 25 def subject @subject end |
#tag ⇒ Object
Tag of the campaign
60 61 62 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 60 def tag @tag end |
#test_sent ⇒ Object
Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
37 38 39 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 37 def test_sent @test_sent end |
#to_field ⇒ Object
Customisation of the "to" field of the campaign
51 52 53 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 51 def to_field @to_field end |
#type ⇒ Object
Type of campaign
28 29 30 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 28 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 100 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'subject' => :'subject', :'type' => :'type', :'status' => :'status', :'scheduled_at' => :'scheduledAt', :'test_sent' => :'testSent', :'header' => :'header', :'footer' => :'footer', :'sender' => :'sender', :'reply_to' => :'replyTo', :'to_field' => :'toField', :'html_content' => :'htmlContent', :'share_link' => :'shareLink', :'tag' => :'tag', :'created_at' => :'createdAt', :'modified_at' => :'modifiedAt', :'inline_image_activation' => :'inlineImageActivation', :'mirror_active' => :'mirrorActive', :'recurring' => :'recurring' } end |
.swagger_types ⇒ Object
Attribute type mapping.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 126 def self.swagger_types { :'id' => :'Integer', :'name' => :'String', :'subject' => :'String', :'type' => :'String', :'status' => :'String', :'scheduled_at' => :'DateTime', :'test_sent' => :'BOOLEAN', :'header' => :'String', :'footer' => :'String', :'sender' => :'GetExtendedCampaignOverviewSender', :'reply_to' => :'String', :'to_field' => :'String', :'html_content' => :'String', :'share_link' => :'String', :'tag' => :'String', :'created_at' => :'DateTime', :'modified_at' => :'DateTime', :'inline_image_activation' => :'BOOLEAN', :'mirror_active' => :'BOOLEAN', :'recurring' => :'BOOLEAN' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 350 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && subject == o.subject && type == o.type && status == o.status && scheduled_at == o.scheduled_at && test_sent == o.test_sent && header == o.header && == o. && sender == o.sender && reply_to == o.reply_to && to_field == o.to_field && html_content == o.html_content && share_link == o.share_link && tag == o.tag && created_at == o.created_at && modified_at == o.modified_at && inline_image_activation == o.inline_image_activation && mirror_active == o.mirror_active && recurring == o.recurring end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 411 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = SibApiV3Sdk.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 477 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 390 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
377 378 379 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 377 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
383 384 385 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 383 def hash [id, name, subject, type, status, scheduled_at, test_sent, header, , sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 243 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push("invalid value for 'id', id cannot be nil.") end if @name.nil? invalid_properties.push("invalid value for 'name', name cannot be nil.") end if @subject.nil? invalid_properties.push("invalid value for 'subject', subject cannot be nil.") end if @type.nil? invalid_properties.push("invalid value for 'type', type cannot be nil.") end if @status.nil? invalid_properties.push("invalid value for 'status', status cannot be nil.") end if @test_sent.nil? invalid_properties.push("invalid value for 'test_sent', test_sent cannot be nil.") end if @header.nil? invalid_properties.push("invalid value for 'header', header cannot be nil.") end if @footer.nil? invalid_properties.push("invalid value for 'footer', footer cannot be nil.") end if @reply_to.nil? invalid_properties.push("invalid value for 'reply_to', reply_to cannot be nil.") end if @to_field.nil? invalid_properties.push("invalid value for 'to_field', to_field cannot be nil.") end if @html_content.nil? invalid_properties.push("invalid value for 'html_content', html_content cannot be nil.") end if @tag.nil? invalid_properties.push("invalid value for 'tag', tag cannot be nil.") end if @created_at.nil? invalid_properties.push("invalid value for 'created_at', created_at cannot be nil.") end if @modified_at.nil? invalid_properties.push("invalid value for 'modified_at', modified_at cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
457 458 459 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 457 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
463 464 465 466 467 468 469 470 471 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 463 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
451 452 453 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 451 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/sib-api-v3-sdk/models/get_email_campaign.rb', line 306 def valid? return false if @id.nil? return false if @name.nil? return false if @subject.nil? return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) return false unless type_validator.valid?(@type) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) return false unless status_validator.valid?(@status) return false if @test_sent.nil? return false if @header.nil? return false if @footer.nil? return false if @reply_to.nil? return false if @to_field.nil? return false if @html_content.nil? return false if @tag.nil? return false if @created_at.nil? return false if @modified_at.nil? return true end |