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

smartsheet / smartsheet-java-sdk / #58

23 Sep 2025 06:13PM UTC coverage: 59.737% (-1.1%) from 60.803%
#58

push

github

web-flow
Add user downgrade seat type endpoint (#131)

* Add support for upgrade user seat type route

* Change return type

* Add support for the user downgrade seat type endpoint

* Remove * imports, replace switch with if statement, remove overload

* Update changelog and build.gradle

* Add user downgrade and upgrade API calls

* Add user downgrade and upgrade API calls

* Add user downgrade and upgrade API calls

* Add user downgrade and upgrade API calls

---------

Co-authored-by: Velihan Zelev <velihan.zelev@smartsheet.com>

12 of 13 new or added lines in 2 files covered. (92.31%)

192 existing lines in 7 files now uncovered.

4310 of 7215 relevant lines covered (59.74%)

0.6 hits per line

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

59.32
/src/main/java/com/smartsheet/api/models/Folder.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 java.util.Date;
20
import java.util.List;
21

22
/**
23
 * Represents a folder.
24
 */
25
public class Folder extends NamedModel<Long> {
26

27
    /**
28
     * Represents the sheets contained in the folder.
29
     */
30
    private List<Sheet> sheets;
31

32
    /**
33
     * Represents the child folders contained in the folder.
34
     */
35
    private List<Folder> folders;
36

37
    /**
38
     * Represents the reports.
39
     */
40
    private List<Report> reports;
41

42
    /**
43
     * Represents the templates contained in the folder.
44
     */
45
    private List<Template> templates;
46

47
    /**
48
     * Represents the Sights contained in the folder.
49
     */
50
    private List<Sight> sights;
51

52
    /**
53
     * Returns if the user has marked the Folder as a Favorite in their Home tab.
54
     *
55
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
56
     */
57
    @Deprecated(since = "3.2.2", forRemoval = true)
58
    private Boolean favorite;
59

60
    /**
61
     * Represents the Direct URL to Folder.
62
     */
63
    private String permalink;
64

65
    /**
66
     * Represents the source of the folder.
67
     */
68
    private Source source;
69

70
    /**
71
     * Represents the folder creation date.
72
     */
73
    private Date createdAt;
74

75
    /**
76
     * Represents the folder last modified date.
77
     */
78
    private Date modifiedAt;
79

80
    /**
81
     * Default constructor
82
     */
83
    public Folder() {
1✔
84
    }
1✔
85

86
    /**
87
     * Construct a Folder with specified id
88
     *
89
     * @param id Folder id
90
     */
UNCOV
91
    public Folder(Long id) {
×
UNCOV
92
        this.setId(id);
×
UNCOV
93
    }
×
94

95
    /**
96
     * Provide an 'override' of setName (returns Folder not NamedModel)
97
     *
98
     * @param name the new name
99
     */
100
    public Folder setName(String name) {
101
        super.setName(name);
1✔
102
        return this;
1✔
103
    }
104

105
    /**
106
     * Gets the Direct URL to Folder.
107
     *
108
     * @return the sheets
109
     */
110
    public String getPermalink() {
111
        return permalink;
1✔
112
    }
113

114
    /**
115
     * Sets the Direct URL to Folder.
116
     *
117
     * @param permalink the new sheets
118
     */
119
    public Folder setPermalink(String permalink) {
120
        this.permalink = permalink;
1✔
121
        return this;
1✔
122
    }
123

124
    /**
125
     * Gets the favorite boolean value of folder in Home.
126
     *
127
     * @return the sheets
128
     *
129
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
130
     */
131
    @Deprecated(since = "3.2.2", forRemoval = true)
132
    public Boolean getFavorite() {
133
        return favorite;
1✔
134
    }
135

136
    /**
137
     * Sets the favorite boolean value of folder in Home.
138
     *
139
     * @param favorite the new sheets
140
     *
141
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
142
     */
143
    @Deprecated(since = "3.2.2", forRemoval = true)
144
    public Folder setFavorite(Boolean favorite) {
UNCOV
145
        this.favorite = favorite;
×
UNCOV
146
        return this;
×
147
    }
148

149
    /**
150
     * Gets the sheets in the folder.
151
     *
152
     * @return the sheets
153
     */
154
    public List<Sheet> getSheets() {
155
        return sheets;
1✔
156
    }
157

158
    /**
159
     * Sets the sheets contained in the folder.
160
     *
161
     * @param sheets the new sheets
162
     */
163
    public Folder setSheets(List<Sheet> sheets) {
164
        this.sheets = sheets;
1✔
165
        return this;
1✔
166
    }
167

168
    /**
169
     * Gets the folders contained in this folder.
170
     *
171
     * @return the folders
172
     */
173
    public List<Folder> getFolders() {
174
        return folders;
1✔
175
    }
176

177
    /**
178
     * Sets the folders contained in this folder.
179
     *
180
     * @param folders the new folders
181
     */
182
    public Folder setFolders(List<Folder> folders) {
183
        this.folders = folders;
1✔
184
        return this;
1✔
185
    }
186

187
    /**
188
     * Gets the reports.
189
     *
190
     * @return the reports
191
     */
192
    public List<Report> getReports() {
193
        return reports;
1✔
194
    }
195

196
    /**
197
     * Sets the reports.
198
     *
199
     * @param reports the new reports
200
     */
201
    public Folder setReports(List<Report> reports) {
UNCOV
202
        this.reports = reports;
×
UNCOV
203
        return this;
×
204
    }
205

206
    /**
207
     * Gets the templates contained in this folder.
208
     *
209
     * @return the templates
210
     */
211
    public List<Template> getTemplates() {
212
        return templates;
1✔
213
    }
214

215
    /**
216
     * Sets the templates contained in this folder.
217
     *
218
     * @param templates the new templates
219
     */
220
    public Folder setTemplates(List<Template> templates) {
UNCOV
221
        this.templates = templates;
×
222
        return this;
×
223
    }
224

225
    /**
226
     * Get the sights contained in this folder
227
     *
228
     * @return the sights
229
     */
230
    public List<Sight> getSights() {
231
        return sights;
1✔
232
    }
233

234
    /**
235
     * Sets the sights contained in this folder.
236
     */
237
    public Folder setSights(List<Sight> sights) {
UNCOV
238
        this.sights = sights;
×
UNCOV
239
        return this;
×
240
    }
241

242
    /**
243
     * Gets the source.
244
     *
245
     * @return the source
246
     */
247
    public Source getSource() {
248
        return source;
1✔
249
    }
250

251
    /**
252
     * Sets the source.
253
     *
254
     * @param source the source
255
     */
256
    public Folder setSource(Source source) {
UNCOV
257
        this.source = source;
×
UNCOV
258
        return this;
×
259
    }
260

261
    /**
262
     * Gets the folder creation date.
263
     *
264
     * @return the creation date
265
     */
266
    public Date getCreatedAt() {
267
        return createdAt;
1✔
268
    }
269

270
    /**
271
     * Sets the folder creation date.
272
     *
273
     * @param createdAt the creation date
274
     */
275
    public Folder setCreatedAt(Date createdAt) {
UNCOV
276
        this.createdAt = createdAt;
×
UNCOV
277
        return this;
×
278
    }
279

280
    /**
281
     * Gets the folder last modified date.
282
     *
283
     * @return the last modified date
284
     */
285
    public Date getModifiedAt() {
286
        return modifiedAt;
1✔
287
    }
288

289
    /**
290
     * Sets the folder last modified date.
291
     *
292
     * @param modifiedAt the last modified date
293
     */
294
    public Folder setModifiedAt(Date modifiedAt) {
UNCOV
295
        this.modifiedAt = modifiedAt;
×
UNCOV
296
        return this;
×
297
    }
298

299
    /**
300
     * A convenience class for setting up a folder with the appropriate fields for updating the folder.
301
     */
302
    public static class UpdateFolderBuilder {
1✔
303
        private String folderName;
304
        private Long id;
305

306
        /**
307
         * Name.
308
         *
309
         * @param name the name
310
         * @return the update folder builder
311
         */
312
        public UpdateFolderBuilder setName(String name) {
313
            this.folderName = name;
1✔
314
            return this;
1✔
315
        }
316

317
        /**
318
         * Gets the name.
319
         *
320
         * @return the name
321
         */
322
        public String getName() {
323
            return folderName;
×
324
        }
325

326
        /**
327
         * Gets the folder id.
328
         *
329
         * @return the folder id.
330
         */
331
        public Long getId() {
UNCOV
332
            return id;
×
333
        }
334

335
        /**
336
         * Sets the folder id.
337
         *
338
         * @param id the id of the folder.
339
         * @return the builder
340
         */
341
        public UpdateFolderBuilder setId(Long id) {
UNCOV
342
            this.id = id;
×
UNCOV
343
            return this;
×
344
        }
345

346
        /**
347
         * Builds the folder.
348
         *
349
         * @return the folder
350
         */
351
        public Folder build() {
352
            if (folderName == null) {
1✔
UNCOV
353
                throw new IllegalStateException("A folder name is required.");
×
354
            }
355

356
            Folder folder = new Folder();
1✔
357
            folder.setId(id);
1✔
358
            folder.setName(folderName);
1✔
359
            return folder;
1✔
360
        }
361
    }
362

363
    /**
364
     * A convenience class for setting up a folder with the appropriate fields for updating the folder.
365
     */
366
    public static class CreateFolderBuilder {
1✔
367
        private String folderName;
368

369
        /**
370
         * Name.
371
         *
372
         * @param name the name
373
         * @return the create folder builder
374
         */
375
        public CreateFolderBuilder setName(String name) {
376
            this.folderName = name;
1✔
377
            return this;
1✔
378
        }
379

380
        /**
381
         * Gets the name.
382
         *
383
         * @return the name
384
         */
385
        public String getName() {
UNCOV
386
            return folderName;
×
387
        }
388

389
        /**
390
         * Builds the folder.
391
         *
392
         * @return the folder
393
         */
394
        public Folder build() {
395
            if (folderName == null) {
1✔
UNCOV
396
                throw new IllegalStateException("A folder name is required.");
×
397
            }
398

399
            Folder folder = new Folder();
1✔
400
            folder.setName(folderName);
1✔
401
            return folder;
1✔
402
        }
403
    }
404
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc