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

smartsheet / smartsheet-java-sdk / #55

02 Oct 2024 07:40PM UTC coverage: 60.548% (+0.7%) from 59.836%
#55

push

github

web-flow
Release prep for 3.2.1 (#103)

4156 of 6864 relevant lines covered (60.55%)

0.61 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
/*
2
 * Copyright (C) 2024 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
/**
20
 * Represents the publish status of a sheet.
21
 *
22
 * @see <a href="http://help.smartsheet.com/customer/portal/articles/522078-publishing-sheets">Help Publishing
23
 * Sheets</a>
24
 */
25
public class SheetPublish {
1✔
26
    /**
27
     * Represents the read-only lite (static HTML UI) flag.
28
     */
29
    private Boolean readOnlyLiteEnabled;
30

31
    /**
32
     * Represents the read-only full (fancy UI) flag.
33
     */
34
    private Boolean readOnlyFullEnabled;
35

36
    /**
37
     * Represents the read-write enabled flag.
38
     */
39
    private Boolean readWriteEnabled;
40

41
    /**
42
     * Represents the iCal enabled flag.
43
     */
44
    private Boolean icalEnabled;
45

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

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

60
    /**
61
     * Represents the read-only lite (static HTML UI) URL.
62
     */
63
    private String readOnlyLiteUrl;
64

65
    /**
66
     * Represents the read-only lite URL with HTTPS.
67
     */
68
    private String readOnlyLiteSslUrl;
69

70
    /**
71
     * Represents the read-only full URL.
72
     */
73
    private String readOnlyFullUrl;
74

75
    /**
76
     * Represents the read-write URL.
77
     */
78
    private String readWriteUrl;
79

80
    /**
81
     * Represents the iCal URL.
82
     */
83
    private String icalUrl;
84

85
    /**
86
     * Flag to show or hide the left nav toolbar for the read only sheet.
87
     */
88
    private Boolean readOnlyFullShowToolbar;
89

90
    /**
91
     * Flag to show or hide the left nav toolbar for the read/write sheet.
92
     */
93
    private Boolean readWriteShowToolbar;
94

95
    /**
96
     * Default view for read only published sheet. (GRID, CARDS, CALENDAR)
97
     */
98
    private String readOnlyFullDefaultView;
99

100
    /**
101
     * Default view for read write published sheet. (GRID, CARDS, CALENDAR)
102
     */
103
    private String readWriteDefaultView;
104

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

493
        /**
494
         * Builds the.
495
         *
496
         * @return the sheet publish
497
         */
498
        public SheetPublish build() {
499

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

507
            SheetPublish sheetPublish = new SheetPublish();
×
508
            sheetPublish.readOnlyLiteEnabled = readOnlyLiteEnabled;
×
509
            sheetPublish.readOnlyFullEnabled = readOnlyFullEnabled;
×
510
            sheetPublish.readWriteEnabled = readWriteEnabled;
×
511
            sheetPublish.icalEnabled = icalEnabled;
×
512

513
            if (readOnlyFullShowToolbarEnabled != null) {
×
514
                sheetPublish.readOnlyFullShowToolbar = readOnlyFullShowToolbarEnabled;
×
515
            }
516

517
            if (readWriteShowToolbarEnabled != null) {
×
518
                sheetPublish.readWriteShowToolbar = readWriteShowToolbarEnabled;
×
519
            }
520

521
            return sheetPublish;
×
522
        }
523
    }
524
}
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