• 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.78
/src/main/java/com/smartsheet/api/models/Workspace.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
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
    private Boolean favorite;
43

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

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

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

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

82
    /**
83
     * Gets the favorite
84
     *
85
     * @return the favorite
86
     */
87
    public Boolean getFavorite() {
88
        return favorite;
1✔
89
    }
90

91
    /**
92
     * Sets the favorite
93
     *
94
     * @param favorite the favorite
95
     */
96
    public Folder setFavorite(Boolean favorite) {
97
        this.favorite = favorite;
×
98
        return null;
×
99
    }
100

101
    /**
102
     * A convenience class for creating a {@link Workspace} object with the appropriate fields for updating a workspace.
103
     */
104
    public static class UpdateWorkspaceBuilder {
×
105
        private String workspaceName;
106
        private Long id;
107

108
        /**
109
         * Get the workspace id
110
         *
111
         * @return the workspace id
112
         */
113
        public Long getId() {
114
            return id;
×
115
        }
116

117
        /**
118
         * Set the workspace id
119
         *
120
         * @param id the workspace id
121
         * @return the builder
122
         */
123
        public UpdateWorkspaceBuilder setId(Long id) {
124
            this.id = id;
×
125
            return this;
×
126
        }
127

128
        /**
129
         * The name of the workspace.
130
         *
131
         * @param name the name
132
         * @return the update workspace builder
133
         */
134
        public UpdateWorkspaceBuilder setName(String name) {
135
            this.workspaceName = name;
×
136
            return this;
×
137
        }
138

139
        /**
140
         * Gets the name.
141
         *
142
         * @return the name
143
         */
144
        public String getName() {
145
            return workspaceName;
×
146
        }
147

148
        /**
149
         * Builds the {@link Workspace}.
150
         *
151
         * @return the workspace
152
         */
153
        public Workspace build() {
154
            if (workspaceName == null) {
×
155
                throw new InstantiationError("A workspace name is required.");
×
156
            }
157

158
            Workspace workspace = new Workspace();
×
159
            workspace.setName(workspaceName);
×
160
            workspace.setId(id);
×
161
            return workspace;
×
162
        }
163
    }
164
}
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