• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartsheet / smartsheet-java-sdk / #57

29 Jul 2025 04:55PM UTC coverage: 60.803% (+0.2%) from 60.611%
#57

push

github

web-flow
Added new sharing endpoints. Deprecated old sharing endpoints. (#125)

* Added new sharing endpoints.
Deprecated old endpoints.

* Updated to 3.3.0 for deprecation date.

* Removed amp.

* fixed `&`

106 of 157 new or added lines in 9 files covered. (67.52%)

4269 of 7021 relevant lines covered (60.8%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

32.5
/src/main/java/com/smartsheet/api/models/CreateShareRequest.java
1
/*
2
 * Copyright (C) 2025 Smartsheet
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.smartsheet.api.models;
18

19
import com.smartsheet.api.models.enums.AccessLevel;
20

21
/**
22
 * Represents a CreateShareRequest object in the Smartsheet API.
23
 */
24
public class CreateShareRequest {
1✔
25
    /**
26
     * The primary email address of a user to share to. Must be provided if groupId is not provided.
27
     */
28
    private String email;
29

30
    /**
31
     * The id of the group to share to. Must be provided if email is not provided.
32
     */
33
    private Long groupId;
34

35
    /**
36
     * The access level to grant to the user or group.
37
     */
38
    private AccessLevel accessLevel;
39

40
    /**
41
     * The subject of the email that is optionally sent to notify the recipient.
42
     * Must set the sendEmail query parameter to true for this parameter to take effect.
43
     */
44
    private String subject;
45

46
    /**
47
     * The message included in the body of the email that is optionally sent to the recipient.
48
     * Must set the sendEmail query parameter to true for this parameter to take effect.
49
     */
50
    private String message;
51

52
    /**
53
     * Indicates whether to send a copy of the email to the sharer of the sheet.
54
     * Must set the sendEmail query parameter to true for this parameter to take effect.
55
     */
56
    private Boolean ccMe;
57

58
    /**
59
     * Gets the email of the user.
60
     *
61
     * @return the email
62
     */
63
    public String getEmail() {
64
        return email;
1✔
65
    }
66

67
    /**
68
     * Sets the email of the user.
69
     *
70
     * @param email the email
71
     * @return this CreateShareRequest
72
     */
73
    public CreateShareRequest setEmail(String email) {
74
        this.email = email;
1✔
75
        return this;
1✔
76
    }
77

78
    /**
79
     * Gets the group id.
80
     *
81
     * @return the group id
82
     */
83
    public Long getGroupId() {
84
        return groupId;
1✔
85
    }
86

87
    /**
88
     * Sets the group id.
89
     *
90
     * @param groupId the group id
91
     * @return this CreateShareRequest
92
     */
93
    public CreateShareRequest setGroupId(Long groupId) {
94
        this.groupId = groupId;
1✔
95
        return this;
1✔
96
    }
97

98
    /**
99
     * Gets the access level.
100
     *
101
     * @return the access level
102
     */
103
    public AccessLevel getAccessLevel() {
104
        return accessLevel;
1✔
105
    }
106

107
    /**
108
     * Sets the access level.
109
     *
110
     * @param accessLevel the access level
111
     * @return this CreateShareRequest
112
     */
113
    public CreateShareRequest setAccessLevel(AccessLevel accessLevel) {
114
        this.accessLevel = accessLevel;
1✔
115
        return this;
1✔
116
    }
117

118
    /**
119
     * Gets the subject of the email.
120
     *
121
     * @return the subject
122
     */
123
    public String getSubject() {
124
        return subject;
1✔
125
    }
126

127
    /**
128
     * Sets the subject of the email.
129
     *
130
     * @param subject the subject
131
     * @return this CreateShareRequest
132
     */
133
    public CreateShareRequest setSubject(String subject) {
NEW
134
        this.subject = subject;
×
NEW
135
        return this;
×
136
    }
137

138
    /**
139
     * Gets the message of the email.
140
     *
141
     * @return the message
142
     */
143
    public String getMessage() {
144
        return message;
1✔
145
    }
146

147
    /**
148
     * Sets the message of the email.
149
     *
150
     * @param message the message
151
     * @return this CreateShareRequest
152
     */
153
    public CreateShareRequest setMessage(String message) {
NEW
154
        this.message = message;
×
NEW
155
        return this;
×
156
    }
157

158
    /**
159
     * Gets the ccMe flag.
160
     *
161
     * @return the ccMe flag
162
     */
163
    public Boolean getCcMe() {
164
        return ccMe;
1✔
165
    }
166

167
    /**
168
     * Sets the ccMe flag.
169
     *
170
     * @param ccMe the ccMe flag
171
     * @return this CreateShareRequest
172
     */
173
    public CreateShareRequest setCcMe(Boolean ccMe) {
NEW
174
        this.ccMe = ccMe;
×
NEW
175
        return this;
×
176
    }
177

178
    /**
179
     * A convenience class for creating a {@link CreateShareRequest} with the appropriate fields.
180
     */
NEW
181
    public static class CreateShareRequestBuilder {
×
182
        private String email;
183
        private Long groupId;
184
        private AccessLevel accessLevel;
185
        private String subject;
186
        private String message;
187
        private Boolean ccMe;
188

189
        /**
190
         * Sets the email of the user.
191
         *
192
         * @param email the email
193
         * @return this CreateShareRequestBuilder
194
         */
195
        public CreateShareRequestBuilder setEmail(String email) {
NEW
196
            this.email = email;
×
NEW
197
            return this;
×
198
        }
199

200
        /**
201
         * Sets the group id.
202
         *
203
         * @param groupId the group id
204
         * @return this CreateShareRequestBuilder
205
         */
206
        public CreateShareRequestBuilder setGroupId(Long groupId) {
NEW
207
            this.groupId = groupId;
×
NEW
208
            return this;
×
209
        }
210

211
        /**
212
         * Sets the access level.
213
         *
214
         * @param accessLevel the access level
215
         * @return this CreateShareRequestBuilder
216
         */
217
        public CreateShareRequestBuilder setAccessLevel(AccessLevel accessLevel) {
NEW
218
            this.accessLevel = accessLevel;
×
NEW
219
            return this;
×
220
        }
221

222
        /**
223
         * Sets the subject of the email.
224
         *
225
         * @param subject the subject
226
         * @return this CreateShareRequestBuilder
227
         */
228
        public CreateShareRequestBuilder setSubject(String subject) {
NEW
229
            this.subject = subject;
×
NEW
230
            return this;
×
231
        }
232

233
        /**
234
         * Sets the message of the email.
235
         *
236
         * @param message the message
237
         * @return this CreateShareRequestBuilder
238
         */
239
        public CreateShareRequestBuilder setMessage(String message) {
NEW
240
            this.message = message;
×
NEW
241
            return this;
×
242
        }
243

244
        /**
245
         * Sets the ccMe flag.
246
         *
247
         * @param ccMe the ccMe flag
248
         * @return this CreateShareRequestBuilder
249
         */
250
        public CreateShareRequestBuilder setCcMe(Boolean ccMe) {
NEW
251
            this.ccMe = ccMe;
×
NEW
252
            return this;
×
253
        }
254

255
        /**
256
         * Builds the CreateShareRequest.
257
         *
258
         * @return the CreateShareRequest
259
         */
260
        public CreateShareRequest build() {
NEW
261
            CreateShareRequest request = new CreateShareRequest();
×
NEW
262
            request.setEmail(email);
×
NEW
263
            request.setGroupId(groupId);
×
NEW
264
            request.setAccessLevel(accessLevel);
×
NEW
265
            request.setSubject(subject);
×
NEW
266
            request.setMessage(message);
×
NEW
267
            request.setCcMe(ccMe);
×
NEW
268
            return request;
×
269
        }
270
    }
271
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc