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

smartsheet / smartsheet-java-sdk / #56

06 Jun 2025 04:28PM UTC coverage: 60.611% (+0.06%) from 60.548%
#56

push

github

web-flow
chore: Added pull request template (#121)

* Initial commit: Added pull request template

* Updated wording and grammar

* Added relevant links and removed style guide requirement

* chore: Updated pull request template and added codeowners file

* chore: Removed redundant checklist point and codeowners file

---------

Co-authored-by: Priyanka Lakhe <priyankalakhe@gmail.com>

4164 of 6870 relevant lines covered (60.61%)

0.61 hits per line

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

34.78
/src/main/java/com/smartsheet/api/models/Workspace.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 the Workspace object which is an area in which sheets, reports, templates and sub-folders can be
23
 * organized, similar to a folder.
24
 *
25
 * @see <a href="http://help.smartsheet.com/customer/portal/articles/506687-creating-a-workspace">Help Creating a
26
 * Workspace</a>
27
 */
28
public class Workspace extends Folder {
1✔
29
    /**
30
     * Represents the user's permissions on a workspace.
31
     */
32
    private AccessLevel accessLevel;
33

34
    /**
35
     * Represents the link .
36
     */
37
    private String permalink;
38

39
    /**
40
     * Represents if the workspace is marked as favorite
41
     *
42
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
43
     */
44
    @Deprecated(since = "3.2.2", forRemoval = true)
45
    private Boolean favorite;
46

47
    /**
48
     * Gets the user's permissions on a workspace.
49
     *
50
     * @return the access level
51
     */
52
    public AccessLevel getAccessLevel() {
53
        return accessLevel;
1✔
54
    }
55

56
    /**
57
     * Sets the user's permissions on a workspace.
58
     *
59
     * @param accessLevel the new access level
60
     */
61
    public Workspace setAccessLevel(AccessLevel accessLevel) {
62
        this.accessLevel = accessLevel;
1✔
63
        return this;
1✔
64
    }
65

66
    /**
67
     * Gets the permalink to the workspace.
68
     *
69
     * @return the permalink
70
     */
71
    public String getPermalink() {
72
        return permalink;
1✔
73
    }
74

75
    /**
76
     * Sets the permalink to the workspace.
77
     *
78
     * @param permalink the new permalink
79
     */
80
    public Folder setPermalink(String permalink) {
81
        this.permalink = permalink;
1✔
82
        return null;
1✔
83
    }
84

85
    /**
86
     * Gets the favorite
87
     *
88
     * @return the favorite
89
     *
90
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
91
     */
92
    @Deprecated(since = "3.2.2", forRemoval = true)
93
    public Boolean getFavorite() {
94
        return favorite;
1✔
95
    }
96

97
    /**
98
     * Sets the favorite
99
     *
100
     * @param favorite the favorite
101
     *
102
     * @deprecated As of API 3.2.2. Please use the isFavorite method in FavoritesResources instead.
103
     */
104
    @Deprecated(since = "3.2.2", forRemoval = true)
105
    public Folder setFavorite(Boolean favorite) {
106
        this.favorite = favorite;
×
107
        return null;
×
108
    }
109

110
    /**
111
     * A convenience class for creating a {@link Workspace} object with the appropriate fields for updating a workspace.
112
     */
113
    public static class UpdateWorkspaceBuilder {
×
114
        private String workspaceName;
115
        private Long id;
116

117
        /**
118
         * Get the workspace id
119
         *
120
         * @return the workspace id
121
         */
122
        public Long getId() {
123
            return id;
×
124
        }
125

126
        /**
127
         * Set the workspace id
128
         *
129
         * @param id the workspace id
130
         * @return the builder
131
         */
132
        public UpdateWorkspaceBuilder setId(Long id) {
133
            this.id = id;
×
134
            return this;
×
135
        }
136

137
        /**
138
         * The name of the workspace.
139
         *
140
         * @param name the name
141
         * @return the update workspace builder
142
         */
143
        public UpdateWorkspaceBuilder setName(String name) {
144
            this.workspaceName = name;
×
145
            return this;
×
146
        }
147

148
        /**
149
         * Gets the name.
150
         *
151
         * @return the name
152
         */
153
        public String getName() {
154
            return workspaceName;
×
155
        }
156

157
        /**
158
         * Builds the {@link Workspace}.
159
         *
160
         * @return the workspace
161
         */
162
        public Workspace build() {
163
            if (workspaceName == null) {
×
164
                throw new InstantiationError("A workspace name is required.");
×
165
            }
166

167
            Workspace workspace = new Workspace();
×
168
            workspace.setName(workspaceName);
×
169
            workspace.setId(id);
×
170
            return workspace;
×
171
        }
172
    }
173
}
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