Class: SibApiV3Sdk::UpdateEmailCampaign

Inherits:
Object
  • Object
show all
Defined in:
lib/sib-api-v3-sdk/models/update_email_campaign.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UpdateEmailCampaign

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
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
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 116

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.attachment_url = 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?(:'footer')
    self.footer = 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_urlObject

Absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere.Possilbe extension values are 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/update_email_campaign.rb', line 47

def attachment_url
  @attachment_url
end

Footer of the email campaign



59
60
61
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 59

def footer
  @footer
end

#headerObject

Header of the email campaign



62
63
64
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 62

def header
  @header
end

#html_contentObject

Body of the message (HTML version). REQUIRED if htmlUrl is empty



27
28
29
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 27

def html_content
  @html_content
end

#html_urlObject

Url which contents the body of the email message. REQUIRED if htmlContent is empty



30
31
32
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 30

def html_url
  @html_url
end

#inline_image_activationObject

Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts.



50
51
52
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 50

def inline_image_activation
  @inline_image_activation
end

#mirror_activeObject

Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign



53
54
55
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 53

def mirror_active
  @mirror_active
end

#nameObject

Name of the campaign



24
25
26
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 24

def name
  @name
end

#recipientsObject

Returns the value of attribute recipients.



44
45
46
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 44

def recipients
  @recipients
end

#recurringObject

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



56
57
58
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 56

def recurring
  @recurring
end

#reply_toObject

Email on which campaign recipients will be able to reply to



39
40
41
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 39

def reply_to
  @reply_to
end

#scheduled_atObject

Date and time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ)



33
34
35
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 33

def scheduled_at
  @scheduled_at
end

#senderObject

Returns the value of attribute sender.



21
22
23
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 21

def sender
  @sender
end

#subjectObject

Subject of the campaign



36
37
38
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 36

def subject
  @subject
end

#tagObject

Tag of the campaign



19
20
21
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 19

def tag
  @tag
end

#to_fieldObject

This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [FNAME] [LNAME]. To use the contact attributes here, these must already exist in SendinBlue account



42
43
44
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 42

def to_field
  @to_field
end

#utm_campaignObject

Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed



65
66
67
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 65

def utm_campaign
  @utm_campaign
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 69

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',
    :'footer' => :'footer',
    :'header' => :'header',
    :'utm_campaign' => :'utmCampaign'
  }
end

.swagger_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 92

def self.swagger_types
  {
    :'tag' => :'String',
    :'sender' => :'UpdateEmailCampaignSender',
    :'name' => :'String',
    :'html_content' => :'String',
    :'html_url' => :'String',
    :'scheduled_at' => :'DateTime',
    :'subject' => :'String',
    :'reply_to' => :'String',
    :'to_field' => :'String',
    :'recipients' => :'UpdateEmailCampaignRecipients',
    :'attachment_url' => :'String',
    :'inline_image_activation' => :'BOOLEAN',
    :'mirror_active' => :'BOOLEAN',
    :'recurring' => :'BOOLEAN',
    :'footer' => :'String',
    :'header' => :'String',
    :'utm_campaign' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 211

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 &&
      attachment_url == o.attachment_url &&
      inline_image_activation == o.inline_image_activation &&
      mirror_active == o.mirror_active &&
      recurring == o.recurring &&
      footer == o.footer &&
      header == o.header &&
      utm_campaign == o.utm_campaign
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
303
304
305
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 269

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 335

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 248

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


235
236
237
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 235

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



241
242
243
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 241

def hash
  [tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, footer, header, utm_campaign].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



198
199
200
201
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 198

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



315
316
317
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 315

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



321
322
323
324
325
326
327
328
329
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 321

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



309
310
311
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 309

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



205
206
207
# File 'lib/sib-api-v3-sdk/models/update_email_campaign.rb', line 205

def valid?
  return true
end