Class: ConnectWise::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Configuration

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize
  @scheme = 'https'
  @host = 'api-na.myconnectwise.net'
  @base_path = '/v4_6_release/apis/3.0'
  @api_key = {}
  @api_key_prefix = {}
  @timeout = 0
  @client_side_validation = true
  @verify_ssl = true
  @verify_ssl_host = true
  @params_encoding = nil
  @cert_file = nil
  @key_file = nil
  @debugging = false
  @inject_format = false
  @force_ending_format = false
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)

  yield(self) if block_given?
end

Instance Attribute Details

#_infoObject

Metadata of the entity



104
105
106
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 104

def _info
  @_info
end

#access_tokenObject

Defines the access token (Bearer) used with OAuth2.



48
49
50
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 48

def access_token
  @access_token
end

#active_flagObject

Returns the value of attribute active_flag.



93
94
95
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 93

def active_flag
  @active_flag
end

#api_keyHash

Defines API keys used with API Key authentications.

Examples:

parameter name is “api_key”, API key is “xxx” (e.g. “api_key=xxx” in query string)

config.api_key['api_key'] = 'xxx'

Returns:

  • (Hash)

    key: parameter name, value: parameter value (API key)



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

def api_key
  @api_key
end

#api_key_prefixHash

Defines API key prefixes used with API Key authentications.

Examples:

parameter name is “Authorization”, API key prefix is “Token” (e.g. “Authorization: Token xxx” in headers)

config.api_key_prefix['api_key'] = 'Token'

Returns:

  • (Hash)

    key: parameter name, value: API key prefix



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

def api_key_prefix
  @api_key_prefix
end

#backup_billable_space_gbObject

Returns the value of attribute backup_billable_space_gb.



63
64
65
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 63

def backup_billable_space_gb
  @backup_billable_space_gb
end

#backup_failedObject

Returns the value of attribute backup_failed.



55
56
57
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 55

def backup_failed
  @backup_failed
end

#backup_incompleteObject

Returns the value of attribute backup_incomplete.



53
54
55
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 53

def backup_incomplete
  @backup_incomplete
end

#backup_monthObject

Returns the value of attribute backup_month.



69
70
71
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 69

def backup_month
  @backup_month
end

#backup_protected_device_listObject

Returns the value of attribute backup_protected_device_list.



65
66
67
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 65

def backup_protected_device_list
  @backup_protected_device_list
end

#backup_restoresObject

Returns the value of attribute backup_restores.



57
58
59
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 57

def backup_restores
  @backup_restores
end

#backup_server_nameObject

Returns the value of attribute backup_server_name.



61
62
63
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 61

def backup_server_name
  @backup_server_name
end

#backup_successesObject

Returns the value of attribute backup_successes.



51
52
53
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 51

def backup_successes
  @backup_successes
end

#backup_yearObject

Returns the value of attribute backup_year.



67
68
69
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 67

def backup_year
  @backup_year
end

#base_pathObject

Defines url base path



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

def base_path
  @base_path
end

#bill_flagObject

Returns the value of attribute bill_flag.



49
50
51
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 49

def bill_flag
  @bill_flag
end

#business_unit_idObject

Returns the value of attribute business_unit_id.



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

def business_unit_id
  @business_unit_id
end

#cert_fileObject

TLS/SSL setting Client certificate file (for client certificate)



108
109
110
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 108

def cert_file
  @cert_file
end

#client_idString

Defines the clientId header to send with requests

Returns:

  • (String)


26
27
28
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 26

def client_id
  @client_id
end

#client_side_validationtrue, false

Set this to false to skip client side validation in the operation. Default to true.

Returns:

  • (true, false)


77
78
79
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 77

def client_side_validation
  @client_side_validation
end

#companyObject

Returns the value of attribute company.



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

def company
  @company
end

#contactObject

Returns the value of attribute contact.



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

def contact
  @contact
end

#cpu_speedObject

Returns the value of attribute cpu_speed.



79
80
81
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 79

def cpu_speed
  @cpu_speed
end

#custom_fieldsObject

Returns the value of attribute custom_fields.



