smartsheet 2.77.0 → 2.101.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -12
  3. data/.rubocop.yml +4 -4
  4. data/.travis.yml +29 -15
  5. data/.yardopts +3 -3
  6. data/ADVANCED.md +78 -78
  7. data/CHANGELOG.md +133 -112
  8. data/Gemfile +6 -6
  9. data/LICENSE +202 -202
  10. data/README.md +248 -246
  11. data/Rakefile +29 -29
  12. data/bin/console +14 -14
  13. data/bin/setup +8 -8
  14. data/lib/smartsheet.rb +2 -2
  15. data/lib/smartsheet/api/body_builder.rb +25 -25
  16. data/lib/smartsheet/api/endpoint_spec.rb +54 -54
  17. data/lib/smartsheet/api/faraday_adapter/faraday_net_client.rb +45 -45
  18. data/lib/smartsheet/api/faraday_adapter/faraday_response.rb +70 -70
  19. data/lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb +20 -20
  20. data/lib/smartsheet/api/faraday_adapter/middleware/response_parser.rb +25 -25
  21. data/lib/smartsheet/api/file_spec.rb +55 -55
  22. data/lib/smartsheet/api/header_builder.rb +96 -96
  23. data/lib/smartsheet/api/request.rb +42 -42
  24. data/lib/smartsheet/api/request_client.rb +43 -43
  25. data/lib/smartsheet/api/request_logger.rb +182 -182
  26. data/lib/smartsheet/api/request_spec.rb +57 -57
  27. data/lib/smartsheet/api/response_net_client_decorator.rb +54 -54
  28. data/lib/smartsheet/api/retry_logic.rb +40 -40
  29. data/lib/smartsheet/api/retry_net_client_decorator.rb +37 -37
  30. data/lib/smartsheet/api/url_builder.rb +25 -25
  31. data/lib/smartsheet/client.rb +193 -193
  32. data/lib/smartsheet/constants.rb +18 -18
  33. data/lib/smartsheet/endpoints/contacts/contacts.rb +30 -30
  34. data/lib/smartsheet/endpoints/events/events.rb +20 -20
  35. data/lib/smartsheet/endpoints/favorites/favorites.rb +159 -159
  36. data/lib/smartsheet/endpoints/folders/folders.rb +125 -125
  37. data/lib/smartsheet/endpoints/groups/groups.rb +83 -83
  38. data/lib/smartsheet/endpoints/home/home.rb +20 -20
  39. data/lib/smartsheet/endpoints/reports/reports.rb +100 -100
  40. data/lib/smartsheet/endpoints/reports/reports_share.rb +69 -69
  41. data/lib/smartsheet/endpoints/search/search.rb +30 -30
  42. data/lib/smartsheet/endpoints/server_info/server_info.rb +21 -21
  43. data/lib/smartsheet/endpoints/share/share.rb +58 -58
  44. data/lib/smartsheet/endpoints/sheets/automation_rules.rb +55 -55
  45. data/lib/smartsheet/endpoints/sheets/cells.rb +82 -82
  46. data/lib/smartsheet/endpoints/sheets/columns.rb +66 -66
  47. data/lib/smartsheet/endpoints/sheets/comments.rb +64 -64
  48. data/lib/smartsheet/endpoints/sheets/comments_attachments.rb +78 -78
  49. data/lib/smartsheet/endpoints/sheets/cross_sheet_references.rb +45 -45
  50. data/lib/smartsheet/endpoints/sheets/discussions.rb +84 -84
  51. data/lib/smartsheet/endpoints/sheets/discussions_attachments.rb +22 -22
  52. data/lib/smartsheet/endpoints/sheets/rows.rb +106 -106
  53. data/lib/smartsheet/endpoints/sheets/rows_attachments.rb +92 -92
  54. data/lib/smartsheet/endpoints/sheets/sheets.rb +514 -510
  55. data/lib/smartsheet/endpoints/sheets/sheets_attachments.rb +174 -174
  56. data/lib/smartsheet/endpoints/sheets/sheets_share.rb +69 -69
  57. data/lib/smartsheet/endpoints/sheets/sheets_summaries.rb +123 -0
  58. data/lib/smartsheet/endpoints/sights/sights.rb +101 -101
  59. data/lib/smartsheet/endpoints/sights/sights_share.rb +69 -69
  60. data/lib/smartsheet/endpoints/templates/templates.rb +29 -29
  61. data/lib/smartsheet/endpoints/token/token.rb +70 -66
  62. data/lib/smartsheet/endpoints/update_requests/sent_update_requests.rb +44 -44
  63. data/lib/smartsheet/endpoints/update_requests/update_requests.rb +74 -74
  64. data/lib/smartsheet/endpoints/users/alternate_emails.rb +79 -79
  65. data/lib/smartsheet/endpoints/users/users.rb +123 -77
  66. data/lib/smartsheet/endpoints/webhooks/webhooks.rb +71 -71
  67. data/lib/smartsheet/endpoints/workspaces/workspaces.rb +87 -87
  68. data/lib/smartsheet/endpoints/workspaces/workspaces_share.rb +70 -70
  69. data/lib/smartsheet/error.rb +69 -69
  70. data/lib/smartsheet/general_request.rb +74 -74
  71. data/lib/smartsheet/version.rb +5 -5
  72. data/smartsheet.gemspec +54 -54
  73. metadata +24 -12
