connectwise-ruby-sdk 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +9 -0
- data/LICENSE +1 -1
- data/README.md +12 -7
- data/Rakefile +6 -0
- data/docs/DocumentsApi.md +8 -10
- data/lib/connectwise-ruby-sdk/api/documents_api.rb +57 -57
- data/lib/connectwise-ruby-sdk/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 693dac62ab48c81c4fc9486069d42c9df66915a3
|
4
|
+
data.tar.gz: b5eb248ae134808659738091df5512eb28356612
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '008e558815ed949b735f5dd5b3d2add15b692606adb794b559a584ad5a767b726a001e3007868983af887b24092e8052e1f4821b19607b2cb994bc6da414ff01'
|
7
|
+
data.tar.gz: 33521b2b1bbb216cf190ed6979428f4830d450ec5f4664144e974df7ffc4f9a13ff441233c5ce0f261fcdc8c14279e174e6b05cc9685dd7570ea9f4f26071160
|
data/Gemfile
ADDED
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright 2016 Cameron Sowder
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
# connectwise-ruby-sdk
|
2
|
+
[![Build Status](https://travis-ci.org/sowderca/connectwise-ruby-sdk.svg?branch=master)](https://travis-ci.org/sowderca/connectwise-ruby-sdk)
|
3
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/sowderca/connectwise-ruby-sdk.svg)](https://gemnasium.com/github.com/sowderca/connectwise-ruby-sdk)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/connectwise-ruby-sdk.svg)](https://badge.fury.io/rb/connectwise-ruby-sdk)
|
5
|
+
[![Gem](https://img.shields.io/gem/dt/connectwise-ruby-sdk.svg)](https://rubygems.org/gems/connectwise-ruby-sdk)
|
2
6
|
|
3
|
-
|
4
|
-
|
5
|
-
ConnectWise API
|
7
|
+
connectwise-ruby-sdk - the Ruby gem for the Connectwise REST API
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
9
11
|
Then either install the gem locally:
|
10
12
|
|
11
13
|
```shell
|
12
|
-
gem install
|
14
|
+
gem install connectwise-ruby-sdk-1.0.2
|
13
15
|
```
|
14
16
|
|
15
17
|
Or install from [RubyGems](https://rubygems.org/).
|
@@ -20,7 +22,7 @@ Add this to the Gemfile:
|
|
20
22
|
```
|
21
23
|
### Install from Git
|
22
24
|
```ruby
|
23
|
-
gem 'connectwise-ruby-sdk', :git => 'https://github.com/
|
25
|
+
gem 'connectwise-ruby-sdk', :git => 'https://github.com/sowderca/connectwise-ruby-sdk'
|
24
26
|
```
|
25
27
|
### Include the Ruby code directly
|
26
28
|
|
@@ -40,8 +42,11 @@ require 'connectwise-ruby-sdk'
|
|
40
42
|
# Setup authorization
|
41
43
|
Connectwise.configure do |config|
|
42
44
|
# Configure HTTP basic authorization: BasicAuth
|
43
|
-
config.username = '
|
44
|
-
config.password = '
|
45
|
+
config.username = 'USERNAME' # in the form of company_id+public_api_key
|
46
|
+
config.password = 'PASSWORD' # private_api_key
|
47
|
+
config.host = 'URL' # your connectwise url
|
48
|
+
config.base_path = '/v4_6_release/apis/3.0'
|
49
|
+
config.scheme = 'https'
|
45
50
|
end
|
46
51
|
|
47
52
|
api_instance = Connectwise::AccountingBatchTransactionsApi.new
|
data/Rakefile
ADDED
data/docs/DocumentsApi.md
CHANGED
@@ -314,16 +314,15 @@ record_type = "record_type_example" # String | Entity type
|
|
314
314
|
|
315
315
|
title = "title_example" # String | Document title
|
316
316
|
|
317
|
-
url = "url_example" # String | Document url
|
318
|
-
|
319
317
|
opts = {
|
320
|
-
|
318
|
+
url: "//path/to/file", # String | Url of file to attach
|
319
|
+
file: File.open("/path/to/file.txt"), # File | File to upload
|
321
320
|
private_flag: true, # BOOLEAN | Indicates if document is private
|
322
321
|
read_only_flag: true # BOOLEAN | Indicates if document is readonly
|
323
322
|
}
|
324
323
|
|
325
324
|
begin
|
326
|
-
result = api_instance.system_documents_id_post(id, record_id, record_type, title,
|
325
|
+
result = api_instance.system_documents_id_post(id, record_id, record_type, title, opts)
|
327
326
|
p result
|
328
327
|
rescue Connectwise::ApiError => e
|
329
328
|
puts "Exception when calling DocumentsApi->system_documents_id_post: #{e}"
|
@@ -338,8 +337,8 @@ Name | Type | Description | Notes
|
|
338
337
|
**record_id** | **Integer**| Entity id |
|
339
338
|
**record_type** | **String**| Entity type |
|
340
339
|
**title** | **String**| Document title |
|
341
|
-
**url** | **String**| Document url |
|
342
|
-
**file** | **File**| File to upload | [optional]
|
340
|
+
**url** | **String**| Document url | [optional if file present]
|
341
|
+
**file** | **File**| File to upload | [optional if url present]
|
343
342
|
**private_flag** | **BOOLEAN**| Indicates if document is private | [optional]
|
344
343
|
**read_only_flag** | **BOOLEAN**| Indicates if document is readonly | [optional]
|
345
344
|
|
@@ -384,16 +383,15 @@ record_type = "record_type_example" # String | Entity type
|
|
384
383
|
|
385
384
|
title = "title_example" # String | Document title
|
386
385
|
|
387
|
-
url = "url_example" # String | Document url
|
388
|
-
|
389
386
|
opts = {
|
390
|
-
|
387
|
+
url: "//path/to/file", # String | Document url
|
388
|
+
file: File.open("/path/to/file.txt"), # File | File to upload
|
391
389
|
private_flag: true, # BOOLEAN | Indicates if document is private
|
392
390
|
read_only_flag: true # BOOLEAN | Indicates if document is readonly
|
393
391
|
}
|
394
392
|
|
395
393
|
begin
|
396
|
-
result = api_instance.system_documents_post(record_id, record_type, title,
|
394
|
+
result = api_instance.system_documents_post(record_id, record_type, title, opts)
|
397
395
|
p result
|
398
396
|
rescue Connectwise::ApiError => e
|
399
397
|
puts "Exception when calling DocumentsApi->system_documents_post: #{e}"
|
@@ -31,22 +31,22 @@ module Connectwise
|
|
31
31
|
@api_client = api_client
|
32
32
|
end
|
33
33
|
|
34
|
-
#
|
34
|
+
#
|
35
35
|
# Get Documents Info Count
|
36
36
|
# @param [Hash] opts the optional parameters
|
37
|
-
# @option opts [String] :record_type
|
38
|
-
# @option opts [Integer] :record_id
|
37
|
+
# @option opts [String] :record_type
|
38
|
+
# @option opts [Integer] :record_id
|
39
39
|
# @return [Count]
|
40
40
|
def system_documents_count_get(opts = {})
|
41
41
|
data, _status_code, _headers = system_documents_count_get_with_http_info(opts)
|
42
42
|
return data
|
43
43
|
end
|
44
44
|
|
45
|
-
#
|
45
|
+
#
|
46
46
|
# Get Documents Info Count
|
47
47
|
# @param [Hash] opts the optional parameters
|
48
|
-
# @option opts [String] :record_type
|
49
|
-
# @option opts [Integer] :record_id
|
48
|
+
# @option opts [String] :record_type
|
49
|
+
# @option opts [Integer] :record_id
|
50
50
|
# @return [Array<(Count, Fixnum, Hash)>] Count data, response status code and response headers
|
51
51
|
def system_documents_count_get_with_http_info(opts = {})
|
52
52
|
if @api_client.config.debugging
|
@@ -93,26 +93,26 @@ module Connectwise
|
|
93
93
|
return data, status_code, headers
|
94
94
|
end
|
95
95
|
|
96
|
-
#
|
96
|
+
#
|
97
97
|
# Get Documents Info
|
98
98
|
# @param [Hash] opts the optional parameters
|
99
|
-
# @option opts [String] :record_type
|
100
|
-
# @option opts [Integer] :record_id
|
101
|
-
# @option opts [Integer] :page
|
102
|
-
# @option opts [Integer] :page_size
|
99
|
+
# @option opts [String] :record_type
|
100
|
+
# @option opts [Integer] :record_id
|
101
|
+
# @option opts [Integer] :page
|
102
|
+
# @option opts [Integer] :page_size
|
103
103
|
# @return [Array<DocumentInfo>]
|
104
104
|
def system_documents_get(opts = {})
|
105
105
|
data, _status_code, _headers = system_documents_get_with_http_info(opts)
|
106
106
|
return data
|
107
107
|
end
|
108
108
|
|
109
|
-
#
|
109
|
+
#
|
110
110
|
# Get Documents Info
|
111
111
|
# @param [Hash] opts the optional parameters
|
112
|
-
# @option opts [String] :record_type
|
113
|
-
# @option opts [Integer] :record_id
|
114
|
-
# @option opts [Integer] :page
|
115
|
-
# @option opts [Integer] :page_size
|
112
|
+
# @option opts [String] :record_type
|
113
|
+
# @option opts [Integer] :record_id
|
114
|
+
# @option opts [Integer] :page
|
115
|
+
# @option opts [Integer] :page_size
|
116
116
|
# @return [Array<(Array<DocumentInfo>, Fixnum, Hash)>] Array<DocumentInfo> data, response status code and response headers
|
117
117
|
def system_documents_get_with_http_info(opts = {})
|
118
118
|
if @api_client.config.debugging
|
@@ -161,9 +161,9 @@ module Connectwise
|
|
161
161
|
return data, status_code, headers
|
162
162
|
end
|
163
163
|
|
164
|
-
#
|
164
|
+
#
|
165
165
|
# Delete Document Info By Id
|
166
|
-
# @param id
|
166
|
+
# @param id
|
167
167
|
# @param [Hash] opts the optional parameters
|
168
168
|
# @return [nil]
|
169
169
|
def system_documents_id_delete(id, opts = {})
|
@@ -171,9 +171,9 @@ module Connectwise
|
|
171
171
|
return nil
|
172
172
|
end
|
173
173
|
|
174
|
-
#
|
174
|
+
#
|
175
175
|
# Delete Document Info By Id
|
176
|
-
# @param id
|
176
|
+
# @param id
|
177
177
|
# @param [Hash] opts the optional parameters
|
178
178
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
179
179
|
def system_documents_id_delete_with_http_info(id, opts = {})
|
@@ -217,22 +217,22 @@ module Connectwise
|
|
217
217
|
return data, status_code, headers
|
218
218
|
end
|
219
219
|
|
220
|
-
#
|
220
|
+
#
|
221
221
|
# Download Document
|
222
|
-
# @param id
|
222
|
+
# @param id
|
223
223
|
# @param [Hash] opts the optional parameters
|
224
|
-
# @option opts [String] :last_modified
|
224
|
+
# @option opts [String] :last_modified
|
225
225
|
# @return [nil]
|
226
226
|
def system_documents_id_download_get(id, opts = {})
|
227
227
|
system_documents_id_download_get_with_http_info(id, opts)
|
228
228
|
return nil
|
229
229
|
end
|
230
230
|
|
231
|
-
#
|
231
|
+
#
|
232
232
|
# Download Document
|
233
|
-
# @param id
|
233
|
+
# @param id
|
234
234
|
# @param [Hash] opts the optional parameters
|
235
|
-
# @option opts [String] :last_modified
|
235
|
+
# @option opts [String] :last_modified
|
236
236
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
237
237
|
def system_documents_id_download_get_with_http_info(id, opts = {})
|
238
238
|
if @api_client.config.debugging
|
@@ -276,9 +276,9 @@ module Connectwise
|
|
276
276
|
return data, status_code, headers
|
277
277
|
end
|
278
278
|
|
279
|
-
#
|
279
|
+
#
|
280
280
|
# Get Document Info By Id
|
281
|
-
# @param id
|
281
|
+
# @param id
|
282
282
|
# @param [Hash] opts the optional parameters
|
283
283
|
# @return [DocumentInfo]
|
284
284
|
def system_documents_id_get(id, opts = {})
|
@@ -286,9 +286,9 @@ module Connectwise
|
|
286
286
|
return data
|
287
287
|
end
|
288
288
|
|
289
|
-
#
|
289
|
+
#
|
290
290
|
# Get Document Info By Id
|
291
|
-
# @param id
|
291
|
+
# @param id
|
292
292
|
# @param [Hash] opts the optional parameters
|
293
293
|
# @return [Array<(DocumentInfo, Fixnum, Hash)>] DocumentInfo data, response status code and response headers
|
294
294
|
def system_documents_id_get_with_http_info(id, opts = {})
|
@@ -333,36 +333,36 @@ module Connectwise
|
|
333
333
|
return data, status_code, headers
|
334
334
|
end
|
335
335
|
|
336
|
-
#
|
336
|
+
#
|
337
337
|
# Update Document By Id
|
338
|
-
# @param id
|
338
|
+
# @param id
|
339
339
|
# @param record_id Entity id
|
340
340
|
# @param record_type Entity type
|
341
341
|
# @param title Document title
|
342
|
-
# @param url Document url
|
343
342
|
# @param [Hash] opts the optional parameters
|
343
|
+
# @option opts [String] :url Document url
|
344
344
|
# @option opts [File] :file File to upload
|
345
345
|
# @option opts [BOOLEAN] :private_flag Indicates if document is private
|
346
346
|
# @option opts [BOOLEAN] :read_only_flag Indicates if document is readonly
|
347
347
|
# @return [DocumentInfo]
|
348
|
-
def system_documents_id_post(id, record_id, record_type, title,
|
349
|
-
data, _status_code, _headers = system_documents_id_post_with_http_info(id, record_id, record_type, title,
|
348
|
+
def system_documents_id_post(id, record_id, record_type, title, opts = {})
|
349
|
+
data, _status_code, _headers = system_documents_id_post_with_http_info(id, record_id, record_type, title, opts)
|
350
350
|
return data
|
351
351
|
end
|
352
352
|
|
353
|
-
#
|
353
|
+
#
|
354
354
|
# Update Document By Id
|
355
|
-
# @param id
|
355
|
+
# @param id
|
356
356
|
# @param record_id Entity id
|
357
357
|
# @param record_type Entity type
|
358
358
|
# @param title Document title
|
359
|
-
# @param url Document url
|
360
359
|
# @param [Hash] opts the optional parameters
|
360
|
+
# @option opts [String] :url Document url
|
361
361
|
# @option opts [File] :file File to upload
|
362
362
|
# @option opts [BOOLEAN] :private_flag Indicates if document is private
|
363
363
|
# @option opts [BOOLEAN] :read_only_flag Indicates if document is readonly
|
364
364
|
# @return [Array<(DocumentInfo, Fixnum, Hash)>] DocumentInfo data, response status code and response headers
|
365
|
-
def system_documents_id_post_with_http_info(id, record_id, record_type, title,
|
365
|
+
def system_documents_id_post_with_http_info(id, record_id, record_type, title, opts = {})
|
366
366
|
if @api_client.config.debugging
|
367
367
|
@api_client.config.logger.debug "Calling API: DocumentsApi.system_documents_id_post ..."
|
368
368
|
end
|
@@ -382,9 +382,9 @@ module Connectwise
|
|
382
382
|
fail ArgumentError, 'invalid value for "title" when calling DocumentsApi.system_documents_id_post, the character length must be smaller than or equal to 100.'
|
383
383
|
end
|
384
384
|
|
385
|
-
# verify the required parameter 'url' is set
|
386
|
-
fail ArgumentError, "Missing the required
|
387
|
-
if url.to_s.length > 500
|
385
|
+
# verify the required parameter 'url' or 'file' is set
|
386
|
+
fail ArgumentError, "Missing the required options 'url' or 'file' when calling DocumentsApi.system_documents_id_post" if opts[:url].nil? && opts[:file].nil?
|
387
|
+
if opts[:url] && opts[:url].to_s.length > 500
|
388
388
|
fail ArgumentError, 'invalid value for "url" when calling DocumentsApi.system_documents_id_post, the character length must be smaller than or equal to 500.'
|
389
389
|
end
|
390
390
|
|
@@ -410,7 +410,7 @@ module Connectwise
|
|
410
410
|
form_params["recordId"] = record_id
|
411
411
|
form_params["recordType"] = record_type
|
412
412
|
form_params["title"] = title
|
413
|
-
form_params["url"] = url
|
413
|
+
form_params["url"] = opts[:url] unless opts[:url].nil?
|
414
414
|
form_params["file"] = opts[:'file'] if !opts[:'file'].nil?
|
415
415
|
form_params["privateFlag"] = opts[:'private_flag'] if !opts[:'private_flag'].nil?
|
416
416
|
form_params["readOnlyFlag"] = opts[:'read_only_flag'] if !opts[:'read_only_flag'].nil?
|
@@ -431,34 +431,34 @@ module Connectwise
|
|
431
431
|
return data, status_code, headers
|
432
432
|
end
|
433
433
|
|
434
|
-
#
|
434
|
+
#
|
435
435
|
# Insert Document
|
436
436
|
# @param record_id Entity id
|
437
437
|
# @param record_type Entity type
|
438
438
|
# @param title Document title
|
439
|
-
# @param url Document url
|
440
439
|
# @param [Hash] opts the optional parameters
|
440
|
+
# @option opts [String] :url Document url
|
441
441
|
# @option opts [File] :file File to upload
|
442
442
|
# @option opts [BOOLEAN] :private_flag Indicates if document is private
|
443
443
|
# @option opts [BOOLEAN] :read_only_flag Indicates if document is readonly
|
444
444
|
# @return [DocumentInfo]
|
445
|
-
def system_documents_post(record_id, record_type, title,
|
446
|
-
data, _status_code, _headers = system_documents_post_with_http_info(record_id, record_type, title,
|
445
|
+
def system_documents_post(record_id, record_type, title, opts = {})
|
446
|
+
data, _status_code, _headers = system_documents_post_with_http_info(record_id, record_type, title, opts)
|
447
447
|
return data
|
448
448
|
end
|
449
449
|
|
450
|
-
#
|
450
|
+
#
|
451
451
|
# Insert Document
|
452
452
|
# @param record_id Entity id
|
453
453
|
# @param record_type Entity type
|
454
454
|
# @param title Document title
|
455
|
-
# @param url Document url
|
456
455
|
# @param [Hash] opts the optional parameters
|
456
|
+
# @option opts [String] :url Document url
|
457
457
|
# @option opts [File] :file File to upload
|
458
458
|
# @option opts [BOOLEAN] :private_flag Indicates if document is private
|
459
459
|
# @option opts [BOOLEAN] :read_only_flag Indicates if document is readonly
|
460
460
|
# @return [Array<(DocumentInfo, Fixnum, Hash)>] DocumentInfo data, response status code and response headers
|
461
|
-
def system_documents_post_with_http_info(record_id, record_type, title,
|
461
|
+
def system_documents_post_with_http_info(record_id, record_type, title, opts = {})
|
462
462
|
if @api_client.config.debugging
|
463
463
|
@api_client.config.logger.debug "Calling API: DocumentsApi.system_documents_post ..."
|
464
464
|
end
|
@@ -476,10 +476,10 @@ module Connectwise
|
|
476
476
|
fail ArgumentError, 'invalid value for "title" when calling DocumentsApi.system_documents_post, the character length must be smaller than or equal to 100.'
|
477
477
|
end
|
478
478
|
|
479
|
-
# verify the required parameter 'url' is set
|
480
|
-
fail ArgumentError, "Missing the required
|
481
|
-
if url.to_s.length > 500
|
482
|
-
fail ArgumentError, 'invalid value for "url" when calling DocumentsApi.
|
479
|
+
# verify the required parameter 'url' or 'file' is set
|
480
|
+
fail ArgumentError, "Missing the required options 'url' or 'file' when calling DocumentsApi.system_documents_id_post" if opts[:url].nil? && opts[:file].nil?
|
481
|
+
if opts[:url] && opts[:url].to_s.length > 500
|
482
|
+
fail ArgumentError, 'invalid value for "url" when calling DocumentsApi.system_documents_id_post, the character length must be smaller than or equal to 500.'
|
483
483
|
end
|
484
484
|
|
485
485
|
# resource path
|
@@ -504,7 +504,7 @@ module Connectwise
|
|
504
504
|
form_params["recordId"] = record_id
|
505
505
|
form_params["recordType"] = record_type
|
506
506
|
form_params["title"] = title
|
507
|
-
form_params["url"] = url
|
507
|
+
form_params["url"] = opts[:url] unless opts[:url].nil?
|
508
508
|
form_params["file"] = opts[:'file'] if !opts[:'file'].nil?
|
509
509
|
form_params["privateFlag"] = opts[:'private_flag'] if !opts[:'private_flag'].nil?
|
510
510
|
form_params["readOnlyFlag"] = opts[:'read_only_flag'] if !opts[:'read_only_flag'].nil?
|
@@ -525,7 +525,7 @@ module Connectwise
|
|
525
525
|
return data, status_code, headers
|
526
526
|
end
|
527
527
|
|
528
|
-
#
|
528
|
+
#
|
529
529
|
# Get Upload Sample Page
|
530
530
|
# @param [Hash] opts the optional parameters
|
531
531
|
# @return [nil]
|
@@ -534,7 +534,7 @@ module Connectwise
|
|
534
534
|
return nil
|
535
535
|
end
|
536
536
|
|
537
|
-
#
|
537
|
+
#
|
538
538
|
# Get Upload Sample Page
|
539
539
|
# @param [Hash] opts the optional parameters
|
540
540
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: connectwise-ruby-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Sowder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -197,8 +197,10 @@ executables: []
|
|
197
197
|
extensions: []
|
198
198
|
extra_rdoc_files: []
|
199
199
|
files:
|
200
|
+
- Gemfile
|
200
201
|
- LICENSE
|
201
202
|
- README.md
|
203
|
+
- Rakefile
|
202
204
|
- connectwise-ruby-sdk.gemspec
|
203
205
|
- docs/AccountingBatchTransactionsApi.md
|
204
206
|
- docs/AccountingBatchesApi.md
|