108
109
110
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 108

def custom_fields
  @custom_fields
end

#debuggingtrue, false

Set this to enable/disable debugging. When enabled (set to true), HTTP request/response details will be logged with `logger.debug` (see the `logger` attribute). Default to false.

Returns:

  • (true, false)


55
56
57
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 55

def debugging
  @debugging
end

#default_gatewayObject

Returns the value of attribute default_gateway.



73
74
75
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 73

def default_gateway
  @default_gateway
end

#device_identifierObject

Returns the value of attribute device_identifier.



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

def device_identifier
  @device_identifier
end

#display_vendor_flagObject

Returns the value of attribute display_vendor_flag.



106
107
108
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 106

def display_vendor_flag
  @display_vendor_flag
end

#force_ending_formatObject

Returns the value of attribute force_ending_format.



123
124
125
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 123

def force_ending_format
  @force_ending_format
end

#hostObject

Defines url host



10
11
12
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 10

def host
  @host
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#inject_formatObject

Returns the value of attribute inject_format.



121
122
123
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 121

def inject_format
  @inject_format
end

#installation_dateObject

Returns the value of attribute installation_date.



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

def installation_date
  @installation_date
end

#installed_byObject

Returns the value of attribute installed_by.



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

def installed_by
  @installed_by
end

#ip_addressObject

Returns the value of attribute ip_address.



71
72
73
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 71

def ip_address
  @ip_address
end

#key_fileObject

TLS/SSL setting Client private key file (for client certificate)



112
113
114
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 112

def key_file
  @key_file
end

#last_backup_dateObject

Returns the value of attribute last_backup_date.



59
60
61
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 59

def last_backup_date
  @last_backup_date
end

#last_login_nameObject

Returns the value of attribute last_login_name.



47
48
49
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 47

def 
  @last_login_name
end

#local_hard_drivesObject

Returns the value of attribute local_hard_drives.



83
84
85
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 83

def local_hard_drives
  @local_hard_drives
end

#location_idObject

Returns the value of attribute location_id.



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

def location_id
  @location_id
end

#logger#debug

Defines the logger used for debugging. Default to `Rails.logger` (when in Rails) or logging to STDOUT.