@@ -1,175 +1,175 @@
1
- require 'smartsheet/api/file_spec'
2
-
3
- module Smartsheet
4
- # Sheet Attachments Endpoints
5
- # @see https://smartsheet-platform.github.io/api-docs/?ruby#attachments API Attachments Docs
6
- class SheetsAttachments
7
- attr_reader :client
8
- private :client
9
-
10
- def initialize(client)
11
- @client = client
12
- end
13
-
14
- def list(sheet_id:, params: {}, header_overrides: {})
15
- endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'attachments'])
16
- request_spec = Smartsheet::API::RequestSpec.new(
17
- params: params,
18
- header_overrides: header_overrides,
19
- sheet_id: sheet_id
20
- )
21
- client.make_request(endpoint_spec, request_spec)
22
- end
23
-
24
- def get(sheet_id:, attachment_id:, params: {}, header_overrides: {})
25
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
26
- :get,
27
- ['sheets', :sheet_id, 'attachments',
28
- :attachment_id]
29
- )
30
- request_spec = Smartsheet::API::RequestSpec.new(
31
- params: params,
32
- header_overrides: header_overrides,
33
- sheet_id: sheet_id,
34
- attachment_id: attachment_id
35
- )
36
- client.make_request(endpoint_spec, request_spec)
37
- end
38
-
39
- def attach_url(sheet_id:, body:, params: {}, header_overrides: {})
40
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
41
- :post,
42
- ['sheets', :sheet_id, 'attachments'],
43
- body_type: :json
44
- )
45
- request_spec = Smartsheet::API::RequestSpec.new(
46
- params: params,
47
- header_overrides: header_overrides,
48
- body: body,
49
- sheet_id: sheet_id
50
- )
51
- client.make_request(endpoint_spec, request_spec)
52
- end
53
-
54
- def delete(sheet_id:, attachment_id:, params: {}, header_overrides: {})
55
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
56
- :delete,
57
- ['sheets', :sheet_id, 'attachments', :attachment_id]
58
- )
59
- request_spec = Smartsheet::API::RequestSpec.new(
60
- params: params,
61
- header_overrides: header_overrides,
62
- sheet_id: sheet_id,
63
- attachment_id: attachment_id
64
- )
65
- client.make_request(endpoint_spec, request_spec)
66
- end
67
-
68
- def attach_file(sheet_id:, file:, filename:, file_length:, content_type: '', params: {}, header_overrides: {})
69
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
70
- :post,
71
- ['sheets', :sheet_id, 'attachments'],
72
- body_type: :file
73
- )
74
- request_spec = Smartsheet::API::RequestSpec.new(
75
- params: params,
76
- header_overrides: header_overrides,
77
- file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
78
- sheet_id: sheet_id
79
- )
80
- client.make_request(endpoint_spec, request_spec)
81
- end
82
-
83
- def attach_file_from_path(sheet_id:, path:, filename: nil, content_type: '', params: {}, header_overrides: {})
84
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
85
- :post,
86
- ['sheets', :sheet_id, 'attachments'],
87
- body_type: :file
88
- )
89
- request_spec = Smartsheet::API::RequestSpec.new(
90
- params: params,
91
- header_overrides: header_overrides,
92
- file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
93
- sheet_id: sheet_id
94
- )
95
- client.make_request(endpoint_spec, request_spec)
96
- end
97
-
98
- def attach_new_version(
99
- sheet_id:,
100
- attachment_id:,
101
- file:,
102
- filename:,
103
- file_length:,
104
- content_type: '',
105
- params: {},
106
- header_overrides: {}
107
- )
108
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
109
- :post,
110
- ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions'],
111
- body_type: :file
112
- )
113
- request_spec = Smartsheet::API::RequestSpec.new(
114
- params: params,
115
- header_overrides: header_overrides,
116
- file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
117
- sheet_id: sheet_id,
118
- attachment_id: attachment_id
119
- )
120
- client.make_request(endpoint_spec, request_spec)
121
- end
122
-
123
- def attach_new_version_from_path(
124
- sheet_id:,
125
- attachment_id:,
126
- path:,
127
- filename: nil,
128
- content_type: '',
129
- params: {},
130
- header_overrides: {}
131
- )
132
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
133
- :post,
134
- ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions'],
135
- body_type: :file
136
- )
137
- request_spec = Smartsheet::API::RequestSpec.new(
138
- params: params,
139
- header_overrides: header_overrides,
140
- file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
141
- sheet_id: sheet_id,
142
- attachment_id: attachment_id
143
- )
144
- client.make_request(endpoint_spec, request_spec)
145
- end
146
-
147
- def delete_all_versions(sheet_id:, attachment_id:, params: {}, header_overrides: {})
148
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
149
- :delete,
150
- ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions']
151
- )
152
- request_spec = Smartsheet::API::RequestSpec.new(
153
- params: params,
154
- header_overrides: header_overrides,
155
- sheet_id: sheet_id,
156
- attachment_id: attachment_id
157
- )
158
- client.make_request(endpoint_spec, request_spec)
159
- end
160
-
161
- def list_versions(sheet_id:, attachment_id:, params: {}, header_overrides: {})
162
- endpoint_spec = Smartsheet::API::EndpointSpec.new(
163
- :get,
164
- ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions']
165
- )
166
- request_spec = Smartsheet::API::RequestSpec.new(
167
- header_overrides: header_overrides,
168
- params: params,
169
- sheet_id: sheet_id,
170
- attachment_id: attachment_id
171
- )
172
- client.make_request(endpoint_spec, request_spec)
173
- end
174
- end
1
+ require 'smartsheet/api/file_spec'
2
+
3
+ module Smartsheet
4
+ # Sheet Attachments Endpoints
5
+ # @see https://smartsheet-platform.github.io/api-docs/?ruby#attachments API Attachments Docs
6
+ class SheetsAttachments
7
+ attr_reader :client
8
+ private :client
9
+
10
+ def initialize(client)
11
+ @client = client
12
+ end
13
+
14
+ def list(sheet_id:, params: {}, header_overrides: {})
15
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'attachments'])
16
+ request_spec = Smartsheet::API::RequestSpec.new(
17
+ params: params,
18
+ header_overrides: header_overrides,
19
+ sheet_id: sheet_id
20
+ )
21
+ client.make_request(endpoint_spec, request_spec)
22
+ end
23
+
24
+ def get(sheet_id:, attachment_id:, params: {}, header_overrides: {})
25
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
26
+ :get,
27
+ ['sheets', :sheet_id, 'attachments',
28
+ :attachment_id]
29
+ )
30
+ request_spec = Smartsheet::API::RequestSpec.new(
31
+ params: params,
32
+ header_overrides: header_overrides,
33
+ sheet_id: sheet_id,
34
+ attachment_id: attachment_id
35
+ )
36
+ client.make_request(endpoint_spec, request_spec)
37
+ end
38
+
39
+ def attach_url(sheet_id:, body:, params: {}, header_overrides: {})
40
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
41
+ :post,
42
+ ['sheets', :sheet_id, 'attachments'],
43
+ body_type: :json
44
+ )
45
+ request_spec = Smartsheet::API::RequestSpec.new(
46
+ params: params,
47
+ header_overrides: header_overrides,
48
+ body: body,
49
+ sheet_id: sheet_id
50
+ )
51
+ client.make_request(endpoint_spec, request_spec)
52
+ end
53
+
54
+ def delete(sheet_id:, attachment_id:, params: {}, header_overrides: {})
55
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
56
+ :delete,
57
+ ['sheets', :sheet_id, 'attachments', :attachment_id]
58
+ )
59
+ request_spec = Smartsheet::API::RequestSpec.new(
60
+ params: params,
61
+ header_overrides: header_overrides,
62
+ sheet_id: sheet_id,
63
+ attachment_id: attachment_id
64
+ )
65
+ client.make_request(endpoint_spec, request_spec)
66
+ end
67
+
68
+ def attach_file(sheet_id:, file:, filename:, file_length:, content_type: '', params: {}, header_overrides: {})
69
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
70
+ :post,
71
+ ['sheets', :sheet_id, 'attachments'],
72
+ body_type: :file
73
+ )
74
+ request_spec = Smartsheet::API::RequestSpec.new(
75
+ params: params,
76
+ header_overrides: header_overrides,
77
+ file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
78
+ sheet_id: sheet_id
79
+ )
80
+ client.make_request(endpoint_spec, request_spec)
81
+ end
82
+
83
+ def attach_file_from_path(sheet_id:, path:, filename: nil, content_type: '', params: {}, header_overrides: {})
84
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
85
+ :post,
86
+ ['sheets', :sheet_id, 'attachments'],
87
+ body_type: :file
88
+ )
89
+ request_spec = Smartsheet::API::RequestSpec.new(
90
+ params: params,
91
+ header_overrides: header_overrides,
92
+ file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
93
+ sheet_id: sheet_id
94
+ )
95
+ client.make_request(endpoint_spec, request_spec)
96
+ end
97
+
98
+ def attach_new_version(
99
+ sheet_id:,
100
+ attachment_id:,
101
+ file:,
102
+ filename:,
103
+ file_length:,
104
+ content_type: '',
105
+ params: {},
106
+ header_overrides: {}
107
+ )
108
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
109
+ :post,
110
+ ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions'],
111
+ body_type: :file
112
+ )
113
+ request_spec = Smartsheet::API::RequestSpec.new(
114
+ params: params,
115
+ header_overrides: header_overrides,
116
+ file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
117
+ sheet_id: sheet_id,
118
+ attachment_id: attachment_id
119
+ )
120
+ client.make_request(endpoint_spec, request_spec)
121
+ end
122
+
123
+ def attach_new_version_from_path(
124
+ sheet_id:,
125
+ attachment_id:,
126
+ path:,
127
+ filename: nil,
128
+ content_type: '',
129
+ params: {},
130
+ header_overrides: {}
131
+ )
132
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
133
+ :post,
134
+ ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions'],
135
+ body_type: :file
136
+ )
137
+ request_spec = Smartsheet::API::RequestSpec.new(
138
+ params: params,
139
+ header_overrides: header_overrides,
140
+ file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
141
+ sheet_id: sheet_id,
142
+ attachment_id: attachment_id
143
+ )
144
+ client.make_request(endpoint_spec, request_spec)
145
+ end
146
+
147
+ def delete_all_versions(sheet_id:, attachment_id:, params: {}, header_overrides: {})
148
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
149
+ :delete,
150
+ ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions']
151
+ )
152
+ request_spec = Smartsheet::API::RequestSpec.new(
153
+ params: params,
154
+ header_overrides: header_overrides,
155
+ sheet_id: sheet_id,
156
+ attachment_id: attachment_id
157
+ )
158
+ client.make_request(endpoint_spec, request_spec)
159
+ end
160
+
161
+ def list_versions(sheet_id:, attachment_id:, params: {}, header_overrides: {})
162
+ endpoint_spec = Smartsheet::API::EndpointSpec.new(
163
+ :get,
164
+ ['sheets', :sheet_id, 'attachments', :attachment_id, 'versions']
165
+ )
166
+ request_spec = Smartsheet::API::RequestSpec.new(
167
+ header_overrides: header_overrides,
168
+ params: params,
169
+ sheet_id: sheet_id,
170
+ attachment_id: attachment_id
171
+ )
172
+ client.make_request(endpoint_spec, request_spec)
173
+ end
174
+ end
175
175
  end
