|
| 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.firebasedataconnect.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * Message that represents an arbitrary HTTP body. It should only be used for payload formats that |
| 21 | + * can't be represented as JSON, such as raw binary or an HTML page. This message can be used both |
| 22 | + * in streaming and non-streaming API methods in the request as well as the response. It can be used |
| 23 | + * as a top-level request field, which is convenient if one wants to extract parameters from either |
| 24 | + * the URL or HTTP template into the request fields and also want access to the raw HTTP body. |
| 25 | + * Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw |
| 26 | + * HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { |
| 27 | + * rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc |
| 28 | + * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming |
| 29 | + * methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream |
| 30 | + * google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream |
| 31 | + * google.api.HttpBody); } Use of this type only changes how the request and response bodies are |
| 32 | + * handled, all other features will continue to work unchanged. |
| 33 | + * |
| 34 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 35 | + * transmitted over HTTP when working with the Firebase SQL Connect API. For a detailed explanation |
| 36 | + * see: |
| 37 | + * <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> |
| 38 | + * </p> |
| 39 | + * |
| 40 | + * @author Google, Inc. |
| 41 | + */ |
| 42 | +@SuppressWarnings("javadoc") |
| 43 | +public final class HttpBody extends com.google.api.client.json.GenericJson { |
| 44 | + |
| 45 | + /** |
| 46 | + * The HTTP Content-Type header value specifying the content type of the body. |
| 47 | + * The value may be {@code null}. |
| 48 | + */ |
| 49 | + @com.google.api.client.util.Key |
| 50 | + private java.lang.String contentType; |
| 51 | + |
| 52 | + /** |
| 53 | + * The HTTP request/response body as raw binary. |
| 54 | + * The value may be {@code null}. |
| 55 | + */ |
| 56 | + @com.google.api.client.util.Key |
| 57 | + private java.lang.String data; |
| 58 | + |
| 59 | + /** |
| 60 | + * Application specific response metadata. Must be set in the first response for streaming APIs. |
| 61 | + * The value may be {@code null}. |
| 62 | + */ |
| 63 | + @com.google.api.client.util.Key |
| 64 | + private java.util.List<java.util.Map<String, java.lang.Object>> extensions; |
| 65 | + |
| 66 | + /** |
| 67 | + * The HTTP Content-Type header value specifying the content type of the body. |
| 68 | + * @return value or {@code null} for none |
| 69 | + */ |
| 70 | + public java.lang.String getContentType() { |
| 71 | + return contentType; |
| 72 | + } |
| 73 | + |
| 74 | + /** |
| 75 | + * The HTTP Content-Type header value specifying the content type of the body. |
| 76 | + * @param contentType contentType or {@code null} for none |
| 77 | + */ |
| 78 | + public HttpBody setContentType(java.lang.String contentType) { |
| 79 | + this.contentType = contentType; |
| 80 | + return this; |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * The HTTP request/response body as raw binary. |
| 85 | + * @see #decodeData() |
| 86 | + * @return value or {@code null} for none |
| 87 | + */ |
| 88 | + public java.lang.String getData() { |
| 89 | + return data; |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * The HTTP request/response body as raw binary. |
| 94 | + * @see #getData() |
| 95 | + * @return Base64 decoded value or {@code null} for none |
| 96 | + * |
| 97 | + * @since 1.14 |
| 98 | + */ |
| 99 | + public byte[] decodeData() { |
| 100 | + return com.google.api.client.util.Base64.decodeBase64(data); |
| 101 | + } |
| 102 | + |
| 103 | + /** |
| 104 | + * The HTTP request/response body as raw binary. |
| 105 | + * @see #encodeData() |
| 106 | + * @param data data or {@code null} for none |
| 107 | + */ |
| 108 | + public HttpBody setData(java.lang.String data) { |
| 109 | + this.data = data; |
| 110 | + return this; |
| 111 | + } |
| 112 | + |
| 113 | + /** |
| 114 | + * The HTTP request/response body as raw binary. |
| 115 | + * @see #setData() |
| 116 | + * |
| 117 | + * <p> |
| 118 | + * The value is encoded Base64 or {@code null} for none. |
| 119 | + * </p> |
| 120 | + * |
| 121 | + * @since 1.14 |
| 122 | + */ |
| 123 | + public HttpBody encodeData(byte[] data) { |
| 124 | + this.data = com.google.api.client.util.Base64.encodeBase64URLSafeString(data); |
| 125 | + return this; |
| 126 | + } |
| 127 | + |
| 128 | + /** |
| 129 | + * Application specific response metadata. Must be set in the first response for streaming APIs. |
| 130 | + * @return value or {@code null} for none |
| 131 | + */ |
| 132 | + public java.util.List<java.util.Map<String, java.lang.Object>> getExtensions() { |
| 133 | + return extensions; |
| 134 | + } |
| 135 | + |
| 136 | + /** |
| 137 | + * Application specific response metadata. Must be set in the first response for streaming APIs. |
| 138 | + * @param extensions extensions or {@code null} for none |
| 139 | + */ |
| 140 | + public HttpBody setExtensions(java.util.List<java.util.Map<String, java.lang.Object>> extensions) { |
| 141 | + this.extensions = extensions; |
| 142 | + return this; |
| 143 | + } |
| 144 | + |
| 145 | + @Override |
| 146 | + public HttpBody set(String fieldName, Object value) { |
| 147 | + return (HttpBody) super.set(fieldName, value); |
| 148 | + } |
| 149 | + |
| 150 | + @Override |
| 151 | + public HttpBody clone() { |
| 152 | + return (HttpBody) super.clone(); |
| 153 | + } |
| 154 | + |
| 155 | +} |
0 commit comments