Class: SibApiV3Sdk::CreateEmailCampaign
- Inherits:
-
Object
- Object
- SibApiV3Sdk::CreateEmailCampaign
- Defined in:
- lib/sib-api-v3-sdk/models/create_email_campaign.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#attachment_url ⇒ Object
Absolute url of the attachment (no local file).
-
#footer ⇒ Object
Footer of the email campaign.
-
#header ⇒ Object
Header of the email campaign.
-
#html_content ⇒ Object
Mandatory if htmlUrl is empty.
-
#html_url ⇒ Object
Mandatory if htmlContent is empty.
-
#inline_image_activation ⇒ Object
Use true to embedded the images in your email.
-
#mirror_active ⇒ Object
Use true to enable the mirror link.
-
#name ⇒ Object
Name of the campaign.
-
#recipients ⇒ Object
Returns the value of attribute recipients.
-
#recurring ⇒ Object
For trigger campagins use false to make sure a contact receives the same campaign only once.
-
#reply_to ⇒ Object
Email on which the campaign recipients will be able to reply to.
-
#scheduled_at ⇒ Object
Sending date and time (YYYY-MM-DDTHH:mm:ss.SSSZ).
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#subject ⇒ Object
Subject of the campaign.
-
#tag ⇒ Object
Tag of the campaign.
-
#to_field ⇒ Object
To personalize the «To» Field, e.g.
-
#type ⇒ Object
Type of the campaign.
-
#utm_campaign ⇒ Object
Customize the utm_campaign value.
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 = {}) ⇒ CreateEmailCampaign
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 = {}) ⇒ CreateEmailCampaign
Initializes the object
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 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 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 142 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?(:'tag') self.tag = attributes[:'tag'] end if attributes.has_key?(:'sender') self.sender = attributes[:'sender'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'htmlContent') self.html_content = attributes[:'htmlContent'] end if attributes.has_key?(:'htmlUrl') self.html_url = attributes[:'htmlUrl'] end if attributes.has_key?(:'scheduledAt') self.scheduled_at = attributes[:'scheduledAt'] end if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] 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?(:'recipients') self.recipients = attributes[:'recipients'] end if attributes.has_key?(:'attachmentUrl') self. = attributes[:'attachmentUrl'] end if attributes.has_key?(:'inlineImageActivation') self.inline_image_activation = attributes[:'inlineImageActivation'] else self.inline_image_activation = false end if attributes.has_key?(:'mirrorActive') self.mirror_active = attributes[:'mirrorActive'] end if attributes.has_key?(:'recurring') self.recurring = attributes[:'recurring'] else self.recurring = false end if attributes.has_key?(:'type') self.type = attributes[:'type'] end if attributes.has_key?(:'footer') self. = attributes[:'footer'] end if attributes.has_key?(:'header') self.header = attributes[:'header'] end if attributes.has_key?(:'utmCampaign') self.utm_campaign = attributes[:'utmCampaign'] end end |
Instance Attribute Details
#attachment_url ⇒ Object
Absolute url of the attachment (no local file). Extensions allowed xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff and rtf
47 48 49 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 47 def end |
#footer ⇒ Object
Footer of the email campaign
62 63 64 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 62 def end |
#header ⇒ Object
Header of the email campaign
65 66 67 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 65 def header @header end |
#html_content ⇒ Object
Mandatory if htmlUrl is empty. Body of the message (HTML)
27 28 29 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 27 def html_content @html_content end |
#html_url ⇒ Object
Mandatory if htmlContent is empty. Url to the message (HTML)
30 31 32 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 30 def html_url @html_url end |
#inline_image_activation ⇒ Object
Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts
50 51 52 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 50 def inline_image_activation @inline_image_activation end |
#mirror_active ⇒ Object
Use true to enable the mirror link
53 54 55 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 53 def mirror_active @mirror_active end |
#name ⇒ Object
Name of the campaign
24 25 26 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 24 def name @name end |
#recipients ⇒ Object
Returns the value of attribute recipients.
44 45 46 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 44 def recipients @recipients end |
#recurring ⇒ Object
For trigger campagins use false to make sure a contact receives the same campaign only once
56 57 58 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 56 def recurring @recurring end |
#reply_to ⇒ Object
Email on which the campaign recipients will be able to reply to
39 40 41 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 39 def reply_to @reply_to end |
#scheduled_at ⇒ Object
Sending date and time (YYYY-MM-DDTHH:mm:ss.SSSZ)
33 34 35 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 33 def scheduled_at @scheduled_at end |
#sender ⇒ Object
Returns the value of attribute sender.
21 22 23 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 21 def sender @sender end |
#subject ⇒ Object
Subject of the campaign
36 37 38 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 36 def subject @subject end |
#tag ⇒ Object
Tag of the campaign
19 20 21 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 19 def tag @tag end |
#to_field ⇒ Object
To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, use [FNAME] [LNAME]. These attributes must already exist in your contact database
42 43 44 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 42 def to_field @to_field end |
#type ⇒ Object
Type of the campaign
59 60 61 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 59 def type @type end |
#utm_campaign ⇒ Object
Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
68 69 70 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 68 def utm_campaign @utm_campaign end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 93 def self.attribute_map { :'tag' => :'tag', :'sender' => :'sender', :'name' => :'name', :'html_content' => :'htmlContent', :'html_url' => :'htmlUrl', :'scheduled_at' => :'scheduledAt', :'subject' => :'subject', :'reply_to' => :'replyTo', :'to_field' => :'toField', :'recipients' => :'recipients', :'attachment_url' => :'attachmentUrl', :'inline_image_activation' => :'inlineImageActivation', :'mirror_active' => :'mirrorActive', :'recurring' => :'recurring', :'type' => :'type', :'footer' => :'footer', :'header' => :'header', :'utm_campaign' => :'utmCampaign' } end |
.swagger_types ⇒ Object
Attribute type mapping.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 117 def self.swagger_types { :'tag' => :'String', :'sender' => :'CreateEmailCampaignSender', :'name' => :'String', :'html_content' => :'String', :'html_url' => :'String', :'scheduled_at' => :'DateTime', :'subject' => :'String', :'reply_to' => :'String', :'to_field' => :'String', :'recipients' => :'CreateEmailCampaignRecipients', :'attachment_url' => :'String', :'inline_image_activation' => :'BOOLEAN', :'mirror_active' => :'BOOLEAN', :'recurring' => :'BOOLEAN', :'type' => :'String', :'footer' => :'String', :'header' => :'String', :'utm_campaign' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 268 def ==(o) return true if self.equal?(o) self.class == o.class && tag == o.tag && sender == o.sender && name == o.name && html_content == o.html_content && html_url == o.html_url && scheduled_at == o.scheduled_at && subject == o.subject && reply_to == o.reply_to && to_field == o.to_field && recipients == o.recipients && == o. && inline_image_activation == o.inline_image_activation && mirror_active == o.mirror_active && recurring == o.recurring && type == o.type && == o. && header == o.header && utm_campaign == o.utm_campaign end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 327 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
393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 393 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
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 306 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
293 294 295 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 293 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
299 300 301 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 299 def hash [tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, , inline_image_activation, mirror_active, recurring, type, , header, utm_campaign].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 228 def list_invalid_properties invalid_properties = Array.new 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 return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
373 374 375 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 373 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
379 380 381 382 383 384 385 386 387 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 379 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
367 368 369 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 367 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
247 248 249 250 251 252 253 254 |
# File 'lib/sib-api-v3-sdk/models/create_email_campaign.rb', line 247 def valid? 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 true end |