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.
- checksums.yaml +4 -4
- data/.gitignore +12 -12
- data/.rubocop.yml +4 -4
- data/.travis.yml +29 -15
- data/.yardopts +3 -3
- data/ADVANCED.md +78 -78
- data/CHANGELOG.md +133 -112
- data/Gemfile +6 -6
- data/LICENSE +202 -202
- data/README.md +248 -246
- data/Rakefile +29 -29
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/lib/smartsheet.rb +2 -2
- data/lib/smartsheet/api/body_builder.rb +25 -25
- data/lib/smartsheet/api/endpoint_spec.rb +54 -54
- data/lib/smartsheet/api/faraday_adapter/faraday_net_client.rb +45 -45
- data/lib/smartsheet/api/faraday_adapter/faraday_response.rb +70 -70
- data/lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb +20 -20
- data/lib/smartsheet/api/faraday_adapter/middleware/response_parser.rb +25 -25
- data/lib/smartsheet/api/file_spec.rb +55 -55
- data/lib/smartsheet/api/header_builder.rb +96 -96
- data/lib/smartsheet/api/request.rb +42 -42
- data/lib/smartsheet/api/request_client.rb +43 -43
- data/lib/smartsheet/api/request_logger.rb +182 -182
- data/lib/smartsheet/api/request_spec.rb +57 -57
- data/lib/smartsheet/api/response_net_client_decorator.rb +54 -54
- data/lib/smartsheet/api/retry_logic.rb +40 -40
- data/lib/smartsheet/api/retry_net_client_decorator.rb +37 -37
- data/lib/smartsheet/api/url_builder.rb +25 -25
- data/lib/smartsheet/client.rb +193 -193
- data/lib/smartsheet/constants.rb +18 -18
- data/lib/smartsheet/endpoints/contacts/contacts.rb +30 -30
- data/lib/smartsheet/endpoints/events/events.rb +20 -20
- data/lib/smartsheet/endpoints/favorites/favorites.rb +159 -159
- data/lib/smartsheet/endpoints/folders/folders.rb +125 -125
- data/lib/smartsheet/endpoints/groups/groups.rb +83 -83
- data/lib/smartsheet/endpoints/home/home.rb +20 -20
- data/lib/smartsheet/endpoints/reports/reports.rb +100 -100
- data/lib/smartsheet/endpoints/reports/reports_share.rb +69 -69
- data/lib/smartsheet/endpoints/search/search.rb +30 -30
- data/lib/smartsheet/endpoints/server_info/server_info.rb +21 -21
- data/lib/smartsheet/endpoints/share/share.rb +58 -58
- data/lib/smartsheet/endpoints/sheets/automation_rules.rb +55 -55
- data/lib/smartsheet/endpoints/sheets/cells.rb +82 -82
- data/lib/smartsheet/endpoints/sheets/columns.rb +66 -66
- data/lib/smartsheet/endpoints/sheets/comments.rb +64 -64
- data/lib/smartsheet/endpoints/sheets/comments_attachments.rb +78 -78
- data/lib/smartsheet/endpoints/sheets/cross_sheet_references.rb +45 -45
- data/lib/smartsheet/endpoints/sheets/discussions.rb +84 -84
- data/lib/smartsheet/endpoints/sheets/discussions_attachments.rb +22 -22
- data/lib/smartsheet/endpoints/sheets/rows.rb +106 -106
- data/lib/smartsheet/endpoints/sheets/rows_attachments.rb +92 -92
- data/lib/smartsheet/endpoints/sheets/sheets.rb +514 -510
- data/lib/smartsheet/endpoints/sheets/sheets_attachments.rb +174 -174
- data/lib/smartsheet/endpoints/sheets/sheets_share.rb +69 -69
- data/lib/smartsheet/endpoints/sheets/sheets_summaries.rb +123 -0
- data/lib/smartsheet/endpoints/sights/sights.rb +101 -101
- data/lib/smartsheet/endpoints/sights/sights_share.rb +69 -69
- data/lib/smartsheet/endpoints/templates/templates.rb +29 -29
- data/lib/smartsheet/endpoints/token/token.rb +70 -66
- data/lib/smartsheet/endpoints/update_requests/sent_update_requests.rb +44 -44
- data/lib/smartsheet/endpoints/update_requests/update_requests.rb +74 -74
- data/lib/smartsheet/endpoints/users/alternate_emails.rb +79 -79
- data/lib/smartsheet/endpoints/users/users.rb +123 -77
- data/lib/smartsheet/endpoints/webhooks/webhooks.rb +71 -71
- data/lib/smartsheet/endpoints/workspaces/workspaces.rb +87 -87
- data/lib/smartsheet/endpoints/workspaces/workspaces_share.rb +70 -70
- data/lib/smartsheet/error.rb +69 -69
- data/lib/smartsheet/general_request.rb +74 -74
- data/lib/smartsheet/version.rb +5 -5
- data/smartsheet.gemspec +54 -54
- metadata +24 -12
@@ -1,78 +1,124 @@
|
|
1
|
-
require_relative 'alternate_emails'
|
2
|
-
|
3
|
-
module Smartsheet
|
4
|
-
# Users Endpoints
|
5
|
-
# @see https://smartsheet-platform.github.io/api-docs/?ruby#users API Users Docs
|
6
|
-
#
|
7
|
-
# @!attribute [r] alternate_emails
|
8
|
-
# @return [AlternateEmails]
|
9
|
-
class Users
|
10
|
-
attr_reader :client, :alternate_emails
|
11
|
-
private :client
|
12
|
-
|
13
|
-
def initialize(client)
|
14
|
-
@client = client
|
15
|
-
|
16
|
-
@alternate_emails = AlternateEmails.new(client)
|
17
|
-
end
|
18
|
-
|
19
|
-
def add(body:, params: {}, header_overrides: {})
|
20
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['users'], body_type: :json)
|
21
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
22
|
-
header_overrides: header_overrides,
|
23
|
-
body: body,
|
24
|
-
params: params
|
25
|
-
)
|
26
|
-
client.make_request(endpoint_spec, request_spec)
|
27
|
-
end
|
28
|
-
|
29
|
-
def get_current(params: {}, header_overrides: {})
|
30
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users', 'me'])
|
31
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
32
|
-
params: params,
|
33
|
-
header_overrides: header_overrides
|
34
|
-
)
|
35
|
-
client.make_request(endpoint_spec, request_spec)
|
36
|
-
end
|
37
|
-
|
38
|
-
def get(user_id:, params: {}, header_overrides: {})
|
39
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users', :user_id])
|
40
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
41
|
-
params: params,
|
42
|
-
header_overrides: header_overrides,
|
43
|
-
user_id: user_id
|
44
|
-
)
|
45
|
-
client.make_request(endpoint_spec, request_spec)
|
46
|
-
end
|
47
|
-
|
48
|
-
def list(params: {}, header_overrides: {})
|
49
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users'])
|
50
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
51
|
-
header_overrides: header_overrides,
|
52
|
-
params: params
|
53
|
-
)
|
54
|
-
client.make_request(endpoint_spec, request_spec)
|
55
|
-
end
|
56
|
-
|
57
|
-
def remove(user_id:, params: {}, header_overrides: {})
|
58
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['users', :user_id])
|
59
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
60
|
-
header_overrides: header_overrides,
|
61
|
-
params: params,
|
62
|
-
user_id: user_id
|
63
|
-
)
|
64
|
-
client.make_request(endpoint_spec, request_spec)
|
65
|
-
end
|
66
|
-
|
67
|
-
def update(user_id:, body:, params: {}, header_overrides: {})
|
68
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['users', :user_id], body_type: :json)
|
69
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
70
|
-
params: params,
|
71
|
-
header_overrides: header_overrides,
|
72
|
-
body: body,
|
73
|
-
user_id: user_id
|
74
|
-
)
|
75
|
-
client.make_request(endpoint_spec, request_spec)
|
76
|
-
end
|
77
|
-
|
1
|
+
require_relative 'alternate_emails'
|
2
|
+
|
3
|
+
module Smartsheet
|
4
|
+
# Users Endpoints
|
5
|
+
# @see https://smartsheet-platform.github.io/api-docs/?ruby#users API Users Docs
|
6
|
+
#
|
7
|
+
# @!attribute [r] alternate_emails
|
8
|
+
# @return [AlternateEmails]
|
9
|
+
class Users
|
10
|
+
attr_reader :client, :alternate_emails
|
11
|
+
private :client
|
12
|
+
|
13
|
+
def initialize(client)
|
14
|
+
@client = client
|
15
|
+
|
16
|
+
@alternate_emails = AlternateEmails.new(client)
|
17
|
+
end
|
18
|
+
|
19
|
+
def add(body:, params: {}, header_overrides: {})
|
20
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['users'], body_type: :json)
|
21
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
22
|
+
header_overrides: header_overrides,
|
23
|
+
body: body,
|
24
|
+
params: params
|
25
|
+
)
|
26
|
+
client.make_request(endpoint_spec, request_spec)
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_current(params: {}, header_overrides: {})
|
30
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users', 'me'])
|
31
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
32
|
+
params: params,
|
33
|
+
header_overrides: header_overrides
|
34
|
+
)
|
35
|
+
client.make_request(endpoint_spec, request_spec)
|
36
|
+
end
|
37
|
+
|
38
|
+
def get(user_id:, params: {}, header_overrides: {})
|
39
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users', :user_id])
|
40
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
41
|
+
params: params,
|
42
|
+
header_overrides: header_overrides,
|
43
|
+
user_id: user_id
|
44
|
+
)
|
45
|
+
client.make_request(endpoint_spec, request_spec)
|
46
|
+
end
|
47
|
+
|
48
|
+
def list(params: {}, header_overrides: {})
|
49
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['users'])
|
50
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
51
|
+
header_overrides: header_overrides,
|
52
|
+
params: params
|
53
|
+
)
|
54
|
+
client.make_request(endpoint_spec, request_spec)
|
55
|
+
end
|
56
|
+
|
57
|
+
def remove(user_id:, params: {}, header_overrides: {})
|
58
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['users', :user_id])
|
59
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
60
|
+
header_overrides: header_overrides,
|
61
|
+
params: params,
|
62
|
+
user_id: user_id
|
63
|
+
)
|
64
|
+
client.make_request(endpoint_spec, request_spec)
|
65
|
+
end
|
66
|
+
|
67
|
+
def update(user_id:, body:, params: {}, header_overrides: {})
|
68
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['users', :user_id], body_type: :json)
|
69
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
70
|
+
params: params,
|
71
|
+
header_overrides: header_overrides,
|
72
|
+
body: body,
|
73
|
+
user_id: user_id
|
74
|
+
)
|
75
|
+
client.make_request(endpoint_spec, request_spec)
|
76
|
+
end
|
77
|
+
|
78
|
+
def add_profile_image(
|
79
|
+
user_id:,
|
80
|
+
file:,
|
81
|
+
filename:,
|
82
|
+
file_length:,
|
83
|
+
content_type: '',
|
84
|
+
params: {},
|
85
|
+
header_overrides: {}
|
86
|
+
)
|
87
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
88
|
+
:post,
|
89
|
+
['users', :user_id, 'profileimage'],
|
90
|
+
body_type: :file
|
91
|
+
)
|
92
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
93
|
+
header_overrides: header_overrides,
|
94
|
+
params: params,
|
95
|
+
file_spec: Smartsheet::API::ObjectFileSpec.new(file, filename, file_length, content_type),
|
96
|
+
user_id: user_id
|
97
|
+
)
|
98
|
+
client.make_request(endpoint_spec, request_spec)
|
99
|
+
end
|
100
|
+
|
101
|
+
def add_profile_image_from_path(
|
102
|
+
user_id:,
|
103
|
+
path:,
|
104
|
+
filename: nil,
|
105
|
+
content_type: '',
|
106
|
+
params: {},
|
107
|
+
header_overrides: {}
|
108
|
+
)
|
109
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
110
|
+
:post,
|
111
|
+
['users', :user_id, 'profileimage'],
|
112
|
+
body_type: :file
|
113
|
+
)
|
114
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
115
|
+
header_overrides: header_overrides,
|
116
|
+
params: params,
|
117
|
+
file_spec: Smartsheet::API::PathFileSpec.new(path, filename, content_type),
|
118
|
+
user_id: user_id
|
119
|
+
)
|
120
|
+
client.make_request(endpoint_spec, request_spec)
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
78
124
|
end
|
@@ -1,72 +1,72 @@
|
|
1
|
-
module Smartsheet
|
2
|
-
# Webhooks Endpoints
|
3
|
-
# @see https://smartsheet-platform.github.io/api-docs/?ruby#webhooks-reference API Webhooks Docs
|
4
|
-
class Webhooks
|
5
|
-
attr_reader :client
|
6
|
-
private :client
|
7
|
-
|
8
|
-
def initialize(client)
|
9
|
-
@client = client
|
10
|
-
end
|
11
|
-
|
12
|
-
def create(body:, params: {}, header_overrides: {})
|
13
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks'], body_type: :json)
|
14
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
15
|
-
params: params,
|
16
|
-
header_overrides: header_overrides,
|
17
|
-
body: body
|
18
|
-
)
|
19
|
-
client.make_request(endpoint_spec, request_spec)
|
20
|
-
end
|
21
|
-
|
22
|
-
def delete(webhook_id:, params: {}, header_overrides: {})
|
23
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['webhooks', :webhook_id])
|
24
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
25
|
-
params: params,
|
26
|
-
header_overrides: header_overrides,
|
27
|
-
webhook_id: webhook_id
|
28
|
-
)
|
29
|
-
client.make_request(endpoint_spec, request_spec)
|
30
|
-
end
|
31
|
-
|
32
|
-
def get(webhook_id:, params: {}, header_overrides: {})
|
33
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks', :webhook_id])
|
34
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
35
|
-
params: params,
|
36
|
-
header_overrides: header_overrides,
|
37
|
-
webhook_id: webhook_id
|
38
|
-
)
|
39
|
-
client.make_request(endpoint_spec, request_spec)
|
40
|
-
end
|
41
|
-
|
42
|
-
def list(params: {}, header_overrides: {})
|
43
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks'])
|
44
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
45
|
-
params: params,
|
46
|
-
header_overrides: header_overrides
|
47
|
-
)
|
48
|
-
client.make_request(endpoint_spec, request_spec)
|
49
|
-
end
|
50
|
-
|
51
|
-
def reset_shared_secret(webhook_id:, params: {}, header_overrides: {})
|
52
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks', :webhook_id, 'resetsharedsecret'])
|
53
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
54
|
-
params: params,
|
55
|
-
header_overrides: header_overrides,
|
56
|
-
webhook_id: webhook_id
|
57
|
-
)
|
58
|
-
client.make_request(endpoint_spec, request_spec)
|
59
|
-
end
|
60
|
-
|
61
|
-
def update(webhook_id:, body:, params: {}, header_overrides: {})
|
62
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['webhooks', :webhook_id], body_type: :json)
|
63
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
64
|
-
params: params,
|
65
|
-
header_overrides: header_overrides,
|
66
|
-
body: body,
|
67
|
-
webhook_id: webhook_id
|
68
|
-
)
|
69
|
-
client.make_request(endpoint_spec, request_spec)
|
70
|
-
end
|
71
|
-
end
|
1
|
+
module Smartsheet
|
2
|
+
# Webhooks Endpoints
|
3
|
+
# @see https://smartsheet-platform.github.io/api-docs/?ruby#webhooks-reference API Webhooks Docs
|
4
|
+
class Webhooks
|
5
|
+
attr_reader :client
|
6
|
+
private :client
|
7
|
+
|
8
|
+
def initialize(client)
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
def create(body:, params: {}, header_overrides: {})
|
13
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks'], body_type: :json)
|
14
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
15
|
+
params: params,
|
16
|
+
header_overrides: header_overrides,
|
17
|
+
body: body
|
18
|
+
)
|
19
|
+
client.make_request(endpoint_spec, request_spec)
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete(webhook_id:, params: {}, header_overrides: {})
|
23
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['webhooks', :webhook_id])
|
24
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
25
|
+
params: params,
|
26
|
+
header_overrides: header_overrides,
|
27
|
+
webhook_id: webhook_id
|
28
|
+
)
|
29
|
+
client.make_request(endpoint_spec, request_spec)
|
30
|
+
end
|
31
|
+
|
32
|
+
def get(webhook_id:, params: {}, header_overrides: {})
|
33
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks', :webhook_id])
|
34
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
35
|
+
params: params,
|
36
|
+
header_overrides: header_overrides,
|
37
|
+
webhook_id: webhook_id
|
38
|
+
)
|
39
|
+
client.make_request(endpoint_spec, request_spec)
|
40
|
+
end
|
41
|
+
|
42
|
+
def list(params: {}, header_overrides: {})
|
43
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['webhooks'])
|
44
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
45
|
+
params: params,
|
46
|
+
header_overrides: header_overrides
|
47
|
+
)
|
48
|
+
client.make_request(endpoint_spec, request_spec)
|
49
|
+
end
|
50
|
+
|
51
|
+
def reset_shared_secret(webhook_id:, params: {}, header_overrides: {})
|
52
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['webhooks', :webhook_id, 'resetsharedsecret'])
|
53
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
54
|
+
params: params,
|
55
|
+
header_overrides: header_overrides,
|
56
|
+
webhook_id: webhook_id
|
57
|
+
)
|
58
|
+
client.make_request(endpoint_spec, request_spec)
|
59
|
+
end
|
60
|
+
|
61
|
+
def update(webhook_id:, body:, params: {}, header_overrides: {})
|
62
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['webhooks', :webhook_id], body_type: :json)
|
63
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
64
|
+
params: params,
|
65
|
+
header_overrides: header_overrides,
|
66
|
+
body: body,
|
67
|
+
webhook_id: webhook_id
|
68
|
+
)
|
69
|
+
client.make_request(endpoint_spec, request_spec)
|
70
|
+
end
|
71
|
+
end
|
72
72
|
end
|
@@ -1,88 +1,88 @@
|
|
1
|
-
require_relative 'workspaces_share'
|
2
|
-
|
3
|
-
module Smartsheet
|
4
|
-
# Workspaces Endpoints
|
5
|
-
# @see https://smartsheet-platform.github.io/api-docs/?ruby#workspaces API Workspaces Docs
|
6
|
-
#
|
7
|
-
# @!attribute [r] share
|
8
|
-
# @return [WorkspacesShare]
|
9
|
-
class Workspaces
|
10
|
-
attr_reader :client, :share
|
11
|
-
private :client
|
12
|
-
|
13
|
-
def initialize(client)
|
14
|
-
@client = client
|
15
|
-
|
16
|
-
@share = WorkspacesShare.new(client)
|
17
|
-
end
|
18
|
-
|
19
|
-
def copy(workspace_id:, body:, params: {}, header_overrides: {})
|
20
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
21
|
-
:post,
|
22
|
-
['workspaces', :workspace_id, 'copy'],
|
23
|
-
body_type: :json
|
24
|
-
)
|
25
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
26
|
-
header_overrides: header_overrides,
|
27
|
-
params: params,
|
28
|
-
body: body,
|
29
|
-
workspace_id: workspace_id
|
30
|
-
)
|
31
|
-
client.make_request(endpoint_spec, request_spec)
|
32
|
-
end
|
33
|
-
|
34
|
-
def create(body:, params: {}, header_overrides: {})
|
35
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['workspaces'], body_type: :json)
|
36
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
37
|
-
params: params,
|
38
|
-
header_overrides: header_overrides,
|
39
|
-
body: body
|
40
|
-
)
|
41
|
-
client.make_request(endpoint_spec, request_spec)
|
42
|
-
end
|
43
|
-
|
44
|
-
def delete(workspace_id:, params: {}, header_overrides: {})
|
45
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['workspaces', :workspace_id])
|
46
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
47
|
-
params: params,
|
48
|
-
header_overrides: header_overrides,
|
49
|
-
workspace_id: workspace_id
|
50
|
-
)
|
51
|
-
client.make_request(endpoint_spec, request_spec)
|
52
|
-
end
|
53
|
-
|
54
|
-
def get(workspace_id:, params: {}, header_overrides: {})
|
55
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['workspaces', :workspace_id])
|
56
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
57
|
-
header_overrides: header_overrides,
|
58
|
-
params: params,
|
59
|
-
workspace_id: workspace_id
|
60
|
-
)
|
61
|
-
client.make_request(endpoint_spec, request_spec)
|
62
|
-
end
|
63
|
-
|
64
|
-
def list(params: {}, header_overrides: {})
|
65
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['workspaces'])
|
66
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
67
|
-
header_overrides: header_overrides,
|
68
|
-
params: params,
|
69
|
-
)
|
70
|
-
client.make_request(endpoint_spec, request_spec)
|
71
|
-
end
|
72
|
-
|
73
|
-
def update(workspace_id:, body:, params: {}, header_overrides: {})
|
74
|
-
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
75
|
-
:put,
|
76
|
-
['workspaces', :workspace_id],
|
77
|
-
body_type: :json
|
78
|
-
)
|
79
|
-
request_spec = Smartsheet::API::RequestSpec.new(
|
80
|
-
params: params,
|
81
|
-
header_overrides: header_overrides,
|
82
|
-
body: body,
|
83
|
-
workspace_id: workspace_id
|
84
|
-
)
|
85
|
-
client.make_request(endpoint_spec, request_spec)
|
86
|
-
end
|
87
|
-
end
|
1
|
+
require_relative 'workspaces_share'
|
2
|
+
|
3
|
+
module Smartsheet
|
4
|
+
# Workspaces Endpoints
|
5
|
+
# @see https://smartsheet-platform.github.io/api-docs/?ruby#workspaces API Workspaces Docs
|
6
|
+
#
|
7
|
+
# @!attribute [r] share
|
8
|
+
# @return [WorkspacesShare]
|
9
|
+
class Workspaces
|
10
|
+
attr_reader :client, :share
|
11
|
+
private :client
|
12
|
+
|
13
|
+
def initialize(client)
|
14
|
+
@client = client
|
15
|
+
|
16
|
+
@share = WorkspacesShare.new(client)
|
17
|
+
end
|
18
|
+
|
19
|
+
def copy(workspace_id:, body:, params: {}, header_overrides: {})
|
20
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
21
|
+
:post,
|
22
|
+
['workspaces', :workspace_id, 'copy'],
|
23
|
+
body_type: :json
|
24
|
+
)
|
25
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
26
|
+
header_overrides: header_overrides,
|
27
|
+
params: params,
|
28
|
+
body: body,
|
29
|
+
workspace_id: workspace_id
|
30
|
+
)
|
31
|
+
client.make_request(endpoint_spec, request_spec)
|
32
|
+
end
|
33
|
+
|
34
|
+
def create(body:, params: {}, header_overrides: {})
|
35
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['workspaces'], body_type: :json)
|
36
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
37
|
+
params: params,
|
38
|
+
header_overrides: header_overrides,
|
39
|
+
body: body
|
40
|
+
)
|
41
|
+
client.make_request(endpoint_spec, request_spec)
|
42
|
+
end
|
43
|
+
|
44
|
+
def delete(workspace_id:, params: {}, header_overrides: {})
|
45
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['workspaces', :workspace_id])
|
46
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
47
|
+
params: params,
|
48
|
+
header_overrides: header_overrides,
|
49
|
+
workspace_id: workspace_id
|
50
|
+
)
|
51
|
+
client.make_request(endpoint_spec, request_spec)
|
52
|
+
end
|
53
|
+
|
54
|
+
def get(workspace_id:, params: {}, header_overrides: {})
|
55
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['workspaces', :workspace_id])
|
56
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
57
|
+
header_overrides: header_overrides,
|
58
|
+
params: params,
|
59
|
+
workspace_id: workspace_id
|
60
|
+
)
|
61
|
+
client.make_request(endpoint_spec, request_spec)
|
62
|
+
end
|
63
|
+
|
64
|
+
def list(params: {}, header_overrides: {})
|
65
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['workspaces'])
|
66
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
67
|
+
header_overrides: header_overrides,
|
68
|
+
params: params,
|
69
|
+
)
|
70
|
+
client.make_request(endpoint_spec, request_spec)
|
71
|
+
end
|
72
|
+
|
73
|
+
def update(workspace_id:, body:, params: {}, header_overrides: {})
|
74
|
+
endpoint_spec = Smartsheet::API::EndpointSpec.new(
|
75
|
+
:put,
|
76
|
+
['workspaces', :workspace_id],
|
77
|
+
body_type: :json
|
78
|
+
)
|
79
|
+
request_spec = Smartsheet::API::RequestSpec.new(
|
80
|
+
params: params,
|
81
|
+
header_overrides: header_overrides,
|
82
|
+
body: body,
|
83
|
+
workspace_id: workspace_id
|
84
|
+
)
|
85
|
+
client.make_request(endpoint_spec, request_spec)
|
86
|
+
end
|
87
|
+
end
|
88
88
|
end
|