• 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

0.0
/src/main/java/com/smartsheet/api/models/Event.java
1
package com.smartsheet.api.models;
2

3
/*
4
 * #[license]
5
 * Smartsheet Java SDK
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
import com.smartsheet.api.models.enums.EventAction;
24
import com.smartsheet.api.models.enums.EventObjectType;
25
import com.smartsheet.api.models.enums.EventSource;
26

27
import java.text.SimpleDateFormat;
28
import java.util.Map;
29
import java.util.TimeZone;
30

31
public class Event {
×
32

33
    /**
34
     * Name of the access token embedded in the request.
35
     */
36
    private String accessTokenName;
37

38
    /**
39
     * The action applied to the specified object
40
     */
41
    private EventAction action;
42

43
    /**
44
     * Container object for additional event-specific properties.
45
     */
46
    private Map<String, Object> additionalDetails;
47

48
    /**
49
     * Unique event identifier
50
     */
51
    private String eventId;
52

53
    /**
54
     * Date and time of the event
55
     */
56
    private Object eventTimestamp;
57

58
    /**
59
     * The identifier of the object impacted by the event
60
     */
61
    private Object objectId;
62

63
    /**
64
     * The Smartsheet resource impacted by the event
65
     */
66
    private EventObjectType objectType;
67

68
    /**
69
     * User whose authentication credential is embedded in the request that initiated the event.
70
     */
71
    private Long requestUserId;
72

73
    /**
74
     * Identifies the type of action that triggered the event
75
     */
76
    private EventSource source;
77

78
    /**
79
     * User assumed as the one who initiated the event.
80
     */
81
    private Long userId;
82

83
    /**
84
     * Gets the access token name associated with the event, can be null
85
     *
86
     * @return the access token name associated with the event
87
     */
88
    public String getAccessTokenName() {
89
        return accessTokenName;
×
90
    }
91

92
    /**
93
     * Sets the access token name associated with the event
94
     *
95
     * @param accessTokenName the access token name
96
     */
97
    public Event setAccessTokenName(String accessTokenName) {
98
        this.accessTokenName = accessTokenName;
×
99
        return this;
×
100
    }
101

102
    /**
103
     * Gets the action associated with the event (EventAction enumeration)
104
     *
105
     * @return the event action
106
     */
107
    public EventAction getAction() {
108
        return action;
×
109
    }
110

111
    /**
112
     * Sets the action associated with the event (EventAction enumeration)
113
     */
114
    public Event setAction(EventAction action) {
115
        this.action = action;
×
116
        return this;
×
117
    }
118

119
    /**
120
     * Returns a hashmap of additional details associated with the event
121
     *
122
     * @return the hashmap
123
     */
124
    public Map<String, Object> getAdditionalDetails() {
125
        return additionalDetails;
×
126
    }
127

128
    /**
129
     * Set the hashmap of additional details associated with the event
130
     *
131
     * @param additionalDetails the hashmap
132
     */
133
    public Event setAdditionalDetails(Map<String, Object> additionalDetails) {
134
        this.additionalDetails = additionalDetails;
×
135
        return this;
×
136
    }
137

138
    /**
139
     * Gets a unique event ID
140
     *
141
     * @return the event ID
142
     */
143
    public String getEventId() {
144
        return eventId;
×
145
    }
146

147
    /**
148
     * Sets a unique event ID
149
     *
150
     * @param eventId the event ID
151
     */
152
    public Event setEventId(String eventId) {
153
        this.eventId = eventId;
×
154
        return this;
×
155
    }
156

157
    /**
158
     * Gets an event timestamp, either a Date object, or Long if numericDates parameter is true on API call.
159
     *
160
     * @return the event timestamp
161
     */
162
    public Object getEventTimestamp() {
163
        return eventTimestamp;
×
164
    }
165

166
    /**
167
     * Sets an event timestamp
168
     *
169
     * @param eventTimestamp String if Date, Long if numericDate true on API call.
170
     */
171
    public Event setEventTimestamp(Object eventTimestamp) {
172
        if (eventTimestamp instanceof String) {
×
173
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
×
174
            sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
×
175
            try {
176
                this.eventTimestamp = sdf.parse(eventTimestamp.toString());
×
177
            } catch (Exception e) {
×
178
                // Empty Catch Block
179
            }
×
180
        } else {
×
181
            this.eventTimestamp = eventTimestamp;
×
182
        }
183
        return this;
×
184
    }
185

186
    /**
187
     * Get the object ID of the object associated with the event
188
     *
189
     * @return the object ID
190
     */
191
    public Object getObjectId() {
192
        return objectId;
×
193
    }
194

195
    /**
196
     * Sets an object ID for the object associated with the event
197
     *
198
     * @param objectId the object ID
199
     */
200
    public Event setObjectId(Object objectId) {
201
        this.objectId = objectId;
×
202
        return this;
×
203
    }
204

205
    /**
206
     * Gets the object type of the object associated with the event (EventObjectType enumeration)
207
     *
208
     * @return the object type
209
     */
210
    public EventObjectType getObjectType() {
211
        return objectType;
×
212
    }
213

214
    /**
215
     * Sets the object type of the object associated with the event
216
     *
217
     * @param objectType the object type
218
     */
219
    public Event setObjectType(EventObjectType objectType) {
220
        this.objectType = objectType;
×
221
        return this;
×
222
    }
223

224
    /**
225
     * Get the user ID of the user whose credential initiated the request
226
     *
227
     * @return the request user ID
228
     */
229
    public Long getRequestUserId() {
230
        return requestUserId;
×
231
    }
232

233
    /**
234
     * Sets the user ID of the user whose credential initiated the request
235
     *
236
     * @param requestUserId the request user ID
237
     */
238
    public Event setRequestUserId(Long requestUserId) {
239
        this.requestUserId = requestUserId;
×
240
        return this;
×
241
    }
242

243
    /**
244
     * Gets the source of the event request (EventSource enumeration)
245
     *
246
     * @return the event source
247
     */
248
    public EventSource getSource() {
249
        return source;
×
250
    }
251

252
    /**
253
     * Sets the source of the event request
254
     *
255
     * @param source the event source
256
     */
257
    public Event setSource(EventSource source) {
258
        this.source = source;
×
259
        return this;
×
260
    }
261

262
    /**
263
     * Gets the assumed user ID for the event request
264
     *
265
     * @return the assumed user ID
266
     */
267
    public Long getUserId() {
268
        return userId;
×
269
    }
270

271
    /**
272
     * Sets the assumed user ID for the event request
273
     *
274
     * @param userId the assumed user ID
275
     */
276
    public Event setUserId(Long userId) {
277
        this.userId = userId;
×
278
        return this;
×
279
    }
280
}
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