Class: ConnectWise::Other

Inherits:
Object
  • Object
show all
Defined in:
lib/connectwise-ruby-sdk/models/other.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Other

Initializes the object

Parameters:

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

    Model attributes in the form of hash



113
114
115
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
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 113

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?(:'defaultLdap')
    self.default_ldap = attributes[:'defaultLdap']
  end

  if attributes.has_key?(:'defaultFromAddress')
    self.default_from_address = attributes[:'defaultFromAddress']
  end

  if attributes.has_key?(:'portalUrlOverride')
    self.portal_url_override = attributes[:'portalUrlOverride']
  end

  if attributes.has_key?(:'siteUrl')
    self.site_url = attributes[:'siteUrl']
  end

  if attributes.has_key?(:'logoPath')
    self.logo_path = attributes[:'logoPath']
  end

  if attributes.has_key?(:'contactSync')
    self.contact_sync = attributes[:'contactSync']
  end

  if attributes.has_key?(:'serverTimeZone')
    self.server_time_zone = attributes[:'serverTimeZone']
  end

  if attributes.has_key?(:'defaultCalendar')
    self.default_calendar = attributes[:'defaultCalendar']
  end

  if attributes.has_key?(:'defaultAddressFormat')
    self.default_address_format = attributes[:'defaultAddressFormat']
  end

  if attributes.has_key?(:'useSslFlag')
    self.use_ssl_flag = attributes[:'useSslFlag']
  end

  if attributes.has_key?(:'syncLeadsFlag')
    self.sync_leads_flag = attributes[:'syncLeadsFlag']
  end

  if attributes.has_key?(:'includePortalLinkFlag')
    self.include_portal_link_flag = attributes[:'includePortalLinkFlag']
  end

  if attributes.has_key?(:'useExpandedFormatTimeFlag')
    self.use_expanded_format_time_flag = attributes[:'useExpandedFormatTimeFlag']
  end

  if attributes.has_key?(:'useExpandedFormatActivityFlag')
    self.use_expanded_format_activity_flag = attributes[:'useExpandedFormatActivityFlag']
  end

  if attributes.has_key?(:'updateMemberTimeZonesFlag')
    self.update_member_time_zones_flag = attributes[:'updateMemberTimeZonesFlag']
  end

  if attributes.has_key?(:'_info')
    self._info = attributes[:'_info']
  end

end

Instance Attribute Details

#_infoObject

Metadata of the entity



41
42
43
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 41

def _info
  @_info
end

#contact_syncObject

Returns the value of attribute contact_sync.



19
20
21
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 19

def contact_sync
  @contact_sync
end

#default_address_formatObject

Returns the value of attribute default_address_format.



25
26
27
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 25

def default_address_format
  @default_address_format
end

#default_calendarObject

Returns the value of attribute default_calendar.



23
24
25
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 23

def default_calendar
  @default_calendar
end

#default_from_addressObject

Returns the value of attribute default_from_address.



11
12
13
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 11

def default_from_address
  @default_from_address
end

#default_ldapObject

Returns the value of attribute default_ldap.



9
10
11
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 9

def default_ldap
  @default_ldap
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 7

def id
  @id
end

Returns the value of attribute include_portal_link_flag.



31
32
33
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 31

def include_portal_link_flag
  @include_portal_link_flag
end

#logo_pathObject

Returns the value of attribute logo_path.



17
18
19
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 17

def logo_path
  @logo_path
end

#portal_url_overrideObject

Returns the value of attribute portal_url_override.



13
14
15
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 13

def portal_url_override
  @portal_url_override
end

#server_time_zoneObject

Returns the value of attribute server_time_zone.



21
22
23
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 21

def server_time_zone
  @server_time_zone
end

#site_urlObject

Returns the value of attribute site_url.



15
16
17
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 15

def site_url
  @site_url
end

#sync_leads_flagObject

Returns the value of attribute sync_leads_flag.



29
30
31
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 29

def sync_leads_flag
  @sync_leads_flag
end

#update_member_time_zones_flagObject

If true, all Members time zone will also be set to serverTimeZone. Otherwise, only My Company time zone will be updated.



38
39
40
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 38

def update_member_time_zones_flag
  @update_member_time_zones_flag
end

#use_expanded_format_activity_flagObject

Returns the value of attribute use_expanded_format_activity_flag.



35
36
37
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 35

def use_expanded_format_activity_flag
  @use_expanded_format_activity_flag
end

#use_expanded_format_time_flagObject

Returns the value of attribute use_expanded_format_time_flag.



33
34
35
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 33

def use_expanded_format_time_flag
  @use_expanded_format_time_flag
end

#use_ssl_flagObject

Returns the value of attribute use_ssl_flag.



27
28
29
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 27

def use_ssl_flag
  @use_ssl_flag
end

Class Method Details

