Class: ConstantContactClient::EmailCampaignAccountInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/constant_contact_client/models/email_campaign_account_information.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EmailCampaignAccountInformation

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 146

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `ConstantContactClient::EmailCampaignAccountInformation` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `ConstantContactClient::EmailCampaignAccountInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.key?(:'physical_address')
    self.physical_address = attributes[:'physical_address']
  end

  if attributes.key?(:'website')
    self.website = attributes[:'website']
  end

  if attributes.key?(:'community_screen_name')
    self.community_screen_name = attributes[:'community_screen_name']
  end

  if attributes.key?(:'logo_url')
    self.logo_url = attributes[:'logo_url']
  end

  if attributes.key?(:'contact_email')
    self.contact_email = attributes[:'contact_email']
  end

  if attributes.key?(:'contact_phone')
    self.contact_phone = attributes[:'contact_phone']
  end

  if attributes.key?(:'verified_emails')
    if (value = attributes[:'verified_emails']).is_a?(Array)
      self.verified_emails = value
    end
  end

  if attributes.key?(:'all_emails')
    if (value = attributes[:'all_emails']).is_a?(Array)
      self.all_emails = value
    end
  end

  if attributes.key?(:'message_settings')
    self.message_settings = attributes[:'message_settings']
  end

  if attributes.key?(:'timezone')
    self.timezone = attributes[:'timezone']
  end

  if attributes.key?(:'phone_prefix')
    self.phone_prefix = attributes[:'phone_prefix']
  end

  if attributes.key?(:'phone_remainder')
    self.phone_remainder = attributes[:'phone_remainder']
  end

  if attributes.key?(:'organization_phone')
    self.organization_phone = attributes[:'organization_phone']
  end

  if attributes.key?(:'industry_type')
    self.industry_type = attributes[:'industry_type']
  end

  if attributes.key?(:'locale')
    self.locale = attributes[:'locale']
  end

  if attributes.key?(:'last_authenticated_email')
    self.last_authenticated_email = attributes[:'last_authenticated_email']
  end

  if attributes.key?(:'use_source_account_images')
    self. = attributes[:'use_source_account_images']
  end

  if attributes.key?(:'default_from_email')
    self.default_from_email = attributes[:'default_from_email']
  end

  if attributes.key?(:'reply_to_email')
    self.reply_to_email = attributes[:'reply_to_email']
  end
end

Instance Attribute Details

#all_emailsObject

List of all email addresses associated with the account



45
46
47
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 45

def all_emails
  @all_emails
end

#community_screen_nameObject

Community screen name for the account



30
31
32
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 30

def community_screen_name
  @community_screen_name
end

#contact_emailObject

Primary contact email address



36
37
38
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 36

def contact_email
  @contact_email
end

#contact_phoneObject

Primary contact phone number



39
40
41
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 39

def contact_phone
  @contact_phone
end

#default_from_emailObject

Default from email address



74
75
76
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 74

def default_from_email
  @default_from_email
end

#first_nameObject

Account owner's first name



19
20
21
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 19

def first_name
  @first_name
end

#industry_typeObject

Industry type classification



62
63
64
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 62

def industry_type
  @industry_type
end

#last_authenticated_emailObject

Last email address used for authentication



68
69
70
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 68

def last_authenticated_email
  @last_authenticated_email
end

#last_nameObject

Account owner's last name



22
23
24
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 22

def last_name
  @last_name
end

#localeObject

Account locale



65
66
67
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 65

def locale
  @locale
end

#logo_urlObject

URL for the account logo



33
34
35
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 33

def logo_url
  @logo_url
end

#message_settingsObject

Returns the value of attribute message_settings.



47
48
49
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 47

def message_settings
  @message_settings
end

#organization_phoneObject

Organization phone number



59
60
61
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 59

def organization_phone
  @organization_phone
end

#phone_prefixObject

Phone number prefix



53
54
55
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 53

def phone_prefix
  @phone_prefix
end

#phone_remainderObject

Phone number remainder



56
57
58
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 56

def phone_remainder
  @phone_remainder
end

#physical_addressObject

Returns the value of attribute physical_address.



24
25
26
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 24

def physical_address
  @physical_address
end

#reply_to_emailObject

Default reply-to email address



77
78
79
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 77

def reply_to_email
  @reply_to_email
end

#timezoneObject

Account timezone



50
51
52
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 50

def timezone
  @timezone
end

#use_source_account_imagesObject

Indicates if source account images should be used



71
72
73
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 71

def 
  @use_source_account_images
end

#verified_emailsObject

List of verified email addresses. You must verify an email address before you can use it as the from address in an email.



42
43
44
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 42

def verified_emails
  @verified_emails
end

#websiteObject

Account website URL



27
28
29
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 27

def website
  @website
end

Class Method Details

._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



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
364
365
366
367
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 330

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = ConstantContactClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



107
108
109
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 107

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 80

def self.attribute_map
  {
    :'first_name' => :'first_name',
    :'last_name' => :'last_name',
    :'physical_address' => :'physical_address',
    :'website' => :'website',
    :'community_screen_name' => :'community_screen_name',
    :'logo_url' => :'logo_url',
    :'contact_email' => :'contact_email',
    :'contact_phone' => :'contact_phone',
    :'verified_emails' => :'verified_emails',
    :'all_emails' => :'all_emails',
    :'message_settings' => :'message_settings',
    :'timezone' => :'timezone',
    :'phone_prefix' => :'phone_prefix',
    :'phone_remainder' => :'phone_remainder',
    :'organization_phone' => :'organization_phone',
    :'industry_type' => :'industry_type',
    :'locale' => :'locale',
    :'last_authenticated_email' => :'last_authenticated_email',
    :'use_source_account_images' => :'use_source_account_images',
    :'default_from_email' => :'default_from_email',
    :'reply_to_email' => :'reply_to_email'
  }
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



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 306

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



139
140
141
142
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 139

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 112

def self.openapi_types
  {
    :'first_name' => :'String',
    :'last_name' => :'String',
    :'physical_address' => :'EmailCampaignAccountInformationPhysicalAddress',
    :'website' => :'String',
    :'community_screen_name' => :'String',
    :'logo_url' => :'String',
    :'contact_email' => :'String',
    :'contact_phone' => :'String',
    :'verified_emails' => :'Array<String>',
    :'all_emails' => :'Array<String>',
    :'message_settings' => :'EmailCampaignAccountInformationMessageSettings',
    :'timezone' => :'String',
    :'phone_prefix' => :'String',
    :'phone_remainder' => :'String',
    :'organization_phone' => :'String',
    :'industry_type' => :'String',
    :'locale' => :'String',
    :'last_authenticated_email' => :'String',
    :'use_source_account_images' => :'Boolean',
    :'default_from_email' => :'String',
    :'reply_to_email' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 265

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      first_name == o.first_name &&
      last_name == o.last_name &&
      physical_address == o.physical_address &&
      website == o.website &&
      community_screen_name == o.community_screen_name &&
      logo_url == o.logo_url &&
      contact_email == o.contact_email &&
      contact_phone == o.contact_phone &&
      verified_emails == o.verified_emails &&
      all_emails == o.all_emails &&
      message_settings == o.message_settings &&
      timezone == o.timezone &&
      phone_prefix == o.phone_prefix &&
      phone_remainder == o.phone_remainder &&
      organization_phone == o.organization_phone &&
      industry_type == o.industry_type &&
      locale == o.locale &&
      last_authenticated_email == o.last_authenticated_email &&
       == o. &&
      default_from_email == o.default_from_email &&
      reply_to_email == o.reply_to_email
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



401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 401

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


293
294
295
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 293

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



299
300
301
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 299

def hash
  [first_name, last_name, physical_address, website, community_screen_name, logo_url, contact_email, contact_phone, verified_emails, all_emails, message_settings, timezone, phone_prefix, phone_remainder, organization_phone, industry_type, locale, last_authenticated_email, , default_from_email, reply_to_email].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



250
251
252
253
254
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 250

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  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



377
378
379
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 377

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



383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 383

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



371
372
373
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 371

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



258
259
260
261
# File 'lib/constant_contact_client/models/email_campaign_account_information.rb', line 258

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end