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/v2beta2/target.proto 18 19 package com.google.cloud.tasks.v2beta2; 20 21 /** 22 * 23 * 24 * <pre> 25 * App Engine HTTP request. 26 * The message defines the HTTP request that is sent to an App Engine app when 27 * the task is dispatched. 28 * This proto can only be used for tasks in a queue which has 29 * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] 30 * set. 31 * Using [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] 32 * requires 33 * [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 34 * Google IAM permission for the project 35 * and the following scope: 36 * `https://www.googleapis.com/auth/cloud-platform` 37 * The task will be delivered to the App Engine app which belongs to the same 38 * project as the queue. For more information, see 39 * [How Requests are 40 * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 41 * and how routing is affected by 42 * [dispatch 43 * files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 44 * Traffic is encrypted during transport and never leaves Google datacenters. 45 * Because this traffic is carried over a communication mechanism internal to 46 * Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 47 * The request to the handler, however, will appear to have used the HTTP 48 * protocol. 49 * The [AppEngineRouting][google.cloud.tasks.v2beta2.AppEngineRouting] used to 50 * construct the URL that the task is delivered to can be set at the queue-level 51 * or task-level: 52 * * If set, 53 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 54 * is used for all tasks in the queue, no matter what the setting 55 * is for the 56 * [task-level 57 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 58 * The `url` that the task will be sent to is: 59 * * `url =` [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] `+` 60 * [relative_url][google.cloud.tasks.v2beta2.AppEngineHttpRequest.relative_url] 61 * Tasks can be dispatched to secure app handlers, unsecure app handlers, and 62 * URIs restricted with 63 * [`login: 64 * admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 65 * Because tasks are not run as any user, they cannot be dispatched to URIs 66 * restricted with 67 * [`login: 68 * required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 69 * Task dispatches also do not follow redirects. 70 * The task attempt has succeeded if the app's request handler returns an HTTP 71 * response code in the range [`200` - `299`]. The task attempt has failed if 72 * the app's handler returns a non-2xx response code or Cloud Tasks does 73 * not receive response before the [deadline][Task.dispatch_deadline]. Failed 74 * tasks will be retried according to the 75 * [retry configuration][google.cloud.tasks.v2beta2.Queue.retry_config]. `503` 76 * (Service Unavailable) is considered an App Engine system error instead of an 77 * application error and will cause Cloud Tasks' traffic congestion control to 78 * temporarily throttle the queue's dispatches. Unlike other types of task 79 * targets, a `429` (Too Many Requests) response from an app handler does not 80 * cause traffic congestion control to throttle the queue. 81 * </pre> 82 * 83 * Protobuf type {@code google.cloud.tasks.v2beta2.AppEngineHttpRequest} 84 */ 85 public final class AppEngineHttpRequest extends com.google.protobuf.GeneratedMessageV3 86 implements 87 // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta2.AppEngineHttpRequest) 88 AppEngineHttpRequestOrBuilder { 89 private static final long serialVersionUID = 0L; 90 // Use AppEngineHttpRequest.newBuilder() to construct. AppEngineHttpRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)91 private AppEngineHttpRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 92 super(builder); 93 } 94 AppEngineHttpRequest()95 private AppEngineHttpRequest() { 96 httpMethod_ = 0; 97 relativeUrl_ = ""; 98 payload_ = com.google.protobuf.ByteString.EMPTY; 99 } 100 101 @java.lang.Override 102 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)103 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 104 return new AppEngineHttpRequest(); 105 } 106 107 @java.lang.Override getUnknownFields()108 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 109 return this.unknownFields; 110 } 111 getDescriptor()112 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 113 return com.google.cloud.tasks.v2beta2.TargetProto 114 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_descriptor; 115 } 116 117 @SuppressWarnings({"rawtypes"}) 118 @java.lang.Override internalGetMapField(int number)119 protected com.google.protobuf.MapField internalGetMapField(int number) { 120 switch (number) { 121 case 4: 122 return internalGetHeaders(); 123 default: 124 throw new RuntimeException("Invalid map field number: " + number); 125 } 126 } 127 128 @java.lang.Override 129 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()130 internalGetFieldAccessorTable() { 131 return com.google.cloud.tasks.v2beta2.TargetProto 132 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_fieldAccessorTable 133 .ensureFieldAccessorsInitialized( 134 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.class, 135 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.Builder.class); 136 } 137 138 public static final int HTTP_METHOD_FIELD_NUMBER = 1; 139 private int httpMethod_ = 0; 140 /** 141 * 142 * 143 * <pre> 144 * The HTTP method to use for the request. The default is POST. 145 * The app's request handler for the task's target URL must be able to handle 146 * HTTP requests with this http_method, otherwise the task attempt fails with 147 * error code 405 (Method Not Allowed). See [Writing a push task request 148 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 149 * and the App Engine documentation for your runtime on [How Requests are 150 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 151 * </pre> 152 * 153 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 154 * 155 * @return The enum numeric value on the wire for httpMethod. 156 */ 157 @java.lang.Override getHttpMethodValue()158 public int getHttpMethodValue() { 159 return httpMethod_; 160 } 161 /** 162 * 163 * 164 * <pre> 165 * The HTTP method to use for the request. The default is POST. 166 * The app's request handler for the task's target URL must be able to handle 167 * HTTP requests with this http_method, otherwise the task attempt fails with 168 * error code 405 (Method Not Allowed). See [Writing a push task request 169 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 170 * and the App Engine documentation for your runtime on [How Requests are 171 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 172 * </pre> 173 * 174 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 175 * 176 * @return The httpMethod. 177 */ 178 @java.lang.Override getHttpMethod()179 public com.google.cloud.tasks.v2beta2.HttpMethod getHttpMethod() { 180 com.google.cloud.tasks.v2beta2.HttpMethod result = 181 com.google.cloud.tasks.v2beta2.HttpMethod.forNumber(httpMethod_); 182 return result == null ? com.google.cloud.tasks.v2beta2.HttpMethod.UNRECOGNIZED : result; 183 } 184 185 public static final int APP_ENGINE_ROUTING_FIELD_NUMBER = 2; 186 private com.google.cloud.tasks.v2beta2.AppEngineRouting appEngineRouting_; 187 /** 188 * 189 * 190 * <pre> 191 * Task-level setting for App Engine routing. 192 * If set, 193 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 194 * is used for all tasks in the queue, no matter what the setting is for the 195 * [task-level 196 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 197 * </pre> 198 * 199 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 200 * 201 * @return Whether the appEngineRouting field is set. 202 */ 203 @java.lang.Override hasAppEngineRouting()204 public boolean hasAppEngineRouting() { 205 return appEngineRouting_ != null; 206 } 207 /** 208 * 209 * 210 * <pre> 211 * Task-level setting for App Engine routing. 212 * If set, 213 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 214 * is used for all tasks in the queue, no matter what the setting is for the 215 * [task-level 216 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 217 * </pre> 218 * 219 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 220 * 221 * @return The appEngineRouting. 222 */ 223 @java.lang.Override getAppEngineRouting()224 public com.google.cloud.tasks.v2beta2.AppEngineRouting getAppEngineRouting() { 225 return appEngineRouting_ == null 226 ? com.google.cloud.tasks.v2beta2.AppEngineRouting.getDefaultInstance() 227 : appEngineRouting_; 228 } 229 /** 230 * 231 * 232 * <pre> 233 * Task-level setting for App Engine routing. 234 * If set, 235 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 236 * is used for all tasks in the queue, no matter what the setting is for the 237 * [task-level 238 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 239 * </pre> 240 * 241 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 242 */ 243 @java.lang.Override getAppEngineRoutingOrBuilder()244 public com.google.cloud.tasks.v2beta2.AppEngineRoutingOrBuilder getAppEngineRoutingOrBuilder() { 245 return appEngineRouting_ == null 246 ? com.google.cloud.tasks.v2beta2.AppEngineRouting.getDefaultInstance() 247 : appEngineRouting_; 248 } 249 250 public static final int RELATIVE_URL_FIELD_NUMBER = 3; 251 252 @SuppressWarnings("serial") 253 private volatile java.lang.Object relativeUrl_ = ""; 254 /** 255 * 256 * 257 * <pre> 258 * The relative URL. 259 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 260 * It can contain a path and query string arguments. 261 * If the relative URL is empty, then the root path "/" will be used. 262 * No spaces are allowed, and the maximum length allowed is 2083 characters. 263 * </pre> 264 * 265 * <code>string relative_url = 3;</code> 266 * 267 * @return The relativeUrl. 268 */ 269 @java.lang.Override getRelativeUrl()270 public java.lang.String getRelativeUrl() { 271 java.lang.Object ref = relativeUrl_; 272 if (ref instanceof java.lang.String) { 273 return (java.lang.String) ref; 274 } else { 275 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 276 java.lang.String s = bs.toStringUtf8(); 277 relativeUrl_ = s; 278 return s; 279 } 280 } 281 /** 282 * 283 * 284 * <pre> 285 * The relative URL. 286 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 287 * It can contain a path and query string arguments. 288 * If the relative URL is empty, then the root path "/" will be used. 289 * No spaces are allowed, and the maximum length allowed is 2083 characters. 290 * </pre> 291 * 292 * <code>string relative_url = 3;</code> 293 * 294 * @return The bytes for relativeUrl. 295 */ 296 @java.lang.Override getRelativeUrlBytes()297 public com.google.protobuf.ByteString getRelativeUrlBytes() { 298 java.lang.Object ref = relativeUrl_; 299 if (ref instanceof java.lang.String) { 300 com.google.protobuf.ByteString b = 301 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 302 relativeUrl_ = b; 303 return b; 304 } else { 305 return (com.google.protobuf.ByteString) ref; 306 } 307 } 308 309 public static final int HEADERS_FIELD_NUMBER = 4; 310 311 private static final class HeadersDefaultEntryHolder { 312 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 313 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 314 com.google.cloud.tasks.v2beta2.TargetProto 315 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_HeadersEntry_descriptor, 316 com.google.protobuf.WireFormat.FieldType.STRING, 317 "", 318 com.google.protobuf.WireFormat.FieldType.STRING, 319 ""); 320 } 321 322 @SuppressWarnings("serial") 323 private com.google.protobuf.MapField<java.lang.String, java.lang.String> headers_; 324 internalGetHeaders()325 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetHeaders() { 326 if (headers_ == null) { 327 return com.google.protobuf.MapField.emptyMapField(HeadersDefaultEntryHolder.defaultEntry); 328 } 329 return headers_; 330 } 331 getHeadersCount()332 public int getHeadersCount() { 333 return internalGetHeaders().getMap().size(); 334 } 335 /** 336 * 337 * 338 * <pre> 339 * HTTP request headers. 340 * This map contains the header field names and values. 341 * Headers can be set when the 342 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 343 * Repeated headers are not supported but a header value can contain commas. 344 * Cloud Tasks sets some headers to default values: 345 * * `User-Agent`: By default, this header is 346 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 347 * This header can be modified, but Cloud Tasks will append 348 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 349 * modified `User-Agent`. 350 * If the task has a 351 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 352 * Tasks sets the following headers: 353 * * `Content-Type`: By default, the `Content-Type` header is set to 354 * `"application/octet-stream"`. The default can be overridden by explicitly 355 * setting `Content-Type` to a particular media type when the 356 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 357 * For example, `Content-Type` can be set to `"application/json"`. 358 * * `Content-Length`: This is computed by Cloud Tasks. This value is 359 * output only. It cannot be changed. 360 * The headers below cannot be set or overridden: 361 * * `Host` 362 * * `X-Google-*` 363 * * `X-AppEngine-*` 364 * In addition, Cloud Tasks sets some headers when the task is dispatched, 365 * such as headers containing information about the task; see 366 * [request 367 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 368 * These headers are set only when the task is dispatched, so they are not 369 * visible when the task is returned in a Cloud Tasks response. 370 * Although there is no specific limit for the maximum number of headers or 371 * the size, there is a limit on the maximum size of the 372 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 373 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 374 * documentation. 375 * </pre> 376 * 377 * <code>map<string, string> headers = 4;</code> 378 */ 379 @java.lang.Override containsHeaders(java.lang.String key)380 public boolean containsHeaders(java.lang.String key) { 381 if (key == null) { 382 throw new NullPointerException("map key"); 383 } 384 return internalGetHeaders().getMap().containsKey(key); 385 } 386 /** Use {@link #getHeadersMap()} instead. */ 387 @java.lang.Override 388 @java.lang.Deprecated getHeaders()389 public java.util.Map<java.lang.String, java.lang.String> getHeaders() { 390 return getHeadersMap(); 391 } 392 /** 393 * 394 * 395 * <pre> 396 * HTTP request headers. 397 * This map contains the header field names and values. 398 * Headers can be set when the 399 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 400 * Repeated headers are not supported but a header value can contain commas. 401 * Cloud Tasks sets some headers to default values: 402 * * `User-Agent`: By default, this header is 403 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 404 * This header can be modified, but Cloud Tasks will append 405 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 406 * modified `User-Agent`. 407 * If the task has a 408 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 409 * Tasks sets the following headers: 410 * * `Content-Type`: By default, the `Content-Type` header is set to 411 * `"application/octet-stream"`. The default can be overridden by explicitly 412 * setting `Content-Type` to a particular media type when the 413 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 414 * For example, `Content-Type` can be set to `"application/json"`. 415 * * `Content-Length`: This is computed by Cloud Tasks. This value is 416 * output only. It cannot be changed. 417 * The headers below cannot be set or overridden: 418 * * `Host` 419 * * `X-Google-*` 420 * * `X-AppEngine-*` 421 * In addition, Cloud Tasks sets some headers when the task is dispatched, 422 * such as headers containing information about the task; see 423 * [request 424 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 425 * These headers are set only when the task is dispatched, so they are not 426 * visible when the task is returned in a Cloud Tasks response. 427 * Although there is no specific limit for the maximum number of headers or 428 * the size, there is a limit on the maximum size of the 429 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 430 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 431 * documentation. 432 * </pre> 433 * 434 * <code>map<string, string> headers = 4;</code> 435 */ 436 @java.lang.Override getHeadersMap()437 public java.util.Map<java.lang.String, java.lang.String> getHeadersMap() { 438 return internalGetHeaders().getMap(); 439 } 440 /** 441 * 442 * 443 * <pre> 444 * HTTP request headers. 445 * This map contains the header field names and values. 446 * Headers can be set when the 447 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 448 * Repeated headers are not supported but a header value can contain commas. 449 * Cloud Tasks sets some headers to default values: 450 * * `User-Agent`: By default, this header is 451 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 452 * This header can be modified, but Cloud Tasks will append 453 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 454 * modified `User-Agent`. 455 * If the task has a 456 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 457 * Tasks sets the following headers: 458 * * `Content-Type`: By default, the `Content-Type` header is set to 459 * `"application/octet-stream"`. The default can be overridden by explicitly 460 * setting `Content-Type` to a particular media type when the 461 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 462 * For example, `Content-Type` can be set to `"application/json"`. 463 * * `Content-Length`: This is computed by Cloud Tasks. This value is 464 * output only. It cannot be changed. 465 * The headers below cannot be set or overridden: 466 * * `Host` 467 * * `X-Google-*` 468 * * `X-AppEngine-*` 469 * In addition, Cloud Tasks sets some headers when the task is dispatched, 470 * such as headers containing information about the task; see 471 * [request 472 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 473 * These headers are set only when the task is dispatched, so they are not 474 * visible when the task is returned in a Cloud Tasks response. 475 * Although there is no specific limit for the maximum number of headers or 476 * the size, there is a limit on the maximum size of the 477 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 478 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 479 * documentation. 480 * </pre> 481 * 482 * <code>map<string, string> headers = 4;</code> 483 */ 484 @java.lang.Override getHeadersOrDefault( java.lang.String key, java.lang.String defaultValue)485 public /* nullable */ java.lang.String getHeadersOrDefault( 486 java.lang.String key, 487 /* nullable */ 488 java.lang.String defaultValue) { 489 if (key == null) { 490 throw new NullPointerException("map key"); 491 } 492 java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); 493 return map.containsKey(key) ? map.get(key) : defaultValue; 494 } 495 /** 496 * 497 * 498 * <pre> 499 * HTTP request headers. 500 * This map contains the header field names and values. 501 * Headers can be set when the 502 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 503 * Repeated headers are not supported but a header value can contain commas. 504 * Cloud Tasks sets some headers to default values: 505 * * `User-Agent`: By default, this header is 506 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 507 * This header can be modified, but Cloud Tasks will append 508 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 509 * modified `User-Agent`. 510 * If the task has a 511 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 512 * Tasks sets the following headers: 513 * * `Content-Type`: By default, the `Content-Type` header is set to 514 * `"application/octet-stream"`. The default can be overridden by explicitly 515 * setting `Content-Type` to a particular media type when the 516 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 517 * For example, `Content-Type` can be set to `"application/json"`. 518 * * `Content-Length`: This is computed by Cloud Tasks. This value is 519 * output only. It cannot be changed. 520 * The headers below cannot be set or overridden: 521 * * `Host` 522 * * `X-Google-*` 523 * * `X-AppEngine-*` 524 * In addition, Cloud Tasks sets some headers when the task is dispatched, 525 * such as headers containing information about the task; see 526 * [request 527 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 528 * These headers are set only when the task is dispatched, so they are not 529 * visible when the task is returned in a Cloud Tasks response. 530 * Although there is no specific limit for the maximum number of headers or 531 * the size, there is a limit on the maximum size of the 532 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 533 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 534 * documentation. 535 * </pre> 536 * 537 * <code>map<string, string> headers = 4;</code> 538 */ 539 @java.lang.Override getHeadersOrThrow(java.lang.String key)540 public java.lang.String getHeadersOrThrow(java.lang.String key) { 541 if (key == null) { 542 throw new NullPointerException("map key"); 543 } 544 java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); 545 if (!map.containsKey(key)) { 546 throw new java.lang.IllegalArgumentException(); 547 } 548 return map.get(key); 549 } 550 551 public static final int PAYLOAD_FIELD_NUMBER = 5; 552 private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; 553 /** 554 * 555 * 556 * <pre> 557 * Payload. 558 * The payload will be sent as the HTTP message body. A message 559 * body, and thus a payload, is allowed only if the HTTP method is 560 * POST or PUT. It is an error to set a data payload on a task with 561 * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. 562 * </pre> 563 * 564 * <code>bytes payload = 5;</code> 565 * 566 * @return The payload. 567 */ 568 @java.lang.Override getPayload()569 public com.google.protobuf.ByteString getPayload() { 570 return payload_; 571 } 572 573 private byte memoizedIsInitialized = -1; 574 575 @java.lang.Override isInitialized()576 public final boolean isInitialized() { 577 byte isInitialized = memoizedIsInitialized; 578 if (isInitialized == 1) return true; 579 if (isInitialized == 0) return false; 580 581 memoizedIsInitialized = 1; 582 return true; 583 } 584 585 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)586 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 587 if (httpMethod_ 588 != com.google.cloud.tasks.v2beta2.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { 589 output.writeEnum(1, httpMethod_); 590 } 591 if (appEngineRouting_ != null) { 592 output.writeMessage(2, getAppEngineRouting()); 593 } 594 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(relativeUrl_)) { 595 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, relativeUrl_); 596 } 597 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 598 output, internalGetHeaders(), HeadersDefaultEntryHolder.defaultEntry, 4); 599 if (!payload_.isEmpty()) { 600 output.writeBytes(5, payload_); 601 } 602 getUnknownFields().writeTo(output); 603 } 604 605 @java.lang.Override getSerializedSize()606 public int getSerializedSize() { 607 int size = memoizedSize; 608 if (size != -1) return size; 609 610 size = 0; 611 if (httpMethod_ 612 != com.google.cloud.tasks.v2beta2.HttpMethod.HTTP_METHOD_UNSPECIFIED.getNumber()) { 613 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, httpMethod_); 614 } 615 if (appEngineRouting_ != null) { 616 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAppEngineRouting()); 617 } 618 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(relativeUrl_)) { 619 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, relativeUrl_); 620 } 621 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 622 internalGetHeaders().getMap().entrySet()) { 623 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> headers__ = 624 HeadersDefaultEntryHolder.defaultEntry 625 .newBuilderForType() 626 .setKey(entry.getKey()) 627 .setValue(entry.getValue()) 628 .build(); 629 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, headers__); 630 } 631 if (!payload_.isEmpty()) { 632 size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, payload_); 633 } 634 size += getUnknownFields().getSerializedSize(); 635 memoizedSize = size; 636 return size; 637 } 638 639 @java.lang.Override equals(final java.lang.Object obj)640 public boolean equals(final java.lang.Object obj) { 641 if (obj == this) { 642 return true; 643 } 644 if (!(obj instanceof com.google.cloud.tasks.v2beta2.AppEngineHttpRequest)) { 645 return super.equals(obj); 646 } 647 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest other = 648 (com.google.cloud.tasks.v2beta2.AppEngineHttpRequest) obj; 649 650 if (httpMethod_ != other.httpMethod_) return false; 651 if (hasAppEngineRouting() != other.hasAppEngineRouting()) return false; 652 if (hasAppEngineRouting()) { 653 if (!getAppEngineRouting().equals(other.getAppEngineRouting())) return false; 654 } 655 if (!getRelativeUrl().equals(other.getRelativeUrl())) return false; 656 if (!internalGetHeaders().equals(other.internalGetHeaders())) return false; 657 if (!getPayload().equals(other.getPayload())) return false; 658 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 659 return true; 660 } 661 662 @java.lang.Override hashCode()663 public int hashCode() { 664 if (memoizedHashCode != 0) { 665 return memoizedHashCode; 666 } 667 int hash = 41; 668 hash = (19 * hash) + getDescriptor().hashCode(); 669 hash = (37 * hash) + HTTP_METHOD_FIELD_NUMBER; 670 hash = (53 * hash) + httpMethod_; 671 if (hasAppEngineRouting()) { 672 hash = (37 * hash) + APP_ENGINE_ROUTING_FIELD_NUMBER; 673 hash = (53 * hash) + getAppEngineRouting().hashCode(); 674 } 675 hash = (37 * hash) + RELATIVE_URL_FIELD_NUMBER; 676 hash = (53 * hash) + getRelativeUrl().hashCode(); 677 if (!internalGetHeaders().getMap().isEmpty()) { 678 hash = (37 * hash) + HEADERS_FIELD_NUMBER; 679 hash = (53 * hash) + internalGetHeaders().hashCode(); 680 } 681 hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; 682 hash = (53 * hash) + getPayload().hashCode(); 683 hash = (29 * hash) + getUnknownFields().hashCode(); 684 memoizedHashCode = hash; 685 return hash; 686 } 687 parseFrom( java.nio.ByteBuffer data)688 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 689 java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { 690 return PARSER.parseFrom(data); 691 } 692 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)693 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 694 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 695 throws com.google.protobuf.InvalidProtocolBufferException { 696 return PARSER.parseFrom(data, extensionRegistry); 697 } 698 parseFrom( com.google.protobuf.ByteString data)699 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 700 com.google.protobuf.ByteString data) 701 throws com.google.protobuf.InvalidProtocolBufferException { 702 return PARSER.parseFrom(data); 703 } 704 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)705 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 706 com.google.protobuf.ByteString data, 707 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 708 throws com.google.protobuf.InvalidProtocolBufferException { 709 return PARSER.parseFrom(data, extensionRegistry); 710 } 711 parseFrom(byte[] data)712 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom(byte[] data) 713 throws com.google.protobuf.InvalidProtocolBufferException { 714 return PARSER.parseFrom(data); 715 } 716 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)717 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 718 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 719 throws com.google.protobuf.InvalidProtocolBufferException { 720 return PARSER.parseFrom(data, extensionRegistry); 721 } 722 parseFrom( java.io.InputStream input)723 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 724 java.io.InputStream input) throws java.io.IOException { 725 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 726 } 727 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)728 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 729 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 730 throws java.io.IOException { 731 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 732 PARSER, input, extensionRegistry); 733 } 734 parseDelimitedFrom( java.io.InputStream input)735 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseDelimitedFrom( 736 java.io.InputStream input) throws java.io.IOException { 737 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 738 } 739 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)740 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseDelimitedFrom( 741 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 742 throws java.io.IOException { 743 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 744 PARSER, input, extensionRegistry); 745 } 746 parseFrom( com.google.protobuf.CodedInputStream input)747 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 748 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 749 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 750 } 751 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)752 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest parseFrom( 753 com.google.protobuf.CodedInputStream input, 754 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 755 throws java.io.IOException { 756 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 757 PARSER, input, extensionRegistry); 758 } 759 760 @java.lang.Override newBuilderForType()761 public Builder newBuilderForType() { 762 return newBuilder(); 763 } 764 newBuilder()765 public static Builder newBuilder() { 766 return DEFAULT_INSTANCE.toBuilder(); 767 } 768 newBuilder(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest prototype)769 public static Builder newBuilder(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest prototype) { 770 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 771 } 772 773 @java.lang.Override toBuilder()774 public Builder toBuilder() { 775 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 776 } 777 778 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)779 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 780 Builder builder = new Builder(parent); 781 return builder; 782 } 783 /** 784 * 785 * 786 * <pre> 787 * App Engine HTTP request. 788 * The message defines the HTTP request that is sent to an App Engine app when 789 * the task is dispatched. 790 * This proto can only be used for tasks in a queue which has 791 * [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] 792 * set. 793 * Using [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] 794 * requires 795 * [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 796 * Google IAM permission for the project 797 * and the following scope: 798 * `https://www.googleapis.com/auth/cloud-platform` 799 * The task will be delivered to the App Engine app which belongs to the same 800 * project as the queue. For more information, see 801 * [How Requests are 802 * Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 803 * and how routing is affected by 804 * [dispatch 805 * files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 806 * Traffic is encrypted during transport and never leaves Google datacenters. 807 * Because this traffic is carried over a communication mechanism internal to 808 * Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 809 * The request to the handler, however, will appear to have used the HTTP 810 * protocol. 811 * The [AppEngineRouting][google.cloud.tasks.v2beta2.AppEngineRouting] used to 812 * construct the URL that the task is delivered to can be set at the queue-level 813 * or task-level: 814 * * If set, 815 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 816 * is used for all tasks in the queue, no matter what the setting 817 * is for the 818 * [task-level 819 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 820 * The `url` that the task will be sent to is: 821 * * `url =` [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] `+` 822 * [relative_url][google.cloud.tasks.v2beta2.AppEngineHttpRequest.relative_url] 823 * Tasks can be dispatched to secure app handlers, unsecure app handlers, and 824 * URIs restricted with 825 * [`login: 826 * admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 827 * Because tasks are not run as any user, they cannot be dispatched to URIs 828 * restricted with 829 * [`login: 830 * required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 831 * Task dispatches also do not follow redirects. 832 * The task attempt has succeeded if the app's request handler returns an HTTP 833 * response code in the range [`200` - `299`]. The task attempt has failed if 834 * the app's handler returns a non-2xx response code or Cloud Tasks does 835 * not receive response before the [deadline][Task.dispatch_deadline]. Failed 836 * tasks will be retried according to the 837 * [retry configuration][google.cloud.tasks.v2beta2.Queue.retry_config]. `503` 838 * (Service Unavailable) is considered an App Engine system error instead of an 839 * application error and will cause Cloud Tasks' traffic congestion control to 840 * temporarily throttle the queue's dispatches. Unlike other types of task 841 * targets, a `429` (Too Many Requests) response from an app handler does not 842 * cause traffic congestion control to throttle the queue. 843 * </pre> 844 * 845 * Protobuf type {@code google.cloud.tasks.v2beta2.AppEngineHttpRequest} 846 */ 847 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 848 implements 849 // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta2.AppEngineHttpRequest) 850 com.google.cloud.tasks.v2beta2.AppEngineHttpRequestOrBuilder { getDescriptor()851 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 852 return com.google.cloud.tasks.v2beta2.TargetProto 853 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_descriptor; 854 } 855 856 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)857 protected com.google.protobuf.MapField internalGetMapField(int number) { 858 switch (number) { 859 case 4: 860 return internalGetHeaders(); 861 default: 862 throw new RuntimeException("Invalid map field number: " + number); 863 } 864 } 865 866 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)867 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 868 switch (number) { 869 case 4: 870 return internalGetMutableHeaders(); 871 default: 872 throw new RuntimeException("Invalid map field number: " + number); 873 } 874 } 875 876 @java.lang.Override 877 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()878 internalGetFieldAccessorTable() { 879 return com.google.cloud.tasks.v2beta2.TargetProto 880 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_fieldAccessorTable 881 .ensureFieldAccessorsInitialized( 882 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.class, 883 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.Builder.class); 884 } 885 886 // Construct using com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.newBuilder() Builder()887 private Builder() {} 888 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)889 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 890 super(parent); 891 } 892 893 @java.lang.Override clear()894 public Builder clear() { 895 super.clear(); 896 bitField0_ = 0; 897 httpMethod_ = 0; 898 appEngineRouting_ = null; 899 if (appEngineRoutingBuilder_ != null) { 900 appEngineRoutingBuilder_.dispose(); 901 appEngineRoutingBuilder_ = null; 902 } 903 relativeUrl_ = ""; 904 internalGetMutableHeaders().clear(); 905 payload_ = com.google.protobuf.ByteString.EMPTY; 906 return this; 907 } 908 909 @java.lang.Override getDescriptorForType()910 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 911 return com.google.cloud.tasks.v2beta2.TargetProto 912 .internal_static_google_cloud_tasks_v2beta2_AppEngineHttpRequest_descriptor; 913 } 914 915 @java.lang.Override getDefaultInstanceForType()916 public com.google.cloud.tasks.v2beta2.AppEngineHttpRequest getDefaultInstanceForType() { 917 return com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.getDefaultInstance(); 918 } 919 920 @java.lang.Override build()921 public com.google.cloud.tasks.v2beta2.AppEngineHttpRequest build() { 922 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest result = buildPartial(); 923 if (!result.isInitialized()) { 924 throw newUninitializedMessageException(result); 925 } 926 return result; 927 } 928 929 @java.lang.Override buildPartial()930 public com.google.cloud.tasks.v2beta2.AppEngineHttpRequest buildPartial() { 931 com.google.cloud.tasks.v2beta2.AppEngineHttpRequest result = 932 new com.google.cloud.tasks.v2beta2.AppEngineHttpRequest(this); 933 if (bitField0_ != 0) { 934 buildPartial0(result); 935 } 936 onBuilt(); 937 return result; 938 } 939 buildPartial0(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest result)940 private void buildPartial0(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest result) { 941 int from_bitField0_ = bitField0_; 942 if (((from_bitField0_ & 0x00000001) != 0)) { 943 result.httpMethod_ = httpMethod_; 944 } 945 if (((from_bitField0_ & 0x00000002) != 0)) { 946 result.appEngineRouting_ = 947 appEngineRoutingBuilder_ == null ? appEngineRouting_ : appEngineRoutingBuilder_.build(); 948 } 949 if (((from_bitField0_ & 0x00000004) != 0)) { 950 result.relativeUrl_ = relativeUrl_; 951 } 952 if (((from_bitField0_ & 0x00000008) != 0)) { 953 result.headers_ = internalGetHeaders(); 954 result.headers_.makeImmutable(); 955 } 956 if (((from_bitField0_ & 0x00000010) != 0)) { 957 result.payload_ = payload_; 958 } 959 } 960 961 @java.lang.Override clone()962 public Builder clone() { 963 return super.clone(); 964 } 965 966 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)967 public Builder setField( 968 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 969 return super.setField(field, value); 970 } 971 972 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)973 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 974 return super.clearField(field); 975 } 976 977 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)978 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 979 return super.clearOneof(oneof); 980 } 981 982 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)983 public Builder setRepeatedField( 984 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 985 return super.setRepeatedField(field, index, value); 986 } 987 988 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)989 public Builder addRepeatedField( 990 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 991 return super.addRepeatedField(field, value); 992 } 993 994 @java.lang.Override mergeFrom(com.google.protobuf.Message other)995 public Builder mergeFrom(com.google.protobuf.Message other) { 996 if (other instanceof com.google.cloud.tasks.v2beta2.AppEngineHttpRequest) { 997 return mergeFrom((com.google.cloud.tasks.v2beta2.AppEngineHttpRequest) other); 998 } else { 999 super.mergeFrom(other); 1000 return this; 1001 } 1002 } 1003 mergeFrom(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest other)1004 public Builder mergeFrom(com.google.cloud.tasks.v2beta2.AppEngineHttpRequest other) { 1005 if (other == com.google.cloud.tasks.v2beta2.AppEngineHttpRequest.getDefaultInstance()) 1006 return this; 1007 if (other.httpMethod_ != 0) { 1008 setHttpMethodValue(other.getHttpMethodValue()); 1009 } 1010 if (other.hasAppEngineRouting()) { 1011 mergeAppEngineRouting(other.getAppEngineRouting()); 1012 } 1013 if (!other.getRelativeUrl().isEmpty()) { 1014 relativeUrl_ = other.relativeUrl_; 1015 bitField0_ |= 0x00000004; 1016 onChanged(); 1017 } 1018 internalGetMutableHeaders().mergeFrom(other.internalGetHeaders()); 1019 bitField0_ |= 0x00000008; 1020 if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { 1021 setPayload(other.getPayload()); 1022 } 1023 this.mergeUnknownFields(other.getUnknownFields()); 1024 onChanged(); 1025 return this; 1026 } 1027 1028 @java.lang.Override isInitialized()1029 public final boolean isInitialized() { 1030 return true; 1031 } 1032 1033 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1034 public Builder mergeFrom( 1035 com.google.protobuf.CodedInputStream input, 1036 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1037 throws java.io.IOException { 1038 if (extensionRegistry == null) { 1039 throw new java.lang.NullPointerException(); 1040 } 1041 try { 1042 boolean done = false; 1043 while (!done) { 1044 int tag = input.readTag(); 1045 switch (tag) { 1046 case 0: 1047 done = true; 1048 break; 1049 case 8: 1050 { 1051 httpMethod_ = input.readEnum(); 1052 bitField0_ |= 0x00000001; 1053 break; 1054 } // case 8 1055 case 18: 1056 { 1057 input.readMessage( 1058 getAppEngineRoutingFieldBuilder().getBuilder(), extensionRegistry); 1059 bitField0_ |= 0x00000002; 1060 break; 1061 } // case 18 1062 case 26: 1063 { 1064 relativeUrl_ = input.readStringRequireUtf8(); 1065 bitField0_ |= 0x00000004; 1066 break; 1067 } // case 26 1068 case 34: 1069 { 1070 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> headers__ = 1071 input.readMessage( 1072 HeadersDefaultEntryHolder.defaultEntry.getParserForType(), 1073 extensionRegistry); 1074 internalGetMutableHeaders() 1075 .getMutableMap() 1076 .put(headers__.getKey(), headers__.getValue()); 1077 bitField0_ |= 0x00000008; 1078 break; 1079 } // case 34 1080 case 42: 1081 { 1082 payload_ = input.readBytes(); 1083 bitField0_ |= 0x00000010; 1084 break; 1085 } // case 42 1086 default: 1087 { 1088 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1089 done = true; // was an endgroup tag 1090 } 1091 break; 1092 } // default: 1093 } // switch (tag) 1094 } // while (!done) 1095 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1096 throw e.unwrapIOException(); 1097 } finally { 1098 onChanged(); 1099 } // finally 1100 return this; 1101 } 1102 1103 private int bitField0_; 1104 1105 private int httpMethod_ = 0; 1106 /** 1107 * 1108 * 1109 * <pre> 1110 * The HTTP method to use for the request. The default is POST. 1111 * The app's request handler for the task's target URL must be able to handle 1112 * HTTP requests with this http_method, otherwise the task attempt fails with 1113 * error code 405 (Method Not Allowed). See [Writing a push task request 1114 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1115 * and the App Engine documentation for your runtime on [How Requests are 1116 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 1117 * </pre> 1118 * 1119 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 1120 * 1121 * @return The enum numeric value on the wire for httpMethod. 1122 */ 1123 @java.lang.Override getHttpMethodValue()1124 public int getHttpMethodValue() { 1125 return httpMethod_; 1126 } 1127 /** 1128 * 1129 * 1130 * <pre> 1131 * The HTTP method to use for the request. The default is POST. 1132 * The app's request handler for the task's target URL must be able to handle 1133 * HTTP requests with this http_method, otherwise the task attempt fails with 1134 * error code 405 (Method Not Allowed). See [Writing a push task request 1135 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1136 * and the App Engine documentation for your runtime on [How Requests are 1137 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 1138 * </pre> 1139 * 1140 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 1141 * 1142 * @param value The enum numeric value on the wire for httpMethod to set. 1143 * @return This builder for chaining. 1144 */ setHttpMethodValue(int value)1145 public Builder setHttpMethodValue(int value) { 1146 httpMethod_ = value; 1147 bitField0_ |= 0x00000001; 1148 onChanged(); 1149 return this; 1150 } 1151 /** 1152 * 1153 * 1154 * <pre> 1155 * The HTTP method to use for the request. The default is POST. 1156 * The app's request handler for the task's target URL must be able to handle 1157 * HTTP requests with this http_method, otherwise the task attempt fails with 1158 * error code 405 (Method Not Allowed). See [Writing a push task request 1159 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1160 * and the App Engine documentation for your runtime on [How Requests are 1161 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 1162 * </pre> 1163 * 1164 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 1165 * 1166 * @return The httpMethod. 1167 */ 1168 @java.lang.Override getHttpMethod()1169 public com.google.cloud.tasks.v2beta2.HttpMethod getHttpMethod() { 1170 com.google.cloud.tasks.v2beta2.HttpMethod result = 1171 com.google.cloud.tasks.v2beta2.HttpMethod.forNumber(httpMethod_); 1172 return result == null ? com.google.cloud.tasks.v2beta2.HttpMethod.UNRECOGNIZED : result; 1173 } 1174 /** 1175 * 1176 * 1177 * <pre> 1178 * The HTTP method to use for the request. The default is POST. 1179 * The app's request handler for the task's target URL must be able to handle 1180 * HTTP requests with this http_method, otherwise the task attempt fails with 1181 * error code 405 (Method Not Allowed). See [Writing a push task request 1182 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1183 * and the App Engine documentation for your runtime on [How Requests are 1184 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 1185 * </pre> 1186 * 1187 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 1188 * 1189 * @param value The httpMethod to set. 1190 * @return This builder for chaining. 1191 */ setHttpMethod(com.google.cloud.tasks.v2beta2.HttpMethod value)1192 public Builder setHttpMethod(com.google.cloud.tasks.v2beta2.HttpMethod value) { 1193 if (value == null) { 1194 throw new NullPointerException(); 1195 } 1196 bitField0_ |= 0x00000001; 1197 httpMethod_ = value.getNumber(); 1198 onChanged(); 1199 return this; 1200 } 1201 /** 1202 * 1203 * 1204 * <pre> 1205 * The HTTP method to use for the request. The default is POST. 1206 * The app's request handler for the task's target URL must be able to handle 1207 * HTTP requests with this http_method, otherwise the task attempt fails with 1208 * error code 405 (Method Not Allowed). See [Writing a push task request 1209 * handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1210 * and the App Engine documentation for your runtime on [How Requests are 1211 * Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 1212 * </pre> 1213 * 1214 * <code>.google.cloud.tasks.v2beta2.HttpMethod http_method = 1;</code> 1215 * 1216 * @return This builder for chaining. 1217 */ clearHttpMethod()1218 public Builder clearHttpMethod() { 1219 bitField0_ = (bitField0_ & ~0x00000001); 1220 httpMethod_ = 0; 1221 onChanged(); 1222 return this; 1223 } 1224 1225 private com.google.cloud.tasks.v2beta2.AppEngineRouting appEngineRouting_; 1226 private com.google.protobuf.SingleFieldBuilderV3< 1227 com.google.cloud.tasks.v2beta2.AppEngineRouting, 1228 com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder, 1229 com.google.cloud.tasks.v2beta2.AppEngineRoutingOrBuilder> 1230 appEngineRoutingBuilder_; 1231 /** 1232 * 1233 * 1234 * <pre> 1235 * Task-level setting for App Engine routing. 1236 * If set, 1237 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1238 * is used for all tasks in the queue, no matter what the setting is for the 1239 * [task-level 1240 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1241 * </pre> 1242 * 1243 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1244 * 1245 * @return Whether the appEngineRouting field is set. 1246 */ hasAppEngineRouting()1247 public boolean hasAppEngineRouting() { 1248 return ((bitField0_ & 0x00000002) != 0); 1249 } 1250 /** 1251 * 1252 * 1253 * <pre> 1254 * Task-level setting for App Engine routing. 1255 * If set, 1256 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1257 * is used for all tasks in the queue, no matter what the setting is for the 1258 * [task-level 1259 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1260 * </pre> 1261 * 1262 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1263 * 1264 * @return The appEngineRouting. 1265 */ getAppEngineRouting()1266 public com.google.cloud.tasks.v2beta2.AppEngineRouting getAppEngineRouting() { 1267 if (appEngineRoutingBuilder_ == null) { 1268 return appEngineRouting_ == null 1269 ? com.google.cloud.tasks.v2beta2.AppEngineRouting.getDefaultInstance() 1270 : appEngineRouting_; 1271 } else { 1272 return appEngineRoutingBuilder_.getMessage(); 1273 } 1274 } 1275 /** 1276 * 1277 * 1278 * <pre> 1279 * Task-level setting for App Engine routing. 1280 * If set, 1281 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1282 * is used for all tasks in the queue, no matter what the setting is for the 1283 * [task-level 1284 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1285 * </pre> 1286 * 1287 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1288 */ setAppEngineRouting(com.google.cloud.tasks.v2beta2.AppEngineRouting value)1289 public Builder setAppEngineRouting(com.google.cloud.tasks.v2beta2.AppEngineRouting value) { 1290 if (appEngineRoutingBuilder_ == null) { 1291 if (value == null) { 1292 throw new NullPointerException(); 1293 } 1294 appEngineRouting_ = value; 1295 } else { 1296 appEngineRoutingBuilder_.setMessage(value); 1297 } 1298 bitField0_ |= 0x00000002; 1299 onChanged(); 1300 return this; 1301 } 1302 /** 1303 * 1304 * 1305 * <pre> 1306 * Task-level setting for App Engine routing. 1307 * If set, 1308 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1309 * is used for all tasks in the queue, no matter what the setting is for the 1310 * [task-level 1311 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1312 * </pre> 1313 * 1314 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1315 */ setAppEngineRouting( com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder builderForValue)1316 public Builder setAppEngineRouting( 1317 com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder builderForValue) { 1318 if (appEngineRoutingBuilder_ == null) { 1319 appEngineRouting_ = builderForValue.build(); 1320 } else { 1321 appEngineRoutingBuilder_.setMessage(builderForValue.build()); 1322 } 1323 bitField0_ |= 0x00000002; 1324 onChanged(); 1325 return this; 1326 } 1327 /** 1328 * 1329 * 1330 * <pre> 1331 * Task-level setting for App Engine routing. 1332 * If set, 1333 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1334 * is used for all tasks in the queue, no matter what the setting is for the 1335 * [task-level 1336 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1337 * </pre> 1338 * 1339 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1340 */ mergeAppEngineRouting(com.google.cloud.tasks.v2beta2.AppEngineRouting value)1341 public Builder mergeAppEngineRouting(com.google.cloud.tasks.v2beta2.AppEngineRouting value) { 1342 if (appEngineRoutingBuilder_ == null) { 1343 if (((bitField0_ & 0x00000002) != 0) 1344 && appEngineRouting_ != null 1345 && appEngineRouting_ 1346 != com.google.cloud.tasks.v2beta2.AppEngineRouting.getDefaultInstance()) { 1347 getAppEngineRoutingBuilder().mergeFrom(value); 1348 } else { 1349 appEngineRouting_ = value; 1350 } 1351 } else { 1352 appEngineRoutingBuilder_.mergeFrom(value); 1353 } 1354 bitField0_ |= 0x00000002; 1355 onChanged(); 1356 return this; 1357 } 1358 /** 1359 * 1360 * 1361 * <pre> 1362 * Task-level setting for App Engine routing. 1363 * If set, 1364 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1365 * is used for all tasks in the queue, no matter what the setting is for the 1366 * [task-level 1367 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1368 * </pre> 1369 * 1370 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1371 */ clearAppEngineRouting()1372 public Builder clearAppEngineRouting() { 1373 bitField0_ = (bitField0_ & ~0x00000002); 1374 appEngineRouting_ = null; 1375 if (appEngineRoutingBuilder_ != null) { 1376 appEngineRoutingBuilder_.dispose(); 1377 appEngineRoutingBuilder_ = null; 1378 } 1379 onChanged(); 1380 return this; 1381 } 1382 /** 1383 * 1384 * 1385 * <pre> 1386 * Task-level setting for App Engine routing. 1387 * If set, 1388 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1389 * is used for all tasks in the queue, no matter what the setting is for the 1390 * [task-level 1391 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1392 * </pre> 1393 * 1394 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1395 */ getAppEngineRoutingBuilder()1396 public com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder getAppEngineRoutingBuilder() { 1397 bitField0_ |= 0x00000002; 1398 onChanged(); 1399 return getAppEngineRoutingFieldBuilder().getBuilder(); 1400 } 1401 /** 1402 * 1403 * 1404 * <pre> 1405 * Task-level setting for App Engine routing. 1406 * If set, 1407 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1408 * is used for all tasks in the queue, no matter what the setting is for the 1409 * [task-level 1410 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1411 * </pre> 1412 * 1413 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1414 */ getAppEngineRoutingOrBuilder()1415 public com.google.cloud.tasks.v2beta2.AppEngineRoutingOrBuilder getAppEngineRoutingOrBuilder() { 1416 if (appEngineRoutingBuilder_ != null) { 1417 return appEngineRoutingBuilder_.getMessageOrBuilder(); 1418 } else { 1419 return appEngineRouting_ == null 1420 ? com.google.cloud.tasks.v2beta2.AppEngineRouting.getDefaultInstance() 1421 : appEngineRouting_; 1422 } 1423 } 1424 /** 1425 * 1426 * 1427 * <pre> 1428 * Task-level setting for App Engine routing. 1429 * If set, 1430 * [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] 1431 * is used for all tasks in the queue, no matter what the setting is for the 1432 * [task-level 1433 * app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. 1434 * </pre> 1435 * 1436 * <code>.google.cloud.tasks.v2beta2.AppEngineRouting app_engine_routing = 2;</code> 1437 */ 1438 private com.google.protobuf.SingleFieldBuilderV3< 1439 com.google.cloud.tasks.v2beta2.AppEngineRouting, 1440 com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder, 1441 com.google.cloud.tasks.v2beta2.AppEngineRoutingOrBuilder> getAppEngineRoutingFieldBuilder()1442 getAppEngineRoutingFieldBuilder() { 1443 if (appEngineRoutingBuilder_ == null) { 1444 appEngineRoutingBuilder_ = 1445 new com.google.protobuf.SingleFieldBuilderV3< 1446 com.google.cloud.tasks.v2beta2.AppEngineRouting, 1447 com.google.cloud.tasks.v2beta2.AppEngineRouting.Builder, 1448 com.google.cloud.tasks.v2beta2.AppEngineRoutingOrBuilder>( 1449 getAppEngineRouting(), getParentForChildren(), isClean()); 1450 appEngineRouting_ = null; 1451 } 1452 return appEngineRoutingBuilder_; 1453 } 1454 1455 private java.lang.Object relativeUrl_ = ""; 1456 /** 1457 * 1458 * 1459 * <pre> 1460 * The relative URL. 1461 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 1462 * It can contain a path and query string arguments. 1463 * If the relative URL is empty, then the root path "/" will be used. 1464 * No spaces are allowed, and the maximum length allowed is 2083 characters. 1465 * </pre> 1466 * 1467 * <code>string relative_url = 3;</code> 1468 * 1469 * @return The relativeUrl. 1470 */ getRelativeUrl()1471 public java.lang.String getRelativeUrl() { 1472 java.lang.Object ref = relativeUrl_; 1473 if (!(ref instanceof java.lang.String)) { 1474 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1475 java.lang.String s = bs.toStringUtf8(); 1476 relativeUrl_ = s; 1477 return s; 1478 } else { 1479 return (java.lang.String) ref; 1480 } 1481 } 1482 /** 1483 * 1484 * 1485 * <pre> 1486 * The relative URL. 1487 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 1488 * It can contain a path and query string arguments. 1489 * If the relative URL is empty, then the root path "/" will be used. 1490 * No spaces are allowed, and the maximum length allowed is 2083 characters. 1491 * </pre> 1492 * 1493 * <code>string relative_url = 3;</code> 1494 * 1495 * @return The bytes for relativeUrl. 1496 */ getRelativeUrlBytes()1497 public com.google.protobuf.ByteString getRelativeUrlBytes() { 1498 java.lang.Object ref = relativeUrl_; 1499 if (ref instanceof String) { 1500 com.google.protobuf.ByteString b = 1501 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1502 relativeUrl_ = b; 1503 return b; 1504 } else { 1505 return (com.google.protobuf.ByteString) ref; 1506 } 1507 } 1508 /** 1509 * 1510 * 1511 * <pre> 1512 * The relative URL. 1513 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 1514 * It can contain a path and query string arguments. 1515 * If the relative URL is empty, then the root path "/" will be used. 1516 * No spaces are allowed, and the maximum length allowed is 2083 characters. 1517 * </pre> 1518 * 1519 * <code>string relative_url = 3;</code> 1520 * 1521 * @param value The relativeUrl to set. 1522 * @return This builder for chaining. 1523 */ setRelativeUrl(java.lang.String value)1524 public Builder setRelativeUrl(java.lang.String value) { 1525 if (value == null) { 1526 throw new NullPointerException(); 1527 } 1528 relativeUrl_ = value; 1529 bitField0_ |= 0x00000004; 1530 onChanged(); 1531 return this; 1532 } 1533 /** 1534 * 1535 * 1536 * <pre> 1537 * The relative URL. 1538 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 1539 * It can contain a path and query string arguments. 1540 * If the relative URL is empty, then the root path "/" will be used. 1541 * No spaces are allowed, and the maximum length allowed is 2083 characters. 1542 * </pre> 1543 * 1544 * <code>string relative_url = 3;</code> 1545 * 1546 * @return This builder for chaining. 1547 */ clearRelativeUrl()1548 public Builder clearRelativeUrl() { 1549 relativeUrl_ = getDefaultInstance().getRelativeUrl(); 1550 bitField0_ = (bitField0_ & ~0x00000004); 1551 onChanged(); 1552 return this; 1553 } 1554 /** 1555 * 1556 * 1557 * <pre> 1558 * The relative URL. 1559 * The relative URL must begin with "/" and must be a valid HTTP relative URL. 1560 * It can contain a path and query string arguments. 1561 * If the relative URL is empty, then the root path "/" will be used. 1562 * No spaces are allowed, and the maximum length allowed is 2083 characters. 1563 * </pre> 1564 * 1565 * <code>string relative_url = 3;</code> 1566 * 1567 * @param value The bytes for relativeUrl to set. 1568 * @return This builder for chaining. 1569 */ setRelativeUrlBytes(com.google.protobuf.ByteString value)1570 public Builder setRelativeUrlBytes(com.google.protobuf.ByteString value) { 1571 if (value == null) { 1572 throw new NullPointerException(); 1573 } 1574 checkByteStringIsUtf8(value); 1575 relativeUrl_ = value; 1576 bitField0_ |= 0x00000004; 1577 onChanged(); 1578 return this; 1579 } 1580 1581 private com.google.protobuf.MapField<java.lang.String, java.lang.String> headers_; 1582 internalGetHeaders()1583 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetHeaders() { 1584 if (headers_ == null) { 1585 return com.google.protobuf.MapField.emptyMapField(HeadersDefaultEntryHolder.defaultEntry); 1586 } 1587 return headers_; 1588 } 1589 1590 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableHeaders()1591 internalGetMutableHeaders() { 1592 if (headers_ == null) { 1593 headers_ = com.google.protobuf.MapField.newMapField(HeadersDefaultEntryHolder.defaultEntry); 1594 } 1595 if (!headers_.isMutable()) { 1596 headers_ = headers_.copy(); 1597 } 1598 bitField0_ |= 0x00000008; 1599 onChanged(); 1600 return headers_; 1601 } 1602 getHeadersCount()1603 public int getHeadersCount() { 1604 return internalGetHeaders().getMap().size(); 1605 } 1606 /** 1607 * 1608 * 1609 * <pre> 1610 * HTTP request headers. 1611 * This map contains the header field names and values. 1612 * Headers can be set when the 1613 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1614 * Repeated headers are not supported but a header value can contain commas. 1615 * Cloud Tasks sets some headers to default values: 1616 * * `User-Agent`: By default, this header is 1617 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1618 * This header can be modified, but Cloud Tasks will append 1619 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1620 * modified `User-Agent`. 1621 * If the task has a 1622 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1623 * Tasks sets the following headers: 1624 * * `Content-Type`: By default, the `Content-Type` header is set to 1625 * `"application/octet-stream"`. The default can be overridden by explicitly 1626 * setting `Content-Type` to a particular media type when the 1627 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1628 * For example, `Content-Type` can be set to `"application/json"`. 1629 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1630 * output only. It cannot be changed. 1631 * The headers below cannot be set or overridden: 1632 * * `Host` 1633 * * `X-Google-*` 1634 * * `X-AppEngine-*` 1635 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1636 * such as headers containing information about the task; see 1637 * [request 1638 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1639 * These headers are set only when the task is dispatched, so they are not 1640 * visible when the task is returned in a Cloud Tasks response. 1641 * Although there is no specific limit for the maximum number of headers or 1642 * the size, there is a limit on the maximum size of the 1643 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1644 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1645 * documentation. 1646 * </pre> 1647 * 1648 * <code>map<string, string> headers = 4;</code> 1649 */ 1650 @java.lang.Override containsHeaders(java.lang.String key)1651 public boolean containsHeaders(java.lang.String key) { 1652 if (key == null) { 1653 throw new NullPointerException("map key"); 1654 } 1655 return internalGetHeaders().getMap().containsKey(key); 1656 } 1657 /** Use {@link #getHeadersMap()} instead. */ 1658 @java.lang.Override 1659 @java.lang.Deprecated getHeaders()1660 public java.util.Map<java.lang.String, java.lang.String> getHeaders() { 1661 return getHeadersMap(); 1662 } 1663 /** 1664 * 1665 * 1666 * <pre> 1667 * HTTP request headers. 1668 * This map contains the header field names and values. 1669 * Headers can be set when the 1670 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1671 * Repeated headers are not supported but a header value can contain commas. 1672 * Cloud Tasks sets some headers to default values: 1673 * * `User-Agent`: By default, this header is 1674 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1675 * This header can be modified, but Cloud Tasks will append 1676 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1677 * modified `User-Agent`. 1678 * If the task has a 1679 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1680 * Tasks sets the following headers: 1681 * * `Content-Type`: By default, the `Content-Type` header is set to 1682 * `"application/octet-stream"`. The default can be overridden by explicitly 1683 * setting `Content-Type` to a particular media type when the 1684 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1685 * For example, `Content-Type` can be set to `"application/json"`. 1686 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1687 * output only. It cannot be changed. 1688 * The headers below cannot be set or overridden: 1689 * * `Host` 1690 * * `X-Google-*` 1691 * * `X-AppEngine-*` 1692 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1693 * such as headers containing information about the task; see 1694 * [request 1695 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1696 * These headers are set only when the task is dispatched, so they are not 1697 * visible when the task is returned in a Cloud Tasks response. 1698 * Although there is no specific limit for the maximum number of headers or 1699 * the size, there is a limit on the maximum size of the 1700 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1701 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1702 * documentation. 1703 * </pre> 1704 * 1705 * <code>map<string, string> headers = 4;</code> 1706 */ 1707 @java.lang.Override getHeadersMap()1708 public java.util.Map<java.lang.String, java.lang.String> getHeadersMap() { 1709 return internalGetHeaders().getMap(); 1710 } 1711 /** 1712 * 1713 * 1714 * <pre> 1715 * HTTP request headers. 1716 * This map contains the header field names and values. 1717 * Headers can be set when the 1718 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1719 * Repeated headers are not supported but a header value can contain commas. 1720 * Cloud Tasks sets some headers to default values: 1721 * * `User-Agent`: By default, this header is 1722 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1723 * This header can be modified, but Cloud Tasks will append 1724 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1725 * modified `User-Agent`. 1726 * If the task has a 1727 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1728 * Tasks sets the following headers: 1729 * * `Content-Type`: By default, the `Content-Type` header is set to 1730 * `"application/octet-stream"`. The default can be overridden by explicitly 1731 * setting `Content-Type` to a particular media type when the 1732 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1733 * For example, `Content-Type` can be set to `"application/json"`. 1734 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1735 * output only. It cannot be changed. 1736 * The headers below cannot be set or overridden: 1737 * * `Host` 1738 * * `X-Google-*` 1739 * * `X-AppEngine-*` 1740 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1741 * such as headers containing information about the task; see 1742 * [request 1743 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1744 * These headers are set only when the task is dispatched, so they are not 1745 * visible when the task is returned in a Cloud Tasks response. 1746 * Although there is no specific limit for the maximum number of headers or 1747 * the size, there is a limit on the maximum size of the 1748 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1749 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1750 * documentation. 1751 * </pre> 1752 * 1753 * <code>map<string, string> headers = 4;</code> 1754 */ 1755 @java.lang.Override getHeadersOrDefault( java.lang.String key, java.lang.String defaultValue)1756 public /* nullable */ java.lang.String getHeadersOrDefault( 1757 java.lang.String key, 1758 /* nullable */ 1759 java.lang.String defaultValue) { 1760 if (key == null) { 1761 throw new NullPointerException("map key"); 1762 } 1763 java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); 1764 return map.containsKey(key) ? map.get(key) : defaultValue; 1765 } 1766 /** 1767 * 1768 * 1769 * <pre> 1770 * HTTP request headers. 1771 * This map contains the header field names and values. 1772 * Headers can be set when the 1773 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1774 * Repeated headers are not supported but a header value can contain commas. 1775 * Cloud Tasks sets some headers to default values: 1776 * * `User-Agent`: By default, this header is 1777 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1778 * This header can be modified, but Cloud Tasks will append 1779 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1780 * modified `User-Agent`. 1781 * If the task has a 1782 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1783 * Tasks sets the following headers: 1784 * * `Content-Type`: By default, the `Content-Type` header is set to 1785 * `"application/octet-stream"`. The default can be overridden by explicitly 1786 * setting `Content-Type` to a particular media type when the 1787 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1788 * For example, `Content-Type` can be set to `"application/json"`. 1789 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1790 * output only. It cannot be changed. 1791 * The headers below cannot be set or overridden: 1792 * * `Host` 1793 * * `X-Google-*` 1794 * * `X-AppEngine-*` 1795 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1796 * such as headers containing information about the task; see 1797 * [request 1798 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1799 * These headers are set only when the task is dispatched, so they are not 1800 * visible when the task is returned in a Cloud Tasks response. 1801 * Although there is no specific limit for the maximum number of headers or 1802 * the size, there is a limit on the maximum size of the 1803 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1804 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1805 * documentation. 1806 * </pre> 1807 * 1808 * <code>map<string, string> headers = 4;</code> 1809 */ 1810 @java.lang.Override getHeadersOrThrow(java.lang.String key)1811 public java.lang.String getHeadersOrThrow(java.lang.String key) { 1812 if (key == null) { 1813 throw new NullPointerException("map key"); 1814 } 1815 java.util.Map<java.lang.String, java.lang.String> map = internalGetHeaders().getMap(); 1816 if (!map.containsKey(key)) { 1817 throw new java.lang.IllegalArgumentException(); 1818 } 1819 return map.get(key); 1820 } 1821 clearHeaders()1822 public Builder clearHeaders() { 1823 bitField0_ = (bitField0_ & ~0x00000008); 1824 internalGetMutableHeaders().getMutableMap().clear(); 1825 return this; 1826 } 1827 /** 1828 * 1829 * 1830 * <pre> 1831 * HTTP request headers. 1832 * This map contains the header field names and values. 1833 * Headers can be set when the 1834 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1835 * Repeated headers are not supported but a header value can contain commas. 1836 * Cloud Tasks sets some headers to default values: 1837 * * `User-Agent`: By default, this header is 1838 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1839 * This header can be modified, but Cloud Tasks will append 1840 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1841 * modified `User-Agent`. 1842 * If the task has a 1843 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1844 * Tasks sets the following headers: 1845 * * `Content-Type`: By default, the `Content-Type` header is set to 1846 * `"application/octet-stream"`. The default can be overridden by explicitly 1847 * setting `Content-Type` to a particular media type when the 1848 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1849 * For example, `Content-Type` can be set to `"application/json"`. 1850 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1851 * output only. It cannot be changed. 1852 * The headers below cannot be set or overridden: 1853 * * `Host` 1854 * * `X-Google-*` 1855 * * `X-AppEngine-*` 1856 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1857 * such as headers containing information about the task; see 1858 * [request 1859 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1860 * These headers are set only when the task is dispatched, so they are not 1861 * visible when the task is returned in a Cloud Tasks response. 1862 * Although there is no specific limit for the maximum number of headers or 1863 * the size, there is a limit on the maximum size of the 1864 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1865 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1866 * documentation. 1867 * </pre> 1868 * 1869 * <code>map<string, string> headers = 4;</code> 1870 */ removeHeaders(java.lang.String key)1871 public Builder removeHeaders(java.lang.String key) { 1872 if (key == null) { 1873 throw new NullPointerException("map key"); 1874 } 1875 internalGetMutableHeaders().getMutableMap().remove(key); 1876 return this; 1877 } 1878 /** Use alternate mutation accessors instead. */ 1879 @java.lang.Deprecated getMutableHeaders()1880 public java.util.Map<java.lang.String, java.lang.String> getMutableHeaders() { 1881 bitField0_ |= 0x00000008; 1882 return internalGetMutableHeaders().getMutableMap(); 1883 } 1884 /** 1885 * 1886 * 1887 * <pre> 1888 * HTTP request headers. 1889 * This map contains the header field names and values. 1890 * Headers can be set when the 1891 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1892 * Repeated headers are not supported but a header value can contain commas. 1893 * Cloud Tasks sets some headers to default values: 1894 * * `User-Agent`: By default, this header is 1895 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1896 * This header can be modified, but Cloud Tasks will append 1897 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1898 * modified `User-Agent`. 1899 * If the task has a 1900 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1901 * Tasks sets the following headers: 1902 * * `Content-Type`: By default, the `Content-Type` header is set to 1903 * `"application/octet-stream"`. The default can be overridden by explicitly 1904 * setting `Content-Type` to a particular media type when the 1905 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1906 * For example, `Content-Type` can be set to `"application/json"`. 1907 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1908 * output only. It cannot be changed. 1909 * The headers below cannot be set or overridden: 1910 * * `Host` 1911 * * `X-Google-*` 1912 * * `X-AppEngine-*` 1913 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1914 * such as headers containing information about the task; see 1915 * [request 1916 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1917 * These headers are set only when the task is dispatched, so they are not 1918 * visible when the task is returned in a Cloud Tasks response. 1919 * Although there is no specific limit for the maximum number of headers or 1920 * the size, there is a limit on the maximum size of the 1921 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1922 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1923 * documentation. 1924 * </pre> 1925 * 1926 * <code>map<string, string> headers = 4;</code> 1927 */ putHeaders(java.lang.String key, java.lang.String value)1928 public Builder putHeaders(java.lang.String key, java.lang.String value) { 1929 if (key == null) { 1930 throw new NullPointerException("map key"); 1931 } 1932 if (value == null) { 1933 throw new NullPointerException("map value"); 1934 } 1935 internalGetMutableHeaders().getMutableMap().put(key, value); 1936 bitField0_ |= 0x00000008; 1937 return this; 1938 } 1939 /** 1940 * 1941 * 1942 * <pre> 1943 * HTTP request headers. 1944 * This map contains the header field names and values. 1945 * Headers can be set when the 1946 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1947 * Repeated headers are not supported but a header value can contain commas. 1948 * Cloud Tasks sets some headers to default values: 1949 * * `User-Agent`: By default, this header is 1950 * `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1951 * This header can be modified, but Cloud Tasks will append 1952 * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1953 * modified `User-Agent`. 1954 * If the task has a 1955 * [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud 1956 * Tasks sets the following headers: 1957 * * `Content-Type`: By default, the `Content-Type` header is set to 1958 * `"application/octet-stream"`. The default can be overridden by explicitly 1959 * setting `Content-Type` to a particular media type when the 1960 * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. 1961 * For example, `Content-Type` can be set to `"application/json"`. 1962 * * `Content-Length`: This is computed by Cloud Tasks. This value is 1963 * output only. It cannot be changed. 1964 * The headers below cannot be set or overridden: 1965 * * `Host` 1966 * * `X-Google-*` 1967 * * `X-AppEngine-*` 1968 * In addition, Cloud Tasks sets some headers when the task is dispatched, 1969 * such as headers containing information about the task; see 1970 * [request 1971 * headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1972 * These headers are set only when the task is dispatched, so they are not 1973 * visible when the task is returned in a Cloud Tasks response. 1974 * Although there is no specific limit for the maximum number of headers or 1975 * the size, there is a limit on the maximum size of the 1976 * [Task][google.cloud.tasks.v2beta2.Task]. For more information, see the 1977 * [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] 1978 * documentation. 1979 * </pre> 1980 * 1981 * <code>map<string, string> headers = 4;</code> 1982 */ putAllHeaders(java.util.Map<java.lang.String, java.lang.String> values)1983 public Builder putAllHeaders(java.util.Map<java.lang.String, java.lang.String> values) { 1984 internalGetMutableHeaders().getMutableMap().putAll(values); 1985 bitField0_ |= 0x00000008; 1986 return this; 1987 } 1988 1989 private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; 1990 /** 1991 * 1992 * 1993 * <pre> 1994 * Payload. 1995 * The payload will be sent as the HTTP message body. A message 1996 * body, and thus a payload, is allowed only if the HTTP method is 1997 * POST or PUT. It is an error to set a data payload on a task with 1998 * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. 1999 * </pre> 2000 * 2001 * <code>bytes payload = 5;</code> 2002 * 2003 * @return The payload. 2004 */ 2005 @java.lang.Override getPayload()2006 public com.google.protobuf.ByteString getPayload() { 2007 return payload_; 2008 } 2009 /** 2010 * 2011 * 2012 * <pre> 2013 * Payload. 2014 * The payload will be sent as the HTTP message body. A message 2015 * body, and thus a payload, is allowed only if the HTTP method is 2016 * POST or PUT. It is an error to set a data payload on a task with 2017 * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. 2018 * </pre> 2019 * 2020 * <code>bytes payload = 5;</code> 2021 * 2022 * @param value The payload to set. 2023 * @return This builder for chaining. 2024 */ setPayload(com.google.protobuf.ByteString value)2025 public Builder setPayload(com.google.protobuf.ByteString value) { 2026 if (value == null) { 2027 throw new NullPointerException(); 2028 } 2029 payload_ = value; 2030 bitField0_ |= 0x00000010; 2031 onChanged(); 2032 return this; 2033 } 2034 /** 2035 * 2036 * 2037 * <pre> 2038 * Payload. 2039 * The payload will be sent as the HTTP message body. A message 2040 * body, and thus a payload, is allowed only if the HTTP method is 2041 * POST or PUT. It is an error to set a data payload on a task with 2042 * an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. 2043 * </pre> 2044 * 2045 * <code>bytes payload = 5;</code> 2046 * 2047 * @return This builder for chaining. 2048 */ clearPayload()2049 public Builder clearPayload() { 2050 bitField0_ = (bitField0_ & ~0x00000010); 2051 payload_ = getDefaultInstance().getPayload(); 2052 onChanged(); 2053 return this; 2054 } 2055 2056 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2057 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2058 return super.setUnknownFields(unknownFields); 2059 } 2060 2061 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2062 public final Builder mergeUnknownFields( 2063 final com.google.protobuf.UnknownFieldSet unknownFields) { 2064 return super.mergeUnknownFields(unknownFields); 2065 } 2066 2067 // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2beta2.AppEngineHttpRequest) 2068 } 2069 2070 // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta2.AppEngineHttpRequest) 2071 private static final com.google.cloud.tasks.v2beta2.AppEngineHttpRequest DEFAULT_INSTANCE; 2072 2073 static { 2074 DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta2.AppEngineHttpRequest(); 2075 } 2076 getDefaultInstance()2077 public static com.google.cloud.tasks.v2beta2.AppEngineHttpRequest getDefaultInstance() { 2078 return DEFAULT_INSTANCE; 2079 } 2080 2081 private static final com.google.protobuf.Parser<AppEngineHttpRequest> PARSER = 2082 new com.google.protobuf.AbstractParser<AppEngineHttpRequest>() { 2083 @java.lang.Override 2084 public AppEngineHttpRequest parsePartialFrom( 2085 com.google.protobuf.CodedInputStream input, 2086 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2087 throws com.google.protobuf.InvalidProtocolBufferException { 2088 Builder builder = newBuilder(); 2089 try { 2090 builder.mergeFrom(input, extensionRegistry); 2091 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2092 throw e.setUnfinishedMessage(builder.buildPartial()); 2093 } catch (com.google.protobuf.UninitializedMessageException e) { 2094 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2095 } catch (java.io.IOException e) { 2096 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2097 .setUnfinishedMessage(builder.buildPartial()); 2098 } 2099 return builder.buildPartial(); 2100 } 2101 }; 2102 parser()2103 public static com.google.protobuf.Parser<AppEngineHttpRequest> parser() { 2104 return PARSER; 2105 } 2106 2107 @java.lang.Override getParserForType()2108 public com.google.protobuf.Parser<AppEngineHttpRequest> getParserForType() { 2109 return PARSER; 2110 } 2111 2112 @java.lang.Override getDefaultInstanceForType()2113 public com.google.cloud.tasks.v2beta2.AppEngineHttpRequest getDefaultInstanceForType() { 2114 return DEFAULT_INSTANCE; 2115 } 2116 } 2117