Class: AsposeEmailCloud::MapiContactElectronicAddressPropertySetDto

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb

Overview

Specify properties for up to three different e-mail addresses (Email1, Email2, and Email3) and three different fax addresses (Primary Fax, Business Fax, and Home Fax)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(business_fax: nil, default_email_address: nil, email1: nil, email2: nil, email3: nil, home_fax: nil, is_empty: nil, primary_fax: nil, use_autocomplete: nil) ⇒ MapiContactElectronicAddressPropertySetDto

Initializes the object

Parameters:

  • business_fax (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the business fax address for a contact.

  • default_email_address (MapiContactElectronicAddressDto) (defaults to: nil)

    Default value of electronic address Uses when user does not set any electronic address if UseAutocomplete property is set ‘true’

  • email1 (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the first e-mail address for a contact.

  • email2 (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the second e-mail address for a contact.

  • email3 (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the third e-mail address for a contact.

  • home_fax (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the home fax address for a contact.

  • is_empty (BOOLEAN) (defaults to: nil)

    Shows if MapiContactElectronicAddressPropertySetDto is empty

  • primary_fax (MapiContactElectronicAddressDto) (defaults to: nil)

    Refers to the group of properties that define the primary fax address for a contact.

  • use_autocomplete (BOOLEAN) (defaults to: nil)

    Indicates that one electronic address is completed automatically in case if user does not set any electronic address



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 98

def initialize(
  business_fax: nil,
  default_email_address: nil,
  email1: nil,
  email2: nil,
  email3: nil,
  home_fax: nil,
  is_empty: nil,
  primary_fax: nil,
  use_autocomplete: nil)
  self.business_fax = business_fax if business_fax
  self.default_email_address = default_email_address if default_email_address
  self.email1 = email1 if email1
  self.email2 = email2 if email2
  self.email3 = email3 if email3
  self.home_fax = home_fax if home_fax
  self.is_empty = is_empty if is_empty
  self.primary_fax = primary_fax if primary_fax
  self.use_autocomplete = use_autocomplete if use_autocomplete
end

Instance Attribute Details

#business_faxMapiContactElectronicAddressDto

Refers to the group of properties that define the business fax address for a contact.



33
34
35
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 33

def business_fax
  @business_fax
end

#default_email_addressMapiContactElectronicAddressDto

Default value of electronic address Uses when user does not set any electronic address if UseAutocomplete property is set ‘true’



36
37
38
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 36

def default_email_address
  @default_email_address
end

#email1MapiContactElectronicAddressDto

Refers to the group of properties that define the first e-mail address for a contact.



39
40
41
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 39

def email1
  @email1
end

#email2MapiContactElectronicAddressDto

Refers to the group of properties that define the second e-mail address for a contact.



42
43
44
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 42

def email2
  @email2
end

#email3MapiContactElectronicAddressDto

Refers to the group of properties that define the third e-mail address for a contact.



45
46
47
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 45

def email3
  @email3
end

#home_faxMapiContactElectronicAddressDto

Refers to the group of properties that define the home fax address for a contact.



48
49
50
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 48

def home_fax
  @home_fax
end

#is_emptyBOOLEAN

Shows if MapiContactElectronicAddressPropertySetDto is empty

Returns:

  • (BOOLEAN)


51
52
53
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 51

def is_empty
  @is_empty
end

#primary_faxMapiContactElectronicAddressDto

Refers to the group of properties that define the primary fax address for a contact.



54
55
56
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 54

def primary_fax
  @primary_fax
end

#use_autocompleteBOOLEAN

Indicates that one electronic address is completed automatically in case if user does not set any electronic address

Returns:

  • (BOOLEAN)


57
58
59
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 57

def use_autocomplete
  @use_autocomplete
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 59

def self.attribute_map
  {
    :'business_fax' => :'businessFax',
    :'default_email_address' => :'defaultEmailAddress',
    :'email1' => :'email1',
    :'email2' => :'email2',
    :'email3' => :'email3',
    :'home_fax' => :'homeFax',
    :'is_empty' => :'isEmpty',
    :'primary_fax' => :'primaryFax',
    :'use_autocomplete' => :'useAutocomplete'
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 74

def self.swagger_types
  {
    :'business_fax' => :'MapiContactElectronicAddressDto',
    :'default_email_address' => :'MapiContactElectronicAddressDto',
    :'email1' => :'MapiContactElectronicAddressDto',
    :'email2' => :'MapiContactElectronicAddressDto',
    :'email3' => :'MapiContactElectronicAddressDto',
    :'home_fax' => :'MapiContactElectronicAddressDto',
    :'is_empty' => :'BOOLEAN',
    :'primary_fax' => :'MapiContactElectronicAddressDto',
    :'use_autocomplete' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 144

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      business_fax == o.business_fax &&
      default_email_address == o.default_email_address &&
      email1 == o.email1 &&
      email2 == o.email2 &&
      email3 == o.email3 &&
      home_fax == o.home_fax &&
      is_empty == o.is_empty &&
      primary_fax == o.primary_fax &&
      use_autocomplete == o.use_autocomplete
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



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
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 196

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
    sub_type = value[:type] || value[:discriminator] || type
    if AsposeEmailCloud.const_defined?(sub_type)
      type = sub_type
    end
    temp_model = AsposeEmailCloud.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



266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 266

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



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 173

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    attribute_key = self.class.attribute_map[key]
    attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
    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[attribute_key].is_a?(Array)
        self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[attribute_key].nil?
      self.send("#{key}=", _deserialize(type, attributes[attribute_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


160
161
162
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 160

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



166
167
168
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 166

def hash
  [business_fax, default_email_address, email1, email2, email3, home_fax, is_empty, primary_fax, use_autocomplete].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 121

def list_invalid_properties
  invalid_properties = Array.new
  if @is_empty.nil?
    invalid_properties.push('invalid value for "is_empty", is_empty cannot be nil.')
  end

  if @use_autocomplete.nil?
    invalid_properties.push('invalid value for "use_autocomplete", use_autocomplete cannot be nil.')
  end

  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



246
247
248
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 246

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



252
253
254
255
256
257
258
259
260
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 252

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



240
241
242
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 240

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



136
137
138
139
140
# File 'lib/aspose-email-cloud/models/mapi_contact_electronic_address_property_set_dto.rb', line 136

def valid?
  return false if @is_empty.nil?
  return false if @use_autocomplete.nil?
  true
end