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

smartsheet / smartsheet-java-sdk / #43

24 Aug 2023 10:26PM UTC coverage: 50.427% (-0.02%) from 50.442%
#43

push

github-actions

web-flow
Fix Checkstyle violations in api/models Classes (#57)

This will fix ~900 violations

189 of 189 new or added lines in 59 files covered. (100.0%)

3423 of 6788 relevant lines covered (50.43%)

0.5 hits per line

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

34.67
/src/main/java/com/smartsheet/api/models/SheetPublish.java
1
package com.smartsheet.api.models;
2

3
/*
4
 * #[license]
5
 * Smartsheet SDK for Java
6
 * %%
7
 * Copyright (C) 2023 Smartsheet
8
 * %%
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
 * you may not use this file except in compliance with the License.
11
 * You may obtain a copy of the License at
12
 *
13
 *      http://www.apache.org/licenses/LICENSE-2.0
14
 *
15
 * Unless required by applicable law or agreed to in writing, software
16
 * distributed under the License is distributed on an "AS IS" BASIS,
17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
 * See the License for the specific language governing permissions and
19
 * limitations under the License.
20
 * %[license]
21
 */
22

23
/**
24
 * Represents the publish status of a sheet.
25
 * @see <a href="http://help.smartsheet.com/customer/portal/articles/522078-publishing-sheets">Help Publishing
26
 * Sheets</a>
27
 */
28
public class SheetPublish {
1✔
29
    /**
30
     * Represents the read-only lite (static HTML UI) flag.
31
     */
32
    private Boolean readOnlyLiteEnabled;
33

34
    /**
35
     * Represents the read-only full (fancy UI) flag.
36
     */
37
    private Boolean readOnlyFullEnabled;
38

39
    /**
40
     * Represents the read-write enabled flag.
41
     */
42
    private Boolean readWriteEnabled;
43

44
    /**
45
     * Represents the iCal enabled flag.
46
     */
47
    private Boolean icalEnabled;
48

49
    /**
50
     * Flag to indicate who can access the 'Read-Only Full' view of the published sheet:
51
     *    If "ALL", it is available to anyone who has the link.
52
     *    If "ORG", it is available only to members of the sheet owner's Smartsheet organization.
53
     */
54
    private String readOnlyFullAccessibleBy;
55

56
    /**
57
     * Flag to indicate who can access the 'Edit by Anyone' view of the published sheet:
58
     *    If "ALL", it is available to anyone who has the link.
59
     *    If "ORG", it is available only to members of the sheet owner's Smartsheet organization.
60
     */
61
    private String readWriteAccessibleBy;
62

63
    /**
64
     * Represents the read-only lite (static HTML UI) URL.
65
     */
66
    private String readOnlyLiteUrl;
67

68
    /**
69
     * Represents the read-only lite URL with HTTPS.
70
     */
71
    private String readOnlyLiteSslUrl;
72

73
    /**
74
     * Represents the read-only full URL.
75
     */
76
    private String readOnlyFullUrl;
77

78
    /**
79
     * Represents the read-write URL.
80
     */
81
    private String readWriteUrl;
82

83
    /**
84
     * Represents the iCal URL.
85
     */
86
    private String icalUrl;
87

88
    /**
89
     * Flag to show or hide the left nav toolbar for the read only sheet.
90
     */
91
    private Boolean readOnlyFullShowToolbar;
92

93
    /**
94
     * Flag to show or hide the left nav toolbar for the read/write sheet.
95
     */
96
    private Boolean readWriteShowToolbar;
97

98
    /**
99
     * Default view for read only published sheet. (GRID, CARDS, CALENDAR)
100
     */
101
    private String readOnlyFullDefaultView;
102

103
    /**
104
     * Default view for read write published sheet. (GRID, CARDS, CALENDAR)
105
     */
106
    private String readWriteDefaultView;
107

108
    /**
109
     * Gets the read only lite enabled flag.
110
     *
111
     * @return the read only lite enabled flag
112
     */
113
    public Boolean getReadOnlyLiteEnabled() {
114
        return readOnlyLiteEnabled;
1✔
115
    }
116

117
    /**
118
     * Sets the read only lite (static html UI) enabled flag.
119
     *
120
     * @param readOnlyLiteEnabled the new read only lite enabled flag
121
     */
122
    public SheetPublish setReadOnlyLiteEnabled(Boolean readOnlyLiteEnabled) {
123
        this.readOnlyLiteEnabled = readOnlyLiteEnabled;
1✔
124
        return this;
1✔
125
    }
126

127
    /**
128
     * Gets the read only full (fancy UI) enabled flag.
129
     *
130
     * @return the read only full enabled flag
131
     */
132
    public Boolean getReadOnlyFullEnabled() {
133
        return readOnlyFullEnabled;
1✔
134
    }
135

136
    /**
137
     * Sets the read only full (fancy UI) enabled flag.
138
     *
139
     * @param readOnlyFullEnabled the new read only full enabled flag
140
     */
141
    public SheetPublish setReadOnlyFullEnabled(Boolean readOnlyFullEnabled) {
142
        this.readOnlyFullEnabled = readOnlyFullEnabled;
1✔
143
        return this;
1✔
144
    }
145

146
    /**
147
     * Gets the read write enabled flag.
148
     *
149
     * @return the read write enabled flag
150
     */
151
    public Boolean getReadWriteEnabled() {
152
        return readWriteEnabled;
1✔
153
    }
154

155
    /**
156
     * Sets the read write enabled flag.
157
     *
158
     * @param readWriteEnabled the new read write enabled flag
159
     */
160
    public SheetPublish setReadWriteEnabled(Boolean readWriteEnabled) {
161
        this.readWriteEnabled = readWriteEnabled;
1✔
162
        return this;
1✔
163
    }
164

165
    /**
166
     * Gets the ical enabled flag.
167
     *
168
     * @return the ical enabled flag
169
     */
170
    public Boolean getIcalEnabled() {
171
        return icalEnabled;
1✔
172
    }
173

174
    /**
175
     * Sets the ical enabled flag.
176
     *
177
     * @param icalEnabled the new ical enabled flag
178
     */
179
    public SheetPublish setIcalEnabled(Boolean icalEnabled) {
180
        this.icalEnabled = icalEnabled;
1✔
181
        return this;
1✔
182
    }
183

184
    /**
185
     * Get string indicating who can access the "Read-Only Full" view of the published sheet.
186
     *
187
     * @return readOnlyFullAccessibleBy
188
     */
189
    public String getReadOnlyFullAccessibleBy() {
190
        return readOnlyFullAccessibleBy;
1✔
191
    }
192

193
    /**
194
     * Set string indicating who can access the "Read-Only Full" view of the published sheet.
195
     */
196
    public SheetPublish setReadOnlyFullAccessibleBy(String readOnlyFullAccessibleBy) {
197
        this.readOnlyFullAccessibleBy = readOnlyFullAccessibleBy;
×
198
        return this;
×
199
    }
200

201
    /**
202
     * Get string indicating who can access the "Edit by Anyone" view of the published sheet.
203
     *
204
     * @return readWriteAccessibleBy
205
     */
206
    public String getReadWriteAccessibleBy() {
207
        return readWriteAccessibleBy;
1✔
208
    }
209

210
    /**
211
     * Set string indicating who can access the "Edit by Anyone" view of the published sheet.
212
     */
213
    public SheetPublish setReadWriteAccessibleBy(String readWriteAccessibleBy) {
214
        this.readWriteAccessibleBy = readWriteAccessibleBy;
×
215
        return this;
×
216
    }
217

218
    /**
219
     * Gets the read only lite url.
220
     *
221
     * @return the read only lite url
222
     */
223
    public String getReadOnlyLiteUrl() {
224
        return readOnlyLiteUrl;
1✔
225
    }
226

227
    /**
228
     * Sets the read only lite (static html UI) url.
229
     *
230
     * @param readOnlyLiteUrl the new read only lite url
231
     */
232
    public SheetPublish setReadOnlyLiteUrl(String readOnlyLiteUrl) {
233
        this.readOnlyLiteUrl = readOnlyLiteUrl;
1✔
234
        return this;
1✔
235
    }
236

237
    /**
238
     * Get the read only lite ssl url
239
     *
240
     * @return the read only lite ssl url
241
     */
242
    public String getReadOnlyLiteSslUrl() {
243
        return readOnlyLiteSslUrl;
1✔
244
    }
245

246
    /**
247
     * Sets the read only lite ssl url
248
     */
249
    public SheetPublish setReadOnlyLiteSslUrl(String readOnlyLiteSslUrl) {
250
        this.readOnlyLiteSslUrl = readOnlyLiteSslUrl;
×
251
        return this;
×
252
    }
253

254
    /**
255
     * Gets the read only full (fancy UI) url.
256
     *
257
     * @return the read only full url
258
     */
259
    public String getReadOnlyFullUrl() {
260
        return readOnlyFullUrl;
1✔
261
    }
262

263
    /**
264
     * Sets the read only full (fancy UI) url.
265
     *
266
     * @param readOnlyFullUrl the new read only full url
267
     */
268
    public SheetPublish setReadOnlyFullUrl(String readOnlyFullUrl) {
269
        this.readOnlyFullUrl = readOnlyFullUrl;
×
270
        return this;
×
271
    }
272

273
    /**
274
     * Gets the read write url.
275
     *
276
     * @return the read write url
277
     */
278
    public String getReadWriteUrl() {
279
        return readWriteUrl;
1✔
280
    }
281

282
    /**
283
     * Sets the read write url.
284
     *
285
     * @param readWriteUrl the new read write url
286
     */
287
    public SheetPublish setReadWriteUrl(String readWriteUrl) {
288
        this.readWriteUrl = readWriteUrl;
×
289
        return this;
×
290
    }
291

292
    /**
293
     * Gets the ical url.
294
     *
295
     * @return the ical url
296
     */
297
    public String getIcalUrl() {
298
        return icalUrl;
1✔
299
    }
300

301
    /**
302
     * Sets the ical url.
303
     *
304
     * @param icalUrl the new ical url
305
     */
306
    public SheetPublish setIcalUrl(String icalUrl) {
307
        this.icalUrl = icalUrl;
×
308
        return this;
×
309
    }
310

311
    /**
312
     * Get the read only full show toolbar flag
313
     *
314
     * @return readOnlyFullShowToolbar
315
     */
316
    public Boolean getReadOnlyFullShowToolbar() {
317
        return readOnlyFullShowToolbar;
1✔
318
    }
319

320
    /**
321
     * Set the read only full show toolbar flag
322
     */
323
    public SheetPublish setReadOnlyFullShowToolbar(Boolean readOnlyFullShowToolbar) {
324
        this.readOnlyFullShowToolbar = readOnlyFullShowToolbar;
×
325
        return this;
×
326
    }
327

328
    /**
329
     * Get the read/write show toolbar flag
330
     *
331
     * @return readWriteShowToolbar
332
     */
333
    public Boolean getReadWriteShowToolbar() {
334
        return readWriteShowToolbar;
1✔
335
    }
336

337
    /**
338
     * Set the read/write show toolbar flag
339
     */
340
    public SheetPublish setReadWriteShowToolbar(Boolean readWriteShowToolbar) {
341
        this.readWriteShowToolbar = readWriteShowToolbar;
×
342
        return this;
×
343
    }
344

345
    /**
346
     * Get the read only full default view
347
     *
348
     * @return readOnlyFullDefaultView. Valid options are "GRID", "CARDS", "CALENDAR"
349
     */
350
    public String getReadOnlyFullDefaultView() {
351
        return readOnlyFullDefaultView;
1✔
352
    }
353

354
    /**
355
     * Set the read only full default view
356
     *
357
     * @param readOnlyFullDefaultView Valid options are "GRID", "CARDS", "CALENDAR"
358
     * @return the SheetPublish
359
     */
360
    public SheetPublish setReadOnlyFullDefaultView(String readOnlyFullDefaultView) {
361
        this.readOnlyFullDefaultView = readOnlyFullDefaultView;
×
362
        return this;
×
363
    }
364

365
    /**
366
     * Get the read write default view
367
     *
368
     * @return readWriteDefaultView. Valid options are "GRID", "CARDS", "CALENDAR"
369
     */
370
    public String getReadWriteDefaultView() {
371
        return readWriteDefaultView;
1✔
372
    }
373

374
    /**
375
     * Set the read write default view
376
     *
377
     * @param readWriteDefaultView Valid options are "GRID", "CARDS", "CALENDAR"
378
     * @return the SheetPublish
379
     */
380
    public SheetPublish setReadWriteDefaultView(String readWriteDefaultView) {
381
        this.readWriteDefaultView = readWriteDefaultView;
×
382
        return this;
×
383
    }
384

385
    /**
386
     * A convenience class for making a {@link SheetPublish} object with the necessary fields to publish a sheet.
387
     */
388
    public static class PublishStatusBuilder {
×
389
        private Boolean readOnlyLiteEnabled;
390
        private Boolean readOnlyFullEnabled;
391
        private Boolean readWriteEnabled;
392
        private Boolean icalEnabled;
393
        private Boolean readWriteShowToolbarEnabled;
394
        private Boolean readOnlyFullShowToolbarEnabled;
395

396
        /**
397
         * Show or hide toolbar on a read/write sheet
398
         *
399
         * @return the publish status builder
400
         */
401
        public PublishStatusBuilder setReadWriteShowToolbarEnabled(Boolean readWriteShowToolbarEnabled) {
402
            this.readWriteShowToolbarEnabled = readWriteShowToolbarEnabled;
×
403
            return this;
×
404
        }
405

406
        /**
407
         * Show or hide toolbar on a read only full sheet
408
         *
409
         * @return the publish status builder
410
         */
411
        public PublishStatusBuilder setReadOnlyFullShowToolbarEnabled(Boolean readOnlyFullShowToolbarEnabled) {
412
            this.readOnlyFullShowToolbarEnabled = readOnlyFullShowToolbarEnabled;
×
413
            return this;
×
414
        }
415

416
        /**
417
         * Read only lite enabled.
418
         *
419
         * @param readOnlyLiteEnabled the read only lite (static html UI) enabled
420
         * @return the publish status builder
421
         */
422
        public PublishStatusBuilder setReadOnlyLiteEnabled(Boolean readOnlyLiteEnabled) {
423
            this.readOnlyLiteEnabled = readOnlyLiteEnabled;
×
424
            return this;
×
425
        }
426

427
        /**
428
         * Read only full (fancy UI) enabled.
429
         *
430
         * @param readOnlyFullEnabled the read only full enabled
431
         * @return the publish status builder
432
         */
433
        public PublishStatusBuilder setReadOnlyFullEnabled(Boolean readOnlyFullEnabled) {
434
            this.readOnlyFullEnabled = readOnlyFullEnabled;
×
435
            return this;
×
436
        }
437

438
        /**
439
         * Read write enabled.
440
         *
441
         * @param readWriteEnabled the read write enabled
442
         * @return the publish status builder
443
         */
444
        public PublishStatusBuilder setReadWriteEnabled(Boolean readWriteEnabled) {
445
            this.readWriteEnabled = readWriteEnabled;
×
446
            return this;
×
447
        }
448

449
        /**
450
         * Ical enabled.
451
         *
452
         * @param icalEnabled the ical enabled
453
         * @return the publish status builder
454
         */
455
        public PublishStatusBuilder setIcalEnabled(Boolean icalEnabled) {
456
            this.icalEnabled = icalEnabled;
×
457
            return this;
×
458
        }
459

460
        /**
461
         * Gets the read only lite enabled.
462
         *
463
         * @return the read only lite enabled
464
         */
465
        public Boolean getReadOnlyLiteEnabled() {
466
            return readOnlyLiteEnabled;
×
467
        }
468

469
        /**
470
         * Gets the read only full enabled.
471
         *
472
         * @return the read only full enabled
473
         */
474
        public Boolean getReadOnlyFullEnabled() {
475
            return readOnlyFullEnabled;
×
476
        }
477

478
        /**
479
         * Gets the read write enabled.
480
         *
481
         * @return the read write enabled
482
         */
483
        public Boolean getReadWriteEnabled() {
484
            return readWriteEnabled;
×
485
        }
486

487
        /**
488
         * Gets the ical enabled.
489
         *
490
         * @return the ical enabled
491
         */
492
        public Boolean getIcalEnabled() {
493
            return icalEnabled;
×
494
        }
495

496
        /**
497
         * Builds the.
498
         *
499
         * @return the sheet publish
500
         */
501
        public SheetPublish build() {
502

503
            if (readOnlyLiteEnabled == null || readOnlyFullEnabled == null || readWriteEnabled == null) {
×
504
                throw new InstantiationError(
×
505
                        "'Read only lite', 'read only full' and 'read write' must be set to " +
506
                                "update the publishing status."
507
                );
508
            }
509

510
            SheetPublish sheetPublish = new SheetPublish();
×
511
            sheetPublish.readOnlyLiteEnabled = readOnlyLiteEnabled;
×
512
            sheetPublish.readOnlyFullEnabled = readOnlyFullEnabled;
×
513
            sheetPublish.readWriteEnabled = readWriteEnabled;
×
514
            sheetPublish.icalEnabled = icalEnabled;
×
515

516
            if (readOnlyFullShowToolbarEnabled != null) {
×
517
                sheetPublish.readOnlyFullShowToolbar = readOnlyFullShowToolbarEnabled;
×
518
            }
519

520
            if (readWriteShowToolbarEnabled != null) {
×
521
                sheetPublish.readWriteShowToolbar = readWriteShowToolbarEnabled;
×
522
            }
523

524
            return sheetPublish;
×
525
        }
526
    }
527
}
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

© 2026 Coveralls, Inc