1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/tasks/v2/target.proto 18 19 package com.google.cloud.tasks.v2; 20 21 public interface HttpRequestOrBuilder 22 extends 23 // @@protoc_insertion_point(interface_extends:google.cloud.tasks.v2.HttpRequest) 24 com.google.protobuf.MessageOrBuilder { 25 26 /** 27 * 28 * 29 * <pre> 30 * Required. The full url path that the request will be sent to. 31 * This string must begin with either "http://" or "https://". Some examples 32 * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will 33 * encode some characters for safety and compatibility. The maximum allowed 34 * URL length is 2083 characters after encoding. 35 * The `Location` header response from a redirect response [`300` - `399`] 36 * may be followed. The redirect is not counted as a separate attempt. 37 * </pre> 38 * 39 * <code>string url = 1 [(.google.api.field_behavior) = REQUIRED];</code> 40 * 41 * @return The url. 42 */ getUrl()43 java.lang.String getUrl(); 44 /** 45 * 46 * 47 * <pre> 48 * Required. The full url path that the request will be sent to. 49 * This string must begin with either "http://" or "https://". Some examples 50 * are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will 51 * encode some characters for safety and compatibility. The maximum allowed 52 * URL length is 2083 characters after encoding. 53 * The `Location` header response from a redirect response [`300` - `399`] 54 * may be followed. The redirect is not counted as a separate attempt. 55 * </pre> 56 * 57 * <code>string url = 1 [(.google.api.field_behavior) = REQUIRED];</code> 58 * 59 * @return The bytes for url. 60 */ getUrlBytes()61 com.google.protobuf.ByteString getUrlBytes(); 62 63 /** 64 * 65 * 66 * <pre> 67 * The HTTP method to use for the request. The default is POST. 68 * </pre> 69 * 70 * <code>.google.cloud.tasks.v2.HttpMethod http_method = 2;</code> 71 * 72 * @return The enum numeric value on the wire for httpMethod. 73 */ getHttpMethodValue()74 int getHttpMethodValue(); 75 /** 76 * 77 * 78 * <pre> 79 * The HTTP method to use for the request. The default is POST. 80 * </pre> 81 * 82 * <code>.google.cloud.tasks.v2.HttpMethod http_method = 2;</code> 83 * 84 * @return The httpMethod. 85 */ getHttpMethod()86 com.google.cloud.tasks.v2.HttpMethod getHttpMethod(); 87 88 /** 89 * 90 * 91 * <pre> 92 * HTTP request headers. 93 * This map contains the header field names and values. 94 * Headers can be set when the 95 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 96 * These headers represent a subset of the headers that will accompany the 97 * task's HTTP request. Some HTTP request headers will be ignored or replaced. 98 * A partial list of headers that will be ignored or replaced is: 99 * * Host: This will be computed by Cloud Tasks and derived from 100 * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. 101 * * Content-Length: This will be computed by Cloud Tasks. 102 * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 103 * * `X-Google-*`: Google use only. 104 * * `X-AppEngine-*`: Google use only. 105 * `Content-Type` won't be set by Cloud Tasks. You can explicitly set 106 * `Content-Type` to a media type when the 107 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 108 * For example, `Content-Type` can be set to `"application/octet-stream"` or 109 * `"application/json"`. 110 * Headers which can have multiple values (according to RFC2616) can be 111 * specified using comma-separated values. 112 * The size of the headers must be less than 80KB. 113 * </pre> 114 * 115 * <code>map<string, string> headers = 3;</code> 116 */ getHeadersCount()117 int getHeadersCount(); 118 /** 119 * 120 * 121 * <pre> 122 * HTTP request headers. 123 * This map contains the header field names and values. 124 * Headers can be set when the 125 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 126 * These headers represent a subset of the headers that will accompany the 127 * task's HTTP request. Some HTTP request headers will be ignored or replaced. 128 * A partial list of headers that will be ignored or replaced is: 129 * * Host: This will be computed by Cloud Tasks and derived from 130 * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. 131 * * Content-Length: This will be computed by Cloud Tasks. 132 * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 133 * * `X-Google-*`: Google use only. 134 * * `X-AppEngine-*`: Google use only. 135 * `Content-Type` won't be set by Cloud Tasks. You can explicitly set 136 * `Content-Type` to a media type when the 137 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 138 * For example, `Content-Type` can be set to `"application/octet-stream"` or 139 * `"application/json"`. 140 * Headers which can have multiple values (according to RFC2616) can be 141 * specified using comma-separated values. 142 * The size of the headers must be less than 80KB. 143 * </pre> 144 * 145 * <code>map<string, string> headers = 3;</code> 146 */ containsHeaders(java.lang.String key)147 boolean containsHeaders(java.lang.String key); 148 /** Use {@link #getHeadersMap()} instead. */ 149 @java.lang.Deprecated getHeaders()150 java.util.Map<java.lang.String, java.lang.String> getHeaders(); 151 /** 152 * 153 * 154 * <pre> 155 * HTTP request headers. 156 * This map contains the header field names and values. 157 * Headers can be set when the 158 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 159 * These headers represent a subset of the headers that will accompany the 160 * task's HTTP request. Some HTTP request headers will be ignored or replaced. 161 * A partial list of headers that will be ignored or replaced is: 162 * * Host: This will be computed by Cloud Tasks and derived from 163 * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. 164 * * Content-Length: This will be computed by Cloud Tasks. 165 * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 166 * * `X-Google-*`: Google use only. 167 * * `X-AppEngine-*`: Google use only. 168 * `Content-Type` won't be set by Cloud Tasks. You can explicitly set 169 * `Content-Type` to a media type when the 170 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 171 * For example, `Content-Type` can be set to `"application/octet-stream"` or 172 * `"application/json"`. 173 * Headers which can have multiple values (according to RFC2616) can be 174 * specified using comma-separated values. 175 * The size of the headers must be less than 80KB. 176 * </pre> 177 * 178 * <code>map<string, string> headers = 3;</code> 179 */ getHeadersMap()180 java.util.Map<java.lang.String, java.lang.String> getHeadersMap(); 181 /** 182 * 183 * 184 * <pre> 185 * HTTP request headers. 186 * This map contains the header field names and values. 187 * Headers can be set when the 188 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 189 * These headers represent a subset of the headers that will accompany the 190 * task's HTTP request. Some HTTP request headers will be ignored or replaced. 191 * A partial list of headers that will be ignored or replaced is: 192 * * Host: This will be computed by Cloud Tasks and derived from 193 * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. 194 * * Content-Length: This will be computed by Cloud Tasks. 195 * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 196 * * `X-Google-*`: Google use only. 197 * * `X-AppEngine-*`: Google use only. 198 * `Content-Type` won't be set by Cloud Tasks. You can explicitly set 199 * `Content-Type` to a media type when the 200 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 201 * For example, `Content-Type` can be set to `"application/octet-stream"` or 202 * `"application/json"`. 203 * Headers which can have multiple values (according to RFC2616) can be 204 * specified using comma-separated values. 205 * The size of the headers must be less than 80KB. 206 * </pre> 207 * 208 * <code>map<string, string> headers = 3;</code> 209 */ 210 /* nullable */ getHeadersOrDefault( java.lang.String key, java.lang.String defaultValue)211 java.lang.String getHeadersOrDefault( 212 java.lang.String key, 213 /* nullable */ 214 java.lang.String defaultValue); 215 /** 216 * 217 * 218 * <pre> 219 * HTTP request headers. 220 * This map contains the header field names and values. 221 * Headers can be set when the 222 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 223 * These headers represent a subset of the headers that will accompany the 224 * task's HTTP request. Some HTTP request headers will be ignored or replaced. 225 * A partial list of headers that will be ignored or replaced is: 226 * * Host: This will be computed by Cloud Tasks and derived from 227 * [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. 228 * * Content-Length: This will be computed by Cloud Tasks. 229 * * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 230 * * `X-Google-*`: Google use only. 231 * * `X-AppEngine-*`: Google use only. 232 * `Content-Type` won't be set by Cloud Tasks. You can explicitly set 233 * `Content-Type` to a media type when the 234 * [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 235 * For example, `Content-Type` can be set to `"application/octet-stream"` or 236 * `"application/json"`. 237 * Headers which can have multiple values (according to RFC2616) can be 238 * specified using comma-separated values. 239 * The size of the headers must be less than 80KB. 240 * </pre> 241 * 242 * <code>map<string, string> headers = 3;</code> 243 */ getHeadersOrThrow(java.lang.String key)244 java.lang.String getHeadersOrThrow(java.lang.String key); 245 246 /** 247 * 248 * 249 * <pre> 250 * HTTP request body. 251 * A request body is allowed only if the 252 * [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, 253 * or PATCH. It is an error to set body on a task with an incompatible 254 * [HttpMethod][google.cloud.tasks.v2.HttpMethod]. 255 * </pre> 256 * 257 * <code>bytes body = 4;</code> 258 * 259 * @return The body. 260 */ getBody()261 com.google.protobuf.ByteString getBody(); 262 263 /** 264 * 265 * 266 * <pre> 267 * If specified, an 268 * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) 269 * will be generated and attached as an `Authorization` header in the HTTP 270 * request. 271 * This type of authorization should generally only be used when calling 272 * Google APIs hosted on *.googleapis.com. 273 * </pre> 274 * 275 * <code>.google.cloud.tasks.v2.OAuthToken oauth_token = 5;</code> 276 * 277 * @return Whether the oauthToken field is set. 278 */ hasOauthToken()279 boolean hasOauthToken(); 280 /** 281 * 282 * 283 * <pre> 284 * If specified, an 285 * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) 286 * will be generated and attached as an `Authorization` header in the HTTP 287 * request. 288 * This type of authorization should generally only be used when calling 289 * Google APIs hosted on *.googleapis.com. 290 * </pre> 291 * 292 * <code>.google.cloud.tasks.v2.OAuthToken oauth_token = 5;</code> 293 * 294 * @return The oauthToken. 295 */ getOauthToken()296 com.google.cloud.tasks.v2.OAuthToken getOauthToken(); 297 /** 298 * 299 * 300 * <pre> 301 * If specified, an 302 * [OAuth token](https://developers.google.com/identity/protocols/OAuth2) 303 * will be generated and attached as an `Authorization` header in the HTTP 304 * request. 305 * This type of authorization should generally only be used when calling 306 * Google APIs hosted on *.googleapis.com. 307 * </pre> 308 * 309 * <code>.google.cloud.tasks.v2.OAuthToken oauth_token = 5;</code> 310 */ getOauthTokenOrBuilder()311 com.google.cloud.tasks.v2.OAuthTokenOrBuilder getOauthTokenOrBuilder(); 312 313 /** 314 * 315 * 316 * <pre> 317 * If specified, an 318 * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) 319 * token will be generated and attached as an `Authorization` header in the 320 * HTTP request. 321 * This type of authorization can be used for many scenarios, including 322 * calling Cloud Run, or endpoints where you intend to validate the token 323 * yourself. 324 * </pre> 325 * 326 * <code>.google.cloud.tasks.v2.OidcToken oidc_token = 6;</code> 327 * 328 * @return Whether the oidcToken field is set. 329 */ hasOidcToken()330 boolean hasOidcToken(); 331 /** 332 * 333 * 334 * <pre> 335 * If specified, an 336 * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) 337 * token will be generated and attached as an `Authorization` header in the 338 * HTTP request. 339 * This type of authorization can be used for many scenarios, including 340 * calling Cloud Run, or endpoints where you intend to validate the token 341 * yourself. 342 * </pre> 343 * 344 * <code>.google.cloud.tasks.v2.OidcToken oidc_token = 6;</code> 345 * 346 * @return The oidcToken. 347 */ getOidcToken()348 com.google.cloud.tasks.v2.OidcToken getOidcToken(); 349 /** 350 * 351 * 352 * <pre> 353 * If specified, an 354 * [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) 355 * token will be generated and attached as an `Authorization` header in the 356 * HTTP request. 357 * This type of authorization can be used for many scenarios, including 358 * calling Cloud Run, or endpoints where you intend to validate the token 359 * yourself. 360 * </pre> 361 * 362 * <code>.google.cloud.tasks.v2.OidcToken oidc_token = 6;</code> 363 */ getOidcTokenOrBuilder()364 com.google.cloud.tasks.v2.OidcTokenOrBuilder getOidcTokenOrBuilder(); 365 getAuthorizationHeaderCase()366 public com.google.cloud.tasks.v2.HttpRequest.AuthorizationHeaderCase getAuthorizationHeaderCase(); 367 } 368