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 java.util.List;
8 import com.fasterxml.jackson.annotation.JsonProperty;
9
10 /**
11 * An error response received from the Azure Batch service.
12 */
13 public class BatchError {
14 /**
15 * An identifier for the error. Codes are invariant and are intended to be
16 * consumed programmatically.
17 */
18 @JsonProperty(value = "code")
19 private String code;
20
21 /**
22 * A message describing the error, intended to be suitable for display in a
23 * user interface.
24 */
25 @JsonProperty(value = "message")
26 private ErrorMessage message;
27
28 /**
29 * A collection of key-value pairs containing additional details about the
30 * error.
31 */
32 @JsonProperty(value = "values")
33 private List<BatchErrorDetail> values;
34
35 /**
36 * Get the code value.
37 *
38 * @return the code value
39 */
40 public String code() {
41 return this.code;
42 }
43
44 /**
45 * Set the code value.
46 *
47 * @param code the code value to set
48 * @return the BatchError object itself.
49 */
50 public BatchError withCode(String code) {
51 this.code = code;
52 return this;
53 }
54
55 /**
56 * Get the message value.
57 *
58 * @return the message value
59 */
60 public ErrorMessage message() {
61 return this.message;
62 }
63
64 /**
65 * Set the message value.
66 *
67 * @param message the message value to set
68 * @return the BatchError object itself.
69 */
70 public BatchError withMessage(ErrorMessage message) {
71 this.message = message;
72 return this;
73 }
74
75 /**
76 * Get the values value.
77 *
78 * @return the values value
79 */
80 public List<BatchErrorDetail> values() {
81 return this.values;
82 }
83
84 /**
85 * Set the values value.
86 *
87 * @param values the values value to set
88 * @return the BatchError object itself.
89 */
90 public BatchError withValues(List<BatchErrorDetail> values) {
91 this.values = values;
92 return this;
93 }
94
95 }