Class: ConnectWise::ManagedDevicesIntegration

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ManagedDevicesIntegration

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#_infoObject

Metadata of the entity



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

def _info
  @_info
end

#config_bill_customer_flagObject

Returns the value of attribute config_bill_customer_flag.



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

def config_bill_customer_flag
  @config_bill_customer_flag
end

#default_billing_levelObject

Returns the value of attribute default_billing_level.



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

def default_billing_level
  @default_billing_level
end

#default_departmentObject

Returns the value of attribute default_department.



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

def default_department
  @default_department
end

#default_locationObject

Returns the value of attribute default_location.



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

def default_location
  @default_location
end

#disable_new_cross_references_flagObject

Returns the value of attribute disable_new_cross_references_flag.



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

def disable_new_cross_references_flag
  @disable_new_cross_references_flag
end

#global_login_passwordObject

This is only required when globalLoginFlag = true



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

def 
  @global_login_password
end

#global_login_usernameObject

This is only required when globalLoginFlag = true



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

def 
  @global_login_username
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#integrator_loginObject

Returns the value of attribute integrator_login.



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

def 
  @integrator_login
end

#login_byObject

Returns the value of attribute login_by.



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

def 
  @login_by
end

#management_it_setup_typeObject

Returns the value of attribute management_it_setup_type.



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

def management_it_setup_type
  @management_it_setup_type
end

#match_on_serial_number_flagObject

Returns the value of attribute match_on_serial_number_flag.



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

def match_on_serial_number_flag
  @match_on_serial_number_flag
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#portal_urlObject

Returns the value of attribute portal_url.



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

def portal_url
  @portal_url
end

#solutionObject

Returns the value of attribute solution.



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

def solution
  @solution
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'solution' => :'solution',
    :'portal_url' => :'portalUrl',
    :'login_by' => :'loginBy',
    :'global_login_username' => :'globalLoginUsername',
    :'global_login_password' => :'globalLoginPassword',
    :'default_billing_level' => :'defaultBillingLevel',
    :'management_it_setup_type' => :'managementItSetupType',
    :'default_location' => :'defaultLocation',
    :'default_department' => :'defaultDepartment',
    :'integrator_login' => :'integratorLogin',
    :'match_on_serial_number_flag' => :'matchOnSerialNumberFlag',
    :'disable_new_cross_references_flag' => :'disableNewCrossReferencesFlag',
    :'config_bill_customer_flag' => :'configBillCustomerFlag',
    :'_info' => :'_info'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'id' => :'Integer',
    :'name' => :'String',
    :'solution' => :'String',
    :'portal_url' => :'String',
    :'login_by' => :'String',
    :'global_login_username' => :'String',
    :'global_login_password' => :'String',
    :'default_billing_level' => :'String',
    :'management_it_setup_type' => :'String',
    :'default_location' => :'SystemLocationReference',
    :'default_department' => :'SystemDepartmentReference',
    :'integrator_login' => :'IntegratorLoginReference',
    :'match_on_serial_number_flag' => :'BOOLEAN',
    :'disable_new_cross_references_flag' => :'BOOLEAN',
    :'config_bill_customer_flag' => :'BOOLEAN',
    :'_info' => :'Metadata'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 327

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      solution == o.solution &&
      portal_url == o.portal_url &&
       == o. &&
       == o. &&
       == o. &&
      default_billing_level == o.default_billing_level &&
      management_it_setup_type == o.management_it_setup_type &&
      default_location == o.default_location &&
      default_department == o.default_department &&
       == o. &&
      match_on_serial_number_flag == o.match_on_serial_number_flag &&
      disable_new_cross_references_flag == o.disable_new_cross_references_flag &&
      config_bill_customer_flag == o.config_bill_customer_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



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
414
415
416
417
418
419
420
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 384

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



450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 450

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



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 363

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


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

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



356
357
358
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 356

def hash
  [id, name, solution, portal_url, , , , default_billing_level, management_it_setup_type, default_location, default_department, , match_on_serial_number_flag, disable_new_cross_references_flag, config_bill_customer_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



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

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

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

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

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

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

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

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

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

  if @default_billing_level.nil?
    invalid_properties.push("invalid value for 'default_billing_level', default_billing_level 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



430
431
432
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 430

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



436
437
438
439
440
441
442
443
444
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 436

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



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

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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/connectwise-ruby-sdk/models/managed_devices_integration.rb', line 227

def valid?
  return false if @name.nil?
  return false if @name.to_s.length > 30
  return false if @solution.nil?
  return false if @solution.to_s.length > 30
  return false if !@portal_url.nil? && @portal_url.to_s.length > 200
  return false if @login_by.nil?
   = EnumAttributeValidator.new('String', ["Member", "Global"])
  return false unless .valid?(@login_by)
  return false if !@global_login_username.nil? && @global_login_username.to_s.length > 50
  return false if !@global_login_password.nil? && @global_login_password.to_s.length > 50
  return false if @default_billing_level.nil?
  default_billing_level_validator = EnumAttributeValidator.new('String', ["Summary", "Detail"])
  return false unless default_billing_level_validator.valid?(@default_billing_level)
  return true
end