Returns:

  • (#debug)


61
62
63
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 61

def logger
  @logger
end

#mac_addressObject

Returns the value of attribute mac_address.



45
46
47
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 45

def mac_address
  @mac_address
end

Returns the value of attribute management_link.



95
96
97
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 95

def management_link
  @management_link
end

#manufacturerObject

Returns the value of attribute manufacturer.



89
90
91
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 89

def manufacturer
  @manufacturer
end

#mobile_guidObject

Returns the value of attribute mobile_guid.



101
102
103
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 101

def mobile_guid
  @mobile_guid
end

#model_numberObject

Returns the value of attribute model_number.



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

def model_number
  @model_number
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#notesObject

Returns the value of attribute notes.



43
44
45
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 43

def notes
  @notes
end

#os_infoObject

Returns the value of attribute os_info.



77
78
79
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 77

def os_info
  @os_info
end

#os_typeObject

Returns the value of attribute os_type.



75
76
77
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 75

def os_type
  @os_type
end

#params_encodingObject

Set this to customize parameters encoding of array parameter with multi collectionFormat. Default to nil.

github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96

See Also:

  • params_encoding option of Ethon. Related source code:


119
120
121
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 119

def params_encoding
  @params_encoding
end

#parent_configuration_idObject

Returns the value of attribute parent_configuration_id.



85
86
87
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 85

def parent_configuration_id
  @parent_configuration_id
end

#passwordString

Defines the password used with HTTP basic authentication.

Returns:

  • (String)


45
46
47
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 45

def password
  @password
end

#purchase_dateObject

Returns the value of attribute purchase_date.



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

def purchase_date
  @purchase_date
end

#questionsObject

Returns the value of attribute questions.



91
92
93
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 91

def questions
  @questions
end

#ramObject

Returns the value of attribute ram.



81
82
83
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 81

def ram
  @ram
end

Returns the value of attribute remote_link.



97
98
99
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 97

def remote_link
  @remote_link
end

#schemeObject

Defines url scheme



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

def scheme
  @scheme
end

#serial_numberObject

Returns the value of attribute serial_number.



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

def serial_number
  @serial_number
end

#siteObject

Returns the value of attribute site.



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

def site
  @site
end

#slaObject

Returns the value of attribute sla.



99
100
101
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 99

def sla
  @sla
end

#ssl_ca_certString

TLS/SSL setting Set this to customize the certificate file to verify the peer.

github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145

Returns:

  • (String)

    the path to the certificate file

See Also:

  • `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:


104
105
106
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 104

def ssl_ca_cert
  @ssl_ca_cert
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#tag_numberObject

Returns the value of attribute tag_number.



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

def tag_number
  @tag_number
end

#temp_folder_pathString

Defines the temporary folder to store downloaded files (for API endpoints that have file response). Default to use `Tempfile`.

Returns:

  • (String)


68
69
70
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 68

def temp_folder_path
  @temp_folder_path
end

#timeoutObject

The time limit for HTTP request in seconds. Default to 0 (never times out).



72
73
74
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 72

def timeout
  @timeout
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#usernameString

Defines the username used with HTTP basic authentication.

Returns:

  • (String)


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

def username
  @username
end

#vendorObject

Returns the value of attribute vendor.



87
88
89
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 87

def vendor
  @vendor
end

#vendor_notesObject

Returns the value of attribute vendor_notes.



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

def vendor_notes
  @vendor_notes
end

#verify_ssltrue, false

Note:

Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.

TLS/SSL setting Set this to false to skip verifying SSL certificate when calling API from https server. Default to true.

Returns:

  • (true, false)


86
87
88
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 86

def verify_ssl
  @verify_ssl
end

#verify_ssl_hosttrue, false

Note:

Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.

TLS/SSL setting Set this to false to skip verifying SSL host name Default to true.

Returns:

  • (true, false)


95
96
97
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 95

def verify_ssl_host
  @verify_ssl_host
end

#warranty_expiration_dateObject

Returns the value of attribute warranty_expiration_date.



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

def warranty_expiration_date
  @warranty_expiration_date
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'type' => :'type',
    :'status' => :'status',
    :'company' => :'company',
    :'contact' => :'contact',
    :'site' => :'site',
    :'location_id' => :'locationId',
    :'business_unit_id' => :'businessUnitId',
    :'device_identifier' => :'deviceIdentifier',
    :'serial_number' => :'serialNumber',
    :'model_number' => :'modelNumber',
    :'tag_number' => :'tagNumber',
    :'purchase_date' => :'purchaseDate',
    :'installation_date' => :'installationDate',
    :'installed_by' => :'installedBy',
    :'warranty_expiration_date' => :'warrantyExpirationDate',
    :'vendor_notes' => :'vendorNotes',
    :'notes' => :'notes',
    :'mac_address' => :'macAddress',
    :'last_login_name' => :'lastLoginName',
    :'bill_flag' => :'billFlag',
    :'backup_successes' => :'backupSuccesses',
    :'backup_incomplete' => :'backupIncomplete',
    :'backup_failed' => :'backupFailed',
    :'backup_restores' => :'backupRestores',
    :'last_backup_date' => :'lastBackupDate',
    :'backup_server_name' => :'backupServerName',
    :'backup_billable_space_gb' => :'backupBillableSpaceGb',
    :'backup_protected_device_list' => :'backupProtectedDeviceList',
    :'backup_year' => :'backupYear',
    :'backup_month' => :'backupMonth',
    :'ip_address' => :'ipAddress',
    :'default_gateway' => :'defaultGateway',
    :'os_type' => :'osType',
    :'os_info' => :'osInfo',
    :'cpu_speed' => :'cpuSpeed',
    :'ram' => :'ram',
    :'local_hard_drives' => :'localHardDrives',
    :'parent_configuration_id' => :'parentConfigurationId',
    :'vendor' => :'vendor',
    :'manufacturer' => :'manufacturer',
    :'questions' => :'questions',
    :'active_flag' => :'activeFlag',
    :'management_link' => :'managementLink',
    :'remote_link' => :'remoteLink',
    :'sla' => :'sla',
    :'mobile_guid' => :'mobileGuid',
    :'_info' => :'_info',
    :'display_vendor_flag' => :'displayVendorFlag',
    :'custom_fields' => :'customFields'
  }
end

.defaultObject

The default Configuration object.



147
148
149
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 147

def self.default
  @@default ||= Configuration.new
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'id' => :'Integer',
    :'name' => :'String',
    :'type' => :'ConfigurationTypeReference',
    :'status' => :'ConfigurationStatusReference',
    :'company' => :'CompanyReference',
    :'contact' => :'ContactReference',
    :'site' => :'SiteReference',
    :'location_id' => :'Integer',
    :'business_unit_id' => :'Integer',
    :'device_identifier' => :'String',
    :'serial_number' => :'String',
    :'model_number' => :'String',
    :'tag_number' => :'String',
    :'purchase_date' => :'DateTime',
    :'installation_date' => :'DateTime',
    :'installed_by' => :'MemberReference',
    :'warranty_expiration_date' => :'DateTime',
    :'vendor_notes' => :'String',
    :'notes' => :'String',
    :'mac_address' => :'String',
    :'last_login_name' => :'String',
    :'bill_flag' => :'BOOLEAN',
    :'backup_successes' => :'Integer',
    :'backup_incomplete' => :'Integer',
    :'backup_failed' => :'Integer',
    :'backup_restores' => :'Integer',
    :'last_backup_date' => :'DateTime',
    :'backup_server_name' => :'String',
    :'backup_billable_space_gb' => :'Float',
    :'backup_protected_device_list' => :'String',
    :'backup_year' => :'Integer',
    :'backup_month' => :'Integer',
    :'ip_address' => :'String',
    :'default_gateway' => :'String',
    :'os_type' => :'String',
    :'os_info' => :'String',
    :'cpu_speed' => :'String',
    :'ram' => :'String',
    :'local_hard_drives' => :'String',
    :'parent_configuration_id' => :'Integer',
    :'vendor' => :'CompanyReference',
    :'manufacturer' => :'ManufacturerReference',
    :'questions' => :'Array<ConfigurationQuestion>',
    :'active_flag' => :'BOOLEAN',
    :'management_link' => :'String',
    :'remote_link' => :'String',
    :'sla' => :'SLAReference',
    :'mobile_guid' => :'Guid',
    :'_info' => :'Metadata',
    :'display_vendor_flag' => :'BOOLEAN',
    :'custom_fields' => :'Array<CustomFieldValue>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 732

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      type == o.type &&
      status == o.status &&
      company == o.company &&
      contact == o.contact &&
      site == o.site &&
      location_id == o.location_id &&
      business_unit_id == o.business_unit_id &&
      device_identifier == o.device_identifier &&
      serial_number == o.serial_number &&
      model_number == o.model_number &&
      tag_number == o.tag_number &&
      purchase_date == o.purchase_date &&
      installation_date == o.installation_date &&
      installed_by == o.installed_by &&
      warranty_expiration_date == o.warranty_expiration_date &&
      vendor_notes == o.vendor_notes &&
      notes == o.notes &&
      mac_address == o.mac_address &&
       == o. &&
      bill_flag == o.bill_flag &&
      backup_successes == o.backup_successes &&
      backup_incomplete == o.backup_incomplete &&
      backup_failed == o.backup_failed &&
      backup_restores == o.backup_restores &&
      last_backup_date == o.last_backup_date &&
      backup_server_name == o.backup_server_name &&
      backup_billable_space_gb == o.backup_billable_space_gb &&
      backup_protected_device_list == o.backup_protected_device_list &&
      backup_year == o.backup_year &&
      backup_month == o.backup_month &&
      ip_address == o.ip_address &&
      default_gateway == o.default_gateway &&
      os_type == o.os_type &&
      os_info == o.os_info &&
      cpu_speed == o.cpu_speed &&
      ram == o.ram &&
      local_hard_drives == o.local_hard_drives &&
      parent_configuration_id == o.parent_configuration_id &&
      vendor == o.vendor &&
      manufacturer == o.manufacturer &&
      questions == o.questions &&
      active_flag == o.active_flag &&
      management_link == o.management_link &&
      remote_link == o.remote_link &&
      sla == o.sla &&
      mobile_guid == o.mobile_guid &&
      _info == o._info &&
      display_vendor_flag == o.display_vendor_flag &&
      custom_fields == o.custom_fields
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



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 824

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



890
891
892
893
894
895
896
897
898
899
900
901
902
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 890

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

#api_key_with_prefix(param_name) ⇒ Object

Gets API key (with prefix if set).

Parameters:

  • param_name (String)

    the parameter name of API key auth



178
179
180
181
182
183
184
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 178

def api_key_with_prefix(param_name)
  if @api_key_prefix[param_name]
    "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
  else
    @api_key[param_name]
  end
end

#auth_settingsObject

Returns Auth Settings hash for api client.



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 192

def auth_settings
  {
    'BasicAuth' =>
      {
        type: 'basic',
        in: 'header',
        key: 'Authorization',
        value: basic_auth_token
      },
  }
end

#base_urlObject



171
172
173
174
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 171

def base_url
  url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
  URI.encode(url)
end

#basic_auth_tokenObject

Gets Basic Auth token string



187
188
189
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 187

def basic_auth_token
  'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
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



803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 803

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

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



151
152
153
# File 'lib/connectwise-ruby-sdk/configuration.rb', line 151

def configure
  yield(self) if block_given?
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


790
791
792
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 790

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



796
797
798
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 796

def hash
  [id, name, type, status, company, contact, site, location_id, business_unit_id, device_identifier, serial_number, model_number, tag_number, purchase_date, installation_date, installed_by, warranty_expiration_date, vendor_notes, notes, mac_address, , bill_flag, backup_successes, backup_incomplete, backup_failed, backup_restores, last_backup_date, backup_server_name, backup_billable_space_gb, backup_protected_device_list, backup_year, backup_month, ip_address, default_gateway, os_type, os_info, cpu_speed, ram, local_hard_drives, parent_configuration_id, vendor, manufacturer, questions, active_flag, management_link, remote_link, sla, mobile_guid, _info, display_vendor_flag, custom_fields].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 445

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 > 100
    invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 100.")
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if !@remote_link.nil? && @remote_link.to_s.length > 200
    invalid_properties.push("invalid value for 'remote_link', the character length must be smaller than or equal to 200.")
  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



870
871
872
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 870

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



876
877
878
879
880
881
882
883
884
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 876

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



864
865
866
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 864

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



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/connectwise-ruby-sdk/models/configuration.rb', line 528

def valid?
  return false if @name.nil?
  return false if @name.to_s.length > 100
  return false if @type.nil?
  return false if @company.nil?
  return false if !@device_identifier.nil? && @device_identifier.to_s.length > 100
  return false if !@serial_number.nil? && @serial_number.to_s.length > 250
  return false if !@model_number.nil? && @model_number.to_s.length > 50
  return false if !@tag_number.nil? && @tag_number.to_s.length > 50
  return false if !@mac_address.nil? && @mac_address.to_s.length > 25
  return false if !@last_login_name.nil? && @last_login_name.to_s.length > 100
  return false if !@backup_server_name.nil? && @backup_server_name.to_s.length > 50
  return false if !@ip_address.nil? && @ip_address.to_s.length > 50
  return false if !@default_gateway.nil? && @default_gateway.to_s.length > 50
  return false if !@os_type.nil? && @os_type.to_s.length > 250
  return false if !@os_info.nil? && @os_info.to_s.length > 250
  return false if !@cpu_speed.nil? && @cpu_speed.to_s.length > 100
  return false if !@ram.nil? && @ram.to_s.length > 25
  return false if !@management_link.nil? && @management_link.to_s.length > 200
  return false if !@remote_link.nil? && @remote_link.to_s.length > 200
  return true
end