.attribute_mapObject

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



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 66

def self.attribute_map
  {
    :'id' => :'id',
    :'default_ldap' => :'defaultLdap',
    :'default_from_address' => :'defaultFromAddress',
    :'portal_url_override' => :'portalUrlOverride',
    :'site_url' => :'siteUrl',
    :'logo_path' => :'logoPath',
    :'contact_sync' => :'contactSync',
    :'server_time_zone' => :'serverTimeZone',
    :'default_calendar' => :'defaultCalendar',
    :'default_address_format' => :'defaultAddressFormat',
    :'use_ssl_flag' => :'useSslFlag',
    :'sync_leads_flag' => :'syncLeadsFlag',
    :'include_portal_link_flag' => :'includePortalLinkFlag',
    :'use_expanded_format_time_flag' => :'useExpandedFormatTimeFlag',
    :'use_expanded_format_activity_flag' => :'useExpandedFormatActivityFlag',
    :'update_member_time_zones_flag' => :'updateMemberTimeZonesFlag',
    :'_info' => :'_info'
  }
end

.swagger_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 89

def self.swagger_types
  {
    :'id' => :'Integer',
    :'default_ldap' => :'LdapConfigurationReference',
    :'default_from_address' => :'String',
    :'portal_url_override' => :'String',
    :'site_url' => :'String',
    :'logo_path' => :'String',
    :'contact_sync' => :'String',
    :'server_time_zone' => :'TimeZoneSetupReference',
    :'default_calendar' => :'CalendarReference',
    :'default_address_format' => :'AddressFormatReference',
    :'use_ssl_flag' => :'BOOLEAN',
    :'sync_leads_flag' => :'BOOLEAN',
    :'include_portal_link_flag' => :'BOOLEAN',
    :'use_expanded_format_time_flag' => :'BOOLEAN',
    :'use_expanded_format_activity_flag' => :'BOOLEAN',
    :'update_member_time_zones_flag' => :'BOOLEAN',
    :'_info' => :'Metadata'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 319

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      default_ldap == o.default_ldap &&
      default_from_address == o.default_from_address &&
      portal_url_override == o.portal_url_override &&
      site_url == o.site_url &&
      logo_path == o.logo_path &&
      contact_sync == o.contact_sync &&
      server_time_zone == o.server_time_zone &&
      default_calendar == o.default_calendar &&
      default_address_format == o.default_address_format &&
      use_ssl_flag == o.use_ssl_flag &&
      sync_leads_flag == o.sync_leads_flag &&
      include_portal_link_flag == o.include_portal_link_flag &&
      use_expanded_format_time_flag == o.use_expanded_format_time_flag &&
      use_expanded_format_activity_flag == o.use_expanded_format_activity_flag &&
      update_member_time_zones_flag == o.update_member_time_zones_flag &&
      _info == o._info
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



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 377

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 = ConnectWise.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



443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 443

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



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 356

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


343
344
345
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 343

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



349
350
351
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 349

def hash
  [id, default_ldap, default_from_address, portal_url_override, site_url, logo_path, contact_sync, server_time_zone, default_calendar, default_address_format, use_ssl_flag, sync_leads_flag, include_portal_link_flag, use_expanded_format_time_flag, use_expanded_format_activity_flag, update_member_time_zones_flag, _info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



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
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 191

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

  if @default_from_address.to_s.length > 50
    invalid_properties.push("invalid value for 'default_from_address', the character length must be smaller than or equal to 50.")
  end

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

  if @portal_url_override.to_s.length > 100
    invalid_properties.push("invalid value for 'portal_url_override', the character length must be smaller than or equal to 100.")
  end

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

  if @site_url.to_s.length > 100
    invalid_properties.push("invalid value for 'site_url', the character length must be smaller than or equal to 100.")
  end

  if !@logo_path.nil? && @logo_path.to_s.length > 200
    invalid_properties.push("invalid value for 'logo_path', the character length must be smaller than or equal to 200.")
  end

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

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

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

  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



423
424
425
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 423

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



429
430
431
432
433
434
435
436
437
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 429

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



417
418
419
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 417

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



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/connectwise-ruby-sdk/models/other.rb', line 238

def valid?
  return false if @default_from_address.nil?
  return false if @default_from_address.to_s.length > 50
  return false if @portal_url_override.nil?
  return false if @portal_url_override.to_s.length > 100
  return false if @site_url.nil?
  return false if @site_url.to_s.length > 100
  return false if !@logo_path.nil? && @logo_path.to_s.length > 200
  contact_sync_validator = EnumAttributeValidator.new('String', ["FL", "LF", "CFL", "CLF"])
  return false unless contact_sync_validator.valid?(@contact_sync)
  return false if @server_time_zone.nil?
  return false if @default_calendar.nil?
  return false if @default_address_format.nil?
  return true
end