@@ -1,70 +1,70 @@
1
- require 'smartsheet/endpoints/share/share'
2
-
3
- module Smartsheet
4
- # Sheet Sharing Endpoints
5
- # @see https://smartsheet-platform.github.io/api-docs/?ruby#sheet-sharing API Sheet Sharing Docs
6
- class SheetsShare
7
- attr_reader :client
8
- private :client
9
-
10
- URL = ['sheets', :sheet_id].freeze
11
-
12
- def initialize(client)
13
- @client = client
14
- end
15
-
16
- def delete(sheet_id:, share_id:, params: {}, header_overrides: {})
17
- delete_share(
18
- share_id: share_id,
19
- url: URL,
20
- params: params,
21
- header_overrides: header_overrides,
22
- sheet_id: sheet_id
23
- )
24
- end
25
-
26
- def get(sheet_id:, share_id:, params: {}, header_overrides: {})
27
- get_share(
28
- share_id: share_id,
29
- url: URL,
30
- params: params,
31
- header_overrides: header_overrides,
32
- sheet_id: sheet_id
33
- )
34
- end
35
-
36
- def list(sheet_id:, params: {}, header_overrides: {})
37
- list_share(
38
- url: URL,
39
- header_overrides: header_overrides,
40
- params: params,
41
- sheet_id: sheet_id
42
- )
43
- end
44
-
45
- def create(sheet_id:, body:, params: {}, header_overrides: {})
46
- create_share(
47
- url: URL,
48
- header_overrides: header_overrides,
49
- params: params,
50
- body: body,
51
- sheet_id: sheet_id
52
- )
53
- end
54
-
55
- def update(sheet_id:, share_id:, body:, params: {}, header_overrides: {})
56
- update_share(
57
- share_id: share_id,
58
- url: URL,
59
- params: params,
60
- header_overrides: header_overrides,
61
- body: body,
62
- sheet_id: sheet_id
63
- )
64
- end
65
-
66
- private
67
-
68
- include Smartsheet::Share
69
- end
1
+ require 'smartsheet/endpoints/share/share'
2
+
3
+ module Smartsheet
4
+ # Sheet Sharing Endpoints
5
+ # @see https://smartsheet-platform.github.io/api-docs/?ruby#sheet-sharing API Sheet Sharing Docs
6
+ class SheetsShare
7
+ attr_reader :client
8
+ private :client
9
+
10
+ URL = ['sheets', :sheet_id].freeze
11
+
12
+ def initialize(client)
13
+ @client = client
14
+ end
15
+
16
+ def delete(sheet_id:, share_id:, params: {}, header_overrides: {})
17
+ delete_share(
18
+ share_id: share_id,
19
+ url: URL,
20
+ params: params,
21
+ header_overrides: header_overrides,
22
+ sheet_id: sheet_id
23
+ )
24
+ end
25
+
26
+ def get(sheet_id:, share_id:, params: {}, header_overrides: {})
27
+ get_share(
28
+ share_id: share_id,
29
+ url: URL,
30
+ params: params,
31
+ header_overrides: header_overrides,
32
+ sheet_id: sheet_id
33
+ )
34
+ end
35
+
36
+ def list(sheet_id:, params: {}, header_overrides: {})
37
+ list_share(
38
+ url: URL,
39
+ header_overrides: header_overrides,
40
+ params: params,
41
+ sheet_id: sheet_id
42
+ )
43
+ end
44
+
45
+ def create(sheet_id:, body:, params: {}, header_overrides: {})
46
+ create_share(
47
+ url: URL,
48
+ header_overrides: header_overrides,
49
+ params: params,
50
+ body: body,
51
+ sheet_id: sheet_id
52
+ )
53
+ end
54
+
55
+ def update(sheet_id:, share_id:, body:, params: {}, header_overrides: {})
56
+ update_share(
57
+ share_id: share_id,
58
+ url: URL,
59
+ params: params,
60
+ header_overrides: header_overrides,
61
+ body: body,
62
+ sheet_id: sheet_id
63
+ )
64
+ end
65
+
66
+ private
67
+
68
+ include Smartsheet::Share
69
+ end
70
70
  end