Class: ConnectWise::ManagedDevicesIntegration

Inherits:
Object
  • Object
show all
Defined in:
lib/connect_wise/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:

  • (defaults to: {})

    Model attributes in the form of hash

Raises:



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
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 116

def initialize(attributes = {})
  raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::ManagedDevicesIntegration` initialize method' unless attributes.is_a?(Hash)

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

    h[k.to_sym] = v
  end

  self.name = attributes[:name] if attributes.key?(:name)

  self.solution = attributes[:solution] if attributes.key?(:solution)

  self. = attributes[:login_by] if attributes.key?(:login_by)

  self.default_billing_level = attributes[:default_billing_level] if attributes.key?(:default_billing_level)

  self.id = attributes[:id] if attributes.key?(:id)

  self.portal_url = attributes[:portal_url] if attributes.key?(:portal_url)

  self. = attributes[:global_login_username] if attributes.key?(:global_login_username)

  self. = attributes[:global_login_password] if attributes.key?(:global_login_password)

  self.management_it_setup_type = attributes[:management_it_setup_type] if attributes.key?(:management_it_setup_type)

  self.default_location = attributes[:default_location] if attributes.key?(:default_location)

  self.default_department = attributes[:default_department] if attributes.key?(:default_department)

  self. = attributes[:integrator_login] if attributes.key?(:integrator_login)

  self.match_on_serial_number_flag = attributes[:match_on_serial_number_flag] if attributes.key?(:match_on_serial_number_flag)

  self.disable_new_cross_references_flag = attributes[:disable_new_cross_references_flag] if attributes.key?(:disable_new_cross_references_flag)

  self.config_bill_customer_flag = attributes[:config_bill_customer_flag] if attributes.key?(:config_bill_customer_flag)

  return unless attributes.key?(:_info)
  return unless (value = attributes[:_info]).is_a?(Hash)

  self._info = value
end

Instance Attribute Details

#_infoObject

Returns the value of attribute _info.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def _info
  @_info
end

#config_bill_customer_flagObject

Returns the value of attribute config_bill_customer_flag.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def config_bill_customer_flag
  @config_bill_customer_flag
end

#default_billing_levelObject

Returns the value of attribute default_billing_level.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def default_billing_level
  @default_billing_level
end

#default_departmentObject

Returns the value of attribute default_department.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def default_department
  @default_department
end

#default_locationObject

Returns the value of attribute default_location.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def default_location
  @default_location
end

#disable_new_cross_references_flagObject

Returns the value of attribute disable_new_cross_references_flag.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def disable_new_cross_references_flag
  @disable_new_cross_references_flag
end

#global_login_passwordObject

This is only required when globalLoginFlag = true Max length: 50;



31
32
33
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 31

def 
  
end

#global_login_usernameObject

This is only required when globalLoginFlag = true Max length: 50;



28
29
30
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 28

def 
  
end

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def id
  @id
end

#integrator_loginObject

Returns the value of attribute integrator_login.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def 
  
end

#login_byObject

Returns the value of attribute login_by.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def 
  @login_by
end

#management_it_setup_typeObject

Returns the value of attribute management_it_setup_type.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

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.



22
23
24
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 22

def match_on_serial_number_flag
  @match_on_serial_number_flag
end

#nameObject

Max length: 30;



17
18
19
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 17

def name
  @name
end

#portal_urlObject

Max length: 200;



25
26
27
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 25

def portal_url
  @portal_url
end

#solutionObject

Max length: 30;



20
21
22
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 20

def solution
  @solution
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



77
78
79
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 77

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 55

def self.attribute_map
  {
    name: :name,
    solution: :solution,
    login_by: :loginBy,
    default_billing_level: :defaultBillingLevel,
    id: :id,
    portal_url: :portalUrl,
    global_login_username: :globalLoginUsername,
    global_login_password: :globalLoginPassword,
    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

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



245
246
247
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 245

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



104
105
106
107
108
109
110
111
112
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 104

def self.openapi_nullable
  Set.new(i[
            
            default_billing_level
            match_on_serial_number_flag
            disable_new_cross_references_flag
            config_bill_customer_flag
          ])
end

.openapi_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 82

def self.openapi_types
  {
    name: :String,
    solution: :String,
    login_by: :String,
    default_billing_level: :String,
    id: :Integer,
    portal_url: :String,
    global_login_username: :String,
    global_login_password: :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: :'Hash<String, String>'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • to be compared



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 208

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    name == other.name &&
    solution == other.solution &&
     == other. &&
    default_billing_level == other.default_billing_level &&
    id == other.id &&
    portal_url == other.portal_url &&
     == other. &&
     == other. &&
    management_it_setup_type == other.management_it_setup_type &&
    default_location == other.default_location &&
    default_department == other.default_department &&
     == other. &&
    match_on_serial_number_flag == other.match_on_serial_number_flag &&
    disable_new_cross_references_flag == other.disable_new_cross_references_flag &&
    config_bill_customer_flag == other.config_bill_customer_flag &&
    _info == other._info
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type Data type

  • value Value to be deserialized

Returns:

  • Deserialized data



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
306
307
308
309
310
311
312
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 275

def _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 = ConnectWise.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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:

  • Any valid value

Returns:

  • Returns the value in the form of hash



346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 346

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:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 252

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      send("#{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
      send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array)
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • to be compared

Returns:

See Also:

  • `==` method


232
233
234
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 232

def eql?(other)
  self == other
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • Hash code



238
239
240
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 238

def hash
  [name, solution, , default_billing_level, id, portal_url, , , 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 properties with the reasons



164
165
166
167
168
169
170
171
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 164

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

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

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • Returns the object in the form of hash



322
323
324
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 322

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 328

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = 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 presentation of the object



316
317
318
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 316

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • true if the model is valid



175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/connect_wise/models/managed_devices_integration.rb', line 175

def valid?
  return false if @name.nil?
  return false if @solution.nil?

   = EnumAttributeValidator.new('String', %w[Global Member])
  return false unless .valid?(@login_by)

  default_billing_level_validator = EnumAttributeValidator.new('String', %w[Detail Summary])
  return false unless default_billing_level_validator.valid?(@default_billing_level)

  true
end