1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 // Code generated by Microsoft (R) AutoRest Code Generator
4
5 package com.microsoft.azure.batch.protocol.models;
6
7 import org.joda.time.DateTime;
8 import java.util.List;
9 import com.fasterxml.jackson.annotation.JsonProperty;
10
11 /**
12 * A job schedule that allows recurring jobs by specifying when to run jobs and
13 * a specification used to create each job.
14 */
15 public class CloudJobSchedule {
16 /**
17 * A string that uniquely identifies the schedule within the account.
18 */
19 @JsonProperty(value = "id")
20 private String id;
21
22 /**
23 * The display name for the schedule.
24 */
25 @JsonProperty(value = "displayName")
26 private String displayName;
27
28 /**
29 * The URL of the job schedule.
30 */
31 @JsonProperty(value = "url")
32 private String url;
33
34 /**
35 * The ETag of the job schedule.
36 * This is an opaque string. You can use it to detect whether the job
37 * schedule has changed between requests. In particular, you can be pass
38 * the ETag with an Update Job Schedule request to specify that your
39 * changes should take effect only if nobody else has modified the schedule
40 * in the meantime.
41 */
42 @JsonProperty(value = "eTag")
43 private String eTag;
44
45 /**
46 * The last modified time of the job schedule.
47 * This is the last time at which the schedule level data, such as the job
48 * specification or recurrence information, changed. It does not factor in
49 * job-level changes such as new jobs being created or jobs changing state.
50 */
51 @JsonProperty(value = "lastModified")
52 private DateTime lastModified;
53
54 /**
55 * The creation time of the job schedule.
56 */
57 @JsonProperty(value = "creationTime")
58 private DateTime creationTime;
59
60 /**
61 * The current state of the job schedule.
62 * Possible values include: 'active', 'completed', 'disabled',
63 * 'terminating', 'deleting'.
64 */
65 @JsonProperty(value = "state")
66 private JobScheduleState state;
67
68 /**
69 * The time at which the job schedule entered the current state.
70 */
71 @JsonProperty(value = "stateTransitionTime")
72 private DateTime stateTransitionTime;
73
74 /**
75 * The previous state of the job schedule.
76 * This property is not present if the job schedule is in its initial
77 * active state. Possible values include: 'active', 'completed',
78 * 'disabled', 'terminating', 'deleting'.
79 */
80 @JsonProperty(value = "previousState")
81 private JobScheduleState previousState;
82
83 /**
84 * The time at which the job schedule entered its previous state.
85 * This property is not present if the job schedule is in its initial
86 * active state.
87 */
88 @JsonProperty(value = "previousStateTransitionTime")
89 private DateTime previousStateTransitionTime;
90
91 /**
92 * The schedule according to which jobs will be created.
93 */
94 @JsonProperty(value = "schedule")
95 private Schedule schedule;
96
97 /**
98 * The details of the jobs to be created on this schedule.
99 */
100 @JsonProperty(value = "jobSpecification")
101 private JobSpecification jobSpecification;
102
103 /**
104 * Information about jobs that have been and will be run under this
105 * schedule.
106 */
107 @JsonProperty(value = "executionInfo")
108 private JobScheduleExecutionInformation executionInfo;
109
110 /**
111 * A list of name-value pairs associated with the schedule as metadata.
112 * The Batch service does not assign any meaning to metadata; it is solely
113 * for the use of user code.
114 */
115 @JsonProperty(value = "metadata")
116 private List<MetadataItem> metadata;
117
118 /**
119 * The lifetime resource usage statistics for the job schedule. The
120 * statistics may not be immediately available. The Batch service performs
121 * periodic roll-up of statistics. The typical delay is about 30 minutes.
122 */
123 @JsonProperty(value = "stats")
124 private JobScheduleStatistics stats;
125
126 /**
127 * Get the id value.
128 *
129 * @return the id value
130 */
131 public String id() {
132 return this.id;
133 }
134
135 /**
136 * Set the id value.
137 *
138 * @param id the id value to set
139 * @return the CloudJobSchedule object itself.
140 */
141 public CloudJobSchedule withId(String id) {
142 this.id = id;
143 return this;
144 }
145
146 /**
147 * Get the displayName value.
148 *
149 * @return the displayName value
150 */
151 public String displayName() {
152 return this.displayName;
153 }
154
155 /**
156 * Set the displayName value.
157 *
158 * @param displayName the displayName value to set
159 * @return the CloudJobSchedule object itself.
160 */
161 public CloudJobSchedule withDisplayName(String displayName) {
162 this.displayName = displayName;
163 return this;
164 }
165
166 /**
167 * Get the url value.
168 *
169 * @return the url value
170 */
171 public String url() {
172 return this.url;
173 }
174
175 /**
176 * Set the url value.
177 *
178 * @param url the url value to set
179 * @return the CloudJobSchedule object itself.
180 */
181 public CloudJobSchedule withUrl(String url) {
182 this.url = url;
183 return this;
184 }
185
186 /**
187 * Get this is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
188 *
189 * @return the eTag value
190 */
191 public String eTag() {
192 return this.eTag;
193 }
194
195 /**
196 * Set this is an opaque string. You can use it to detect whether the job schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime.
197 *
198 * @param eTag the eTag value to set
199 * @return the CloudJobSchedule object itself.
200 */
201 public CloudJobSchedule withETag(String eTag) {
202 this.eTag = eTag;
203 return this;
204 }
205
206 /**
207 * Get this is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
208 *
209 * @return the lastModified value
210 */
211 public DateTime lastModified() {
212 return this.lastModified;
213 }
214
215 /**
216 * Set this is the last time at which the schedule level data, such as the job specification or recurrence information, changed. It does not factor in job-level changes such as new jobs being created or jobs changing state.
217 *
218 * @param lastModified the lastModified value to set
219 * @return the CloudJobSchedule object itself.
220 */
221 public CloudJobSchedule withLastModified(DateTime lastModified) {
222 this.lastModified = lastModified;
223 return this;
224 }
225
226 /**
227 * Get the creationTime value.
228 *
229 * @return the creationTime value
230 */
231 public DateTime creationTime() {
232 return this.creationTime;
233 }
234
235 /**
236 * Set the creationTime value.
237 *
238 * @param creationTime the creationTime value to set
239 * @return the CloudJobSchedule object itself.
240 */
241 public CloudJobSchedule withCreationTime(DateTime creationTime) {
242 this.creationTime = creationTime;
243 return this;
244 }
245
246 /**
247 * Get possible values include: 'active', 'completed', 'disabled', 'terminating', 'deleting'.
248 *
249 * @return the state value
250 */
251 public JobScheduleState state() {
252 return this.state;
253 }
254
255 /**
256 * Set possible values include: 'active', 'completed', 'disabled', 'terminating', 'deleting'.
257 *
258 * @param state the state value to set
259 * @return the CloudJobSchedule object itself.
260 */
261 public CloudJobSchedule withState(JobScheduleState state) {
262 this.state = state;
263 return this;
264 }
265
266 /**
267 * Get the stateTransitionTime value.
268 *
269 * @return the stateTransitionTime value
270 */
271 public DateTime stateTransitionTime() {
272 return this.stateTransitionTime;
273 }
274
275 /**
276 * Set the stateTransitionTime value.
277 *
278 * @param stateTransitionTime the stateTransitionTime value to set
279 * @return the CloudJobSchedule object itself.
280 */
281 public CloudJobSchedule withStateTransitionTime(DateTime stateTransitionTime) {
282 this.stateTransitionTime = stateTransitionTime;
283 return this;
284 }
285
286 /**
287 * Get this property is not present if the job schedule is in its initial active state. Possible values include: 'active', 'completed', 'disabled', 'terminating', 'deleting'.
288 *
289 * @return the previousState value
290 */
291 public JobScheduleState previousState() {
292 return this.previousState;
293 }
294
295 /**
296 * Set this property is not present if the job schedule is in its initial active state. Possible values include: 'active', 'completed', 'disabled', 'terminating', 'deleting'.
297 *
298 * @param previousState the previousState value to set
299 * @return the CloudJobSchedule object itself.
300 */
301 public CloudJobSchedule withPreviousState(JobScheduleState previousState) {
302 this.previousState = previousState;
303 return this;
304 }
305
306 /**
307 * Get this property is not present if the job schedule is in its initial active state.
308 *
309 * @return the previousStateTransitionTime value
310 */
311 public DateTime previousStateTransitionTime() {
312 return this.previousStateTransitionTime;
313 }
314
315 /**
316 * Set this property is not present if the job schedule is in its initial active state.
317 *
318 * @param previousStateTransitionTime the previousStateTransitionTime value to set
319 * @return the CloudJobSchedule object itself.
320 */
321 public CloudJobSchedule withPreviousStateTransitionTime(DateTime previousStateTransitionTime) {
322 this.previousStateTransitionTime = previousStateTransitionTime;
323 return this;
324 }
325
326 /**
327 * Get the schedule value.
328 *
329 * @return the schedule value
330 */
331 public Schedule schedule() {
332 return this.schedule;
333 }
334
335 /**
336 * Set the schedule value.
337 *
338 * @param schedule the schedule value to set
339 * @return the CloudJobSchedule object itself.
340 */
341 public CloudJobSchedule withSchedule(Schedule schedule) {
342 this.schedule = schedule;
343 return this;
344 }
345
346 /**
347 * Get the jobSpecification value.
348 *
349 * @return the jobSpecification value
350 */
351 public JobSpecification jobSpecification() {
352 return this.jobSpecification;
353 }
354
355 /**
356 * Set the jobSpecification value.
357 *
358 * @param jobSpecification the jobSpecification value to set
359 * @return the CloudJobSchedule object itself.
360 */
361 public CloudJobSchedule withJobSpecification(JobSpecification jobSpecification) {
362 this.jobSpecification = jobSpecification;
363 return this;
364 }
365
366 /**
367 * Get the executionInfo value.
368 *
369 * @return the executionInfo value
370 */
371 public JobScheduleExecutionInformation executionInfo() {
372 return this.executionInfo;
373 }
374
375 /**
376 * Set the executionInfo value.
377 *
378 * @param executionInfo the executionInfo value to set
379 * @return the CloudJobSchedule object itself.
380 */
381 public CloudJobSchedule withExecutionInfo(JobScheduleExecutionInformation executionInfo) {
382 this.executionInfo = executionInfo;
383 return this;
384 }
385
386 /**
387 * Get the Batch service does not assign any meaning to metadata; it is solely for the use of user code.
388 *
389 * @return the metadata value
390 */
391 public List<MetadataItem> metadata() {
392 return this.metadata;
393 }
394
395 /**
396 * Set the Batch service does not assign any meaning to metadata; it is solely for the use of user code.
397 *
398 * @param metadata the metadata value to set
399 * @return the CloudJobSchedule object itself.
400 */
401 public CloudJobSchedule withMetadata(List<MetadataItem> metadata) {
402 this.metadata = metadata;
403 return this;
404 }
405
406 /**
407 * Get the stats value.
408 *
409 * @return the stats value
410 */
411 public JobScheduleStatistics stats() {
412 return this.stats;
413 }
414
415 /**
416 * Set the stats value.
417 *
418 * @param stats the stats value to set
419 * @return the CloudJobSchedule object itself.
420 */
421 public CloudJobSchedule withStats(JobScheduleStatistics stats) {
422 this.stats = stats;
423 return this;
424 }
425
426 }