|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.datamigration.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * Describes the cause of the error with structured details. Example of an error when contacting the |
| 21 | + * "pubsub.googleapis.com" API when it is not enabled: { "reason": "API_DISABLED" "domain": |
| 22 | + * "googleapis.com" "metadata": { "resource": "projects/123", "service": "pubsub.googleapis.com" } } |
| 23 | + * This response indicates that the pubsub.googleapis.com API is not enabled. Example of an error |
| 24 | + * that is returned when attempting to create a Spanner instance in a region that is out of stock: { |
| 25 | + * "reason": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": { "availableRegions": "us- |
| 26 | + * central1,us-east2" } } |
| 27 | + * |
| 28 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 29 | + * transmitted over HTTP when working with the Database Migration API. For a detailed explanation |
| 30 | + * see: |
| 31 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 32 | + * </p> |
| 33 | + * |
| 34 | + * @author Google, Inc. |
| 35 | + */ |
| 36 | +@SuppressWarnings("javadoc") |
| 37 | +public final class ErrorInfo extends com.google.api.client.json.GenericJson { |
| 38 | + |
| 39 | + /** |
| 40 | + * The logical grouping to which the "reason" belongs. The error domain is typically the |
| 41 | + * registered service name of the tool or product that generates the error. Example: |
| 42 | + * "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error |
| 43 | + * domain must be a globally unique value that identifies the infrastructure. For Google API |
| 44 | + * infrastructure, the error domain is "googleapis.com". |
| 45 | + * The value may be {@code null}. |
| 46 | + */ |
| 47 | + @com.google.api.client.util.Key |
| 48 | + private java.lang.String domain; |
| 49 | + |
| 50 | + /** |
| 51 | + * Additional structured details about this error. Keys must match a regular expression of `a-z+` |
| 52 | + * but should ideally be lowerCamelCase. Also, they must be limited to 64 characters in length. |
| 53 | + * When identifying the current value of an exceeded limit, the units should be contained in the |
| 54 | + * key, not the value. For example, rather than `{"instanceLimit": "100/request"}`, should be |
| 55 | + * returned as, `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| 56 | + * instances that can be created in a single (batch) request. |
| 57 | + * The value may be {@code null}. |
| 58 | + */ |
| 59 | + @com.google.api.client.util.Key |
| 60 | + private java.util.Map<String, java.lang.String> metadata; |
| 61 | + |
| 62 | + /** |
| 63 | + * The reason of the error. This is a constant value that identifies the proximate cause of the |
| 64 | + * error. Error reasons are unique within a particular domain of errors. This should be at most 63 |
| 65 | + * characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. |
| 66 | + * The value may be {@code null}. |
| 67 | + */ |
| 68 | + @com.google.api.client.util.Key |
| 69 | + private java.lang.String reason; |
| 70 | + |
| 71 | + /** |
| 72 | + * The logical grouping to which the "reason" belongs. The error domain is typically the |
| 73 | + * registered service name of the tool or product that generates the error. Example: |
| 74 | + * "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error |
| 75 | + * domain must be a globally unique value that identifies the infrastructure. For Google API |
| 76 | + * infrastructure, the error domain is "googleapis.com". |
| 77 | + * @return value or {@code null} for none |
| 78 | + */ |
| 79 | + public java.lang.String getDomain() { |
| 80 | + return domain; |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * The logical grouping to which the "reason" belongs. The error domain is typically the |
| 85 | + * registered service name of the tool or product that generates the error. Example: |
| 86 | + * "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error |
| 87 | + * domain must be a globally unique value that identifies the infrastructure. For Google API |
| 88 | + * infrastructure, the error domain is "googleapis.com". |
| 89 | + * @param domain domain or {@code null} for none |
| 90 | + */ |
| 91 | + public ErrorInfo setDomain(java.lang.String domain) { |
| 92 | + this.domain = domain; |
| 93 | + return this; |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * Additional structured details about this error. Keys must match a regular expression of `a-z+` |
| 98 | + * but should ideally be lowerCamelCase. Also, they must be limited to 64 characters in length. |
| 99 | + * When identifying the current value of an exceeded limit, the units should be contained in the |
| 100 | + * key, not the value. For example, rather than `{"instanceLimit": "100/request"}`, should be |
| 101 | + * returned as, `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| 102 | + * instances that can be created in a single (batch) request. |
| 103 | + * @return value or {@code null} for none |
| 104 | + */ |
| 105 | + public java.util.Map<String, java.lang.String> getMetadata() { |
| 106 | + return metadata; |
| 107 | + } |
| 108 | + |
| 109 | + /** |
| 110 | + * Additional structured details about this error. Keys must match a regular expression of `a-z+` |
| 111 | + * but should ideally be lowerCamelCase. Also, they must be limited to 64 characters in length. |
| 112 | + * When identifying the current value of an exceeded limit, the units should be contained in the |
| 113 | + * key, not the value. For example, rather than `{"instanceLimit": "100/request"}`, should be |
| 114 | + * returned as, `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of |
| 115 | + * instances that can be created in a single (batch) request. |
| 116 | + * @param metadata metadata or {@code null} for none |
| 117 | + */ |
| 118 | + public ErrorInfo setMetadata(java.util.Map<String, java.lang.String> metadata) { |
| 119 | + this.metadata = metadata; |
| 120 | + return this; |
| 121 | + } |
| 122 | + |
| 123 | + /** |
| 124 | + * The reason of the error. This is a constant value that identifies the proximate cause of the |
| 125 | + * error. Error reasons are unique within a particular domain of errors. This should be at most 63 |
| 126 | + * characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. |
| 127 | + * @return value or {@code null} for none |
| 128 | + */ |
| 129 | + public java.lang.String getReason() { |
| 130 | + return reason; |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * The reason of the error. This is a constant value that identifies the proximate cause of the |
| 135 | + * error. Error reasons are unique within a particular domain of errors. This should be at most 63 |
| 136 | + * characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. |
| 137 | + * @param reason reason or {@code null} for none |
| 138 | + */ |
| 139 | + public ErrorInfo setReason(java.lang.String reason) { |
| 140 | + this.reason = reason; |
| 141 | + return this; |
| 142 | + } |
| 143 | + |
| 144 | + @Override |
| 145 | + public ErrorInfo set(String fieldName, Object value) { |
| 146 | + return (ErrorInfo) super.set(fieldName, value); |
| 147 | + } |
| 148 | + |
| 149 | + @Override |
| 150 | + public ErrorInfo clone() { |
| 151 | + return (ErrorInfo) super.clone(); |
| 152 | + } |
| 153 | + |
| 154 | +} |
0 